forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
-Wshift-count-overflow in drivers/vdpa/mlx5/net/mlx5_vnet.c #1140
Labels
-Wshift-count-overflow
[BUG] linux
A bug that should be fixed in the mainline kernel.
[FIXED][LINUX] 5.9
This bug was fixed in Linux 5.9
Comments
fengguang
pushed a commit
to 0day-ci/linux
that referenced
this issue
Aug 21, 2020
Clang warns several times when building for 32-bit ARM along the lines of: drivers/vdpa/mlx5/net/mlx5_vnet.c:1462:31: warning: shift count >= width of type [-Wshift-count-overflow] ndev->mvdev.mlx_features |= BIT(VIRTIO_F_VERSION_1); ^~~~~~~~~~~~~~~~~~~~~~~ This is related to the BIT macro, which uses an unsigned long literal, which is 32-bit on ARM so having a shift equal to or larger than 32 will cause this warning, such as the above, where VIRTIO_F_VERSION_1 is 32. To avoid this, use BIT_ULL, which will be an unsigned long long. This matches the size of the features field throughout this driver, which is u64 so there should be no functional change. Fixes: 1a86b37 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Link: ClangBuiltLinux#1140 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
torvalds
pushed a commit
to torvalds/linux
that referenced
this issue
Aug 26, 2020
Clang warns several times when building for 32-bit ARM along the lines of: drivers/vdpa/mlx5/net/mlx5_vnet.c:1462:31: warning: shift count >= width of type [-Wshift-count-overflow] ndev->mvdev.mlx_features |= BIT(VIRTIO_F_VERSION_1); ^~~~~~~~~~~~~~~~~~~~~~~ This is related to the BIT macro, which uses an unsigned long literal, which is 32-bit on ARM so having a shift equal to or larger than 32 will cause this warning, such as the above, where VIRTIO_F_VERSION_1 is 32. To avoid this, use BIT_ULL, which will be an unsigned long long. This matches the size of the features field throughout this driver, which is u64 so there should be no functional change. Fixes: 1a86b37 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Link: ClangBuiltLinux#1140 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Link: https://lore.kernel.org/r/20200821225018.940798-1-natechancellor@gmail.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Acked-by: Eli Cohen <elic@nvidia.com>
Merged into mainline: https://git.kernel.org/linus/cbb523594eb718944b726ba52bb43a1d66188a17 |
gregmarsden
pushed a commit
to oracle/linux-uek
that referenced
this issue
Dec 18, 2020
Clang warns several times when building for 32-bit ARM along the lines of: drivers/vdpa/mlx5/net/mlx5_vnet.c:1462:31: warning: shift count >= width of type [-Wshift-count-overflow] ndev->mvdev.mlx_features |= BIT(VIRTIO_F_VERSION_1); ^~~~~~~~~~~~~~~~~~~~~~~ This is related to the BIT macro, which uses an unsigned long literal, which is 32-bit on ARM so having a shift equal to or larger than 32 will cause this warning, such as the above, where VIRTIO_F_VERSION_1 is 32. To avoid this, use BIT_ULL, which will be an unsigned long long. This matches the size of the features field throughout this driver, which is u64 so there should be no functional change. Fixes: 1a86b37 ("vdpa/mlx5: Add VDPA driver for supported mlx5 devices") Link: ClangBuiltLinux/linux#1140 Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Link: https://lore.kernel.org/r/20200821225018.940798-1-natechancellor@gmail.com Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Reported-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested Acked-by: Eli Cohen <elic@nvidia.com> (cherry picked from commit cbb5235) Conflicts: drivers/vdpa/mlx5/net/mlx5_vnet.c Remove virtio feature bits that are absent from UEK: VIRTIO_NET_F_RSS VIRTIO_NET_F_RSC_EXT VIRTIO_NET_F_HASH_REPORT Orabug: 32121107 Signed-off-by: Si-Wei Liu <si-wei.liu@oracle.com> Reviewed-by: Joao Martins <joao.m.martins@oracle.com> Reviewed-by: Qing Huang <qing.huang@oracle.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
-Wshift-count-overflow
[BUG] linux
A bug that should be fixed in the mainline kernel.
[FIXED][LINUX] 5.9
This bug was fixed in Linux 5.9
Several instances along the lines of:
Patch submitted: https://lore.kernel.org/r/20200821225018.940798-1-natechancellor@gmail.com
The text was updated successfully, but these errors were encountered: