video-uclass: Fix logical-not-parentheses warning
PATCH 1/1 video-uclass: Fix logical-not-parentheses warning
With clang-4.0 and later we see:
warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
if ((!gd->flags & GD_FLG_RELOC))
^ ~And while the compiler suggests adding parenthesis around gd->flags, a reading of the code says that we want to know when GD_FLG_RELOC is not set and then return.
--- drivers/video/video-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/video-uclass.c +1 -1
@@ -272,7 +272,7 @@ static int video_post_bind(struct udevice *dev)ulong size;/* Before relocation there is nothing to do here */ -if ((!gd->flags &GD_FLG_RELOC )) +if (!(gd->flags &GD_FLG_RELOC ))return 0 ; size =alloc_fb (dev, &addr);if (addr < gd->video_bottom) {
Signature · 1 line
2.7.4
PATCH 1/1 video-uclass: Fix logical-not-parentheses warning
Quoted 10 lines · On Sun, 22 Apr 2018 09:47:48 -0400 Tom Rini trini at konsulko.com wrote:
With clang-4.0 and later we see:
warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]if ((!gd->flags & GD_FLG_RELOC)) ^ ~And while the compiler suggests adding parenthesis around
gd->flags, a reading of the code says that we want to know whenGD_FLG_RELOCis not set and then return.
Quoted 6 lines
Cc Simon Glass <[email protected]>Cc Anatolij Gustschin <[email protected]>Signed-off-by Tom Rini <[email protected]>--- drivers/video/video-uclass.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-video/master, thanks!
--
Anatolij