Skip to content

Commit 9ed145e

Browse files
dpenklergregkh
authored andcommitted
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: 6c52d5e ("staging: gpib: Add common include files for GPIB drivers") Signed-off-by: Dave Penkler <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent d3fbbfa commit 9ed145e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/staging/gpib/include/amcc5920.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ static const int bits_per_region = 8;
2222

2323
static inline uint32_t amcc_wait_state_bits(unsigned int region, unsigned int num_wait_states)
2424
{
25-
return (num_wait_states & 0x7) << (-region * bits_per_region);
25+
return (num_wait_states & 0x7) << (--region * bits_per_region);
2626
};
2727

2828
enum amcc_prefetch_bits {

0 commit comments

Comments
 (0)