Commit 4449dd0a authored by Markus Elfring's avatar Markus Elfring Committed by Mauro Carvalho Chehab

media: s5p-mfc: Adjust a null pointer check in four functions

The script “checkpatch.pl” pointed information out like the following.

Comparison to NULL could be written...

Thus fix the affected source code places.
Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Signed-off-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent d7f15bde
...@@ -470,7 +470,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev, ...@@ -470,7 +470,7 @@ static void s5p_mfc_handle_error(struct s5p_mfc_dev *dev,
{ {
mfc_err("Interrupt Error: %08x\n", err); mfc_err("Interrupt Error: %08x\n", err);
if (ctx != NULL) { if (ctx) {
/* Error recovery is dependent on the state of context */ /* Error recovery is dependent on the state of context */
switch (ctx->state) { switch (ctx->state) {
case MFCINST_RES_CHANGE_INIT: case MFCINST_RES_CHANGE_INIT:
...@@ -508,7 +508,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx, ...@@ -508,7 +508,7 @@ static void s5p_mfc_handle_seq_done(struct s5p_mfc_ctx *ctx,
{ {
struct s5p_mfc_dev *dev; struct s5p_mfc_dev *dev;
if (ctx == NULL) if (!ctx)
return; return;
dev = ctx->dev; dev = ctx->dev;
if (ctx->c_ops->post_seq_start) { if (ctx->c_ops->post_seq_start) {
...@@ -562,7 +562,7 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx, ...@@ -562,7 +562,7 @@ static void s5p_mfc_handle_init_buffers(struct s5p_mfc_ctx *ctx,
struct s5p_mfc_buf *src_buf; struct s5p_mfc_buf *src_buf;
struct s5p_mfc_dev *dev; struct s5p_mfc_dev *dev;
if (ctx == NULL) if (!ctx)
return; return;
dev = ctx->dev; dev = ctx->dev;
s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev); s5p_mfc_hw_call(dev->mfc_ops, clear_int_flags, dev);
...@@ -1289,7 +1289,7 @@ static int s5p_mfc_probe(struct platform_device *pdev) ...@@ -1289,7 +1289,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
return PTR_ERR(dev->regs_base); return PTR_ERR(dev->regs_base);
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) { if (!res) {
dev_err(&pdev->dev, "failed to get irq resource\n"); dev_err(&pdev->dev, "failed to get irq resource\n");
return -ENOENT; return -ENOENT;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment