]> git.baikalelectronics.ru Git - kernel.git/commit
vhost: fix clang build warning
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 6 Jun 2019 21:17:36 +0000 (17:17 -0400)
committerMichael S. Tsirkin <mst@redhat.com>
Thu, 6 Jun 2019 21:32:13 +0000 (17:32 -0400)
commit568c9c464de6b5eee63f3a7c718630a8fdfbfde9
tree47fbd372259265d0d17999e50735b2dfc6d559c9
parentd35bf66a421c691c460cb23df55e370589b43077
vhost: fix clang build warning

Clang warns:

  drivers/vhost/vhost.c:2085:5: warning: macro expansion producing
  'defined' has undefined behavior [-Wexpansion-to-defined]
  #if VHOST_ARCH_CAN_ACCEL_UACCESS
      ^
  drivers/vhost/vhost.h:98:38: note: expanded from macro
  'VHOST_ARCH_CAN_ACCEL_UACCESS'
  #define VHOST_ARCH_CAN_ACCEL_UACCESS defined(CONFIG_MMU_NOTIFIER) && \
                                       ^

It's being pedantic for the sake of portability, but the fix is easy
enough.

Rework the definition of VHOST_ARCH_CAN_ACCEL_UACCESS to expand to a constant.

Fixes: d35bf66a421c ("vhost: access vq metadata through kernel virtual address")
Link: https://github.com/ClangBuiltLinux/linux/issues/508
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Tested-by: Nathan Chancellor <natechancellor@gmail.com>
drivers/vhost/vhost.h