Skip to content

Commit

Permalink
drm/mwv207: add parentheses to evaluate the bitwise operator first
Browse files Browse the repository at this point in the history
Fix a comlipe error with clang-19:

drivers/gpu/drm/mwv207/mwv207_bo.c:165:6: error: logical not is only applied to the left hand side of this bitwise operator [-Werror,-Wlogical-not-parentheses]
  165 |         if (!jbo->flags & (1<<0))
      |             ^           ~
drivers/gpu/drm/mwv207/mwv207_bo.c:165:6: note: add parentheses after the '!' to evaluate the bitwise operator first
  165 |         if (!jbo->flags & (1<<0))
      |             ^
      |              (                  )
drivers/gpu/drm/mwv207/mwv207_bo.c:165:6: note: add parentheses around left hand side expression to silence this warning
  165 |         if (!jbo->flags & (1<<0))
      |             ^
      |             (          )
1 error generated.

Signed-off-by: WangYuli <[email protected]>
  • Loading branch information
Avenger-285714 committed Nov 25, 2024
1 parent 895a1e0 commit e73fb10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/mwv207/mwv207_bo.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ int mwv207_bo_kmap_reserved(struct mwv207_bo *jbo, void **ptr)
bool is_iomem;
int ret;

if (!jbo->flags & (1<<0))
if ((!jbo->flags) & (1<<0))
return -EPERM;

if (jbo->kptr) {
Expand Down

0 comments on commit e73fb10

Please sign in to comment.