From: Dave Penkler Date: Thu, 16 Jan 2025 11:00:14 +0000 (+0100) Subject: staging: gpib: Fix inadvertent negative shift X-Git-Tag: v6.14-rc1~68^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ed145e64f0af9a22e95f79940c540affbd939e2;p=thirdparty%2Flinux.git staging: gpib: Fix inadvertent negative shift During the initial checkpatch cleanup, when removing blanks after open parentheses, a minus sign in the argument of a shift operation was deleted by mistake. This transformed a pre-decrement operation into a negation. The result of a negative shift is undefined and a warning was signalled by sparse. Restore the pre-decrement operation. Fixes: 6c52d5e3cde2 ("staging: gpib: Add common include files for GPIB drivers") Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250116110014.15577-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/include/amcc5920.h b/drivers/staging/gpib/include/amcc5920.h index 766b3799223f1..7a88bd282feb5 100644 --- a/drivers/staging/gpib/include/amcc5920.h +++ b/drivers/staging/gpib/include/amcc5920.h @@ -22,7 +22,7 @@ static const int bits_per_region = 8; static inline uint32_t amcc_wait_state_bits(unsigned int region, unsigned int num_wait_states) { - return (num_wait_states & 0x7) << (-region * bits_per_region); + return (num_wait_states & 0x7) << (--region * bits_per_region); }; enum amcc_prefetch_bits {