2018-07-25 17:58:20

by kernel test robot

[permalink] [raw]
Subject: drivers/video/fbdev/omap2/omapfb/omapfb-main.c:290:9-10: WARNING: return of 0/1 in function 'cmp_var_to_colormode' with return type bool

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9981b4fb8684883dcc0daf088891ff32260b9794
commit: 7378f1149884b183631c6c16c0f1c62bcd7d759d media: omap2: omapfb: allow building it with COMPILE_TEST
date: 3 months ago


coccinelle warnings: (new ones prefixed by >>)

>> drivers/video/fbdev/omap2/omapfb/omapfb-main.c:290:9-10: WARNING: return of 0/1 in function 'cmp_var_to_colormode' with return type bool
--
>> drivers/video/fbdev/omap2/omapfb/dss/dss_features.c:895:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)
--
>> drivers/video/fbdev/omap2/omapfb/dss/core.c:141:2-26: WARNING: NULL check before some freeing functions is not needed.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation


2018-07-25 17:59:05

by Fengguang Wu

[permalink] [raw]
Subject: [PATCH] media: omap2: omapfb: fix boolreturn.cocci warnings

From: kbuild test robot <[email protected]>

drivers/video/fbdev/omap2/omapfb/omapfb-main.c:290:9-10: WARNING: return of 0/1 in function 'cmp_var_to_colormode' with return type bool

Return statements in functions returning bool should use
true/false instead of 1/0.
Generated by: scripts/coccinelle/misc/boolreturn.cocci

Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST")
Signed-off-by: kbuild test robot <[email protected]>
---

omapfb-main.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/fbdev/omap2/omapfb/omapfb-main.c
@@ -287,7 +287,7 @@ static bool cmp_var_to_colormode(struct
var->red.length == 0 ||
var->blue.length == 0 ||
var->green.length == 0)
- return 0;
+ return false;

return var->bits_per_pixel == color->bits_per_pixel &&
cmp_component(&var->red, &color->red) &&

2018-07-25 17:59:32

by Fengguang Wu

[permalink] [raw]
Subject: [PATCH] media: omap2: omapfb: fix ifnullfree.cocci warnings

From: kbuild test robot <[email protected]>

drivers/video/fbdev/omap2/omapfb/dss/core.c:141:2-26: WARNING: NULL check before some freeing functions is not needed.

NULL check before some freeing functions is not needed.

Based on checkpatch warning
"kfree(NULL) is safe this check is probably not required"
and kfreeaddr.cocci by Julia Lawall.

Generated by: scripts/coccinelle/free/ifnullfree.cocci

Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST")
Signed-off-by: kbuild test robot <[email protected]>
---

Please take the patch only if it's a positive warning. Thanks!

core.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/video/fbdev/omap2/omapfb/dss/core.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/core.c
@@ -137,8 +137,7 @@ static int dss_initialize_debugfs(void)

static void dss_uninitialize_debugfs(void)
{
- if (dss_debugfs_dir)
- debugfs_remove_recursive(dss_debugfs_dir);
+ debugfs_remove_recursive(dss_debugfs_dir);
}

int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *))

2018-07-25 18:02:01

by Fengguang Wu

[permalink] [raw]
Subject: [PATCH] media: omap2: omapfb: fix bugon.cocci warnings

From: kbuild test robot <[email protected]>

drivers/video/fbdev/omap2/omapfb/dss/dss_features.c:895:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)

Use BUG_ON instead of a if condition followed by BUG.

Semantic patch information:
This makes an effort to find cases where BUG() follows an if
condition on an expression and replaces the if condition and BUG()
with a BUG_ON having the conditional expression of the if statement
as argument.

Generated by: scripts/coccinelle/misc/bugon.cocci

Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST")
Signed-off-by: kbuild test robot <[email protected]>
---

Please take the patch only if it's a positive warning. Thanks!

dss_features.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

--- a/drivers/video/fbdev/omap2/omapfb/dss/dss_features.c
+++ b/drivers/video/fbdev/omap2/omapfb/dss/dss_features.c
@@ -891,8 +891,7 @@ bool dss_has_feature(enum dss_feat_id id

void dss_feat_get_reg_field(enum dss_feat_reg_field id, u8 *start, u8 *end)
{
- if (id >= omap_current_dss_features->num_reg_fields)
- BUG();
+ BUG_ON(id >= omap_current_dss_features->num_reg_fields);

*start = omap_current_dss_features->reg_fields[id].start;
*end = omap_current_dss_features->reg_fields[id].end;

Subject: Re: [PATCH] media: omap2: omapfb: fix boolreturn.cocci warnings

On Thursday, July 26, 2018 01:57:00 AM kbuild test robot wrote:
> From: kbuild test robot <[email protected]>
>
> drivers/video/fbdev/omap2/omapfb/omapfb-main.c:290:9-10: WARNING: return of 0/1 in function 'cmp_var_to_colormode' with return type bool
>
> Return statements in functions returning bool should use
> true/false instead of 1/0.
> Generated by: scripts/coccinelle/misc/boolreturn.cocci
>
> Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST")
> Signed-off-by: kbuild test robot <[email protected]>

Patch queued for 4.19 (w/ "media"->"fbdev" fixup in the patch title), thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


Subject: Re: [PATCH] media: omap2: omapfb: fix bugon.cocci warnings

On Thursday, July 26, 2018 01:57:00 AM kbuild test robot wrote:
> From: kbuild test robot <[email protected]>
>
> drivers/video/fbdev/omap2/omapfb/dss/dss_features.c:895:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG.
> Please make sure the condition has no side effects (see conditional BUG_ON definition in include/asm-generic/bug.h)
>
> Use BUG_ON instead of a if condition followed by BUG.
>
> Semantic patch information:
> This makes an effort to find cases where BUG() follows an if
> condition on an expression and replaces the if condition and BUG()
> with a BUG_ON having the conditional expression of the if statement
> as argument.
>
> Generated by: scripts/coccinelle/misc/bugon.cocci
>
> Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST")
> Signed-off-by: kbuild test robot <[email protected]>

Patch queued for 4.19 (w/ "media"->"fbdev" fixup in the patch title), thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics


Subject: Re: [PATCH] media: omap2: omapfb: fix ifnullfree.cocci warnings

On Thursday, July 26, 2018 01:57:00 AM kbuild test robot wrote:
> From: kbuild test robot <[email protected]>
>
> drivers/video/fbdev/omap2/omapfb/dss/core.c:141:2-26: WARNING: NULL check before some freeing functions is not needed.
>
> NULL check before some freeing functions is not needed.
>
> Based on checkpatch warning
> "kfree(NULL) is safe this check is probably not required"
> and kfreeaddr.cocci by Julia Lawall.
>
> Generated by: scripts/coccinelle/free/ifnullfree.cocci
>
> Fixes: 7378f1149884 ("media: omap2: omapfb: allow building it with COMPILE_TEST")
> Signed-off-by: kbuild test robot <[email protected]>

Patch queued for 4.19 (w/ "media"->"fbdev" fixup in the patch title), thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics