Skip to content

Commit 5aac953

Browse files
dpenklergregkh
authored andcommitted
staging: gpib: Fix secondary address restriction
GPIB secondary addresses have valid values between 0 and 31 inclusive. The Make Secondary Address function MSA, used to form the protocol byte, was using the gpib_address_restrict function erroneously restricting the address range to 0 through 30. Remove the call to gpib_address_restrict and simply trim the address to 5 bits. Fixes: 2da03e7 ("staging: gpib: Add user api include files") 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 7a7f07f commit 5aac953

File tree

1 file changed

+1
-1
lines changed
  • drivers/staging/gpib/uapi

1 file changed

+1
-1
lines changed

drivers/staging/gpib/uapi/gpib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ static inline __u8 MTA(unsigned int addr)
136136

137137
static inline __u8 MSA(unsigned int addr)
138138
{
139-
return gpib_address_restrict(addr) | SAD;
139+
return (addr & 0x1f) | SAD;
140140
}
141141

142142
static inline __u8 PPE_byte(unsigned int dio_line, int sense)

0 commit comments

Comments
 (0)