From: Dave Penkler Date: Tue, 20 May 2025 15:51:00 +0000 (+0200) Subject: staging: gpib: Fix secondary address restriction X-Git-Tag: v6.16-rc1~31^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5aac95320d0f17f1098960e903ce5e087f42bc70;p=thirdparty%2Fkernel%2Flinux.git 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: 2da03e7e31aa ("staging: gpib: Add user api include files") Signed-off-by: Dave Penkler Link: https://lore.kernel.org/r/20250520155100.5808-1-dpenkler@gmail.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/gpib/uapi/gpib.h b/drivers/staging/gpib/uapi/gpib.h index 667e2fcc9130..41500cee4029 100644 --- a/drivers/staging/gpib/uapi/gpib.h +++ b/drivers/staging/gpib/uapi/gpib.h @@ -136,7 +136,7 @@ static inline __u8 MTA(unsigned int addr) static inline __u8 MSA(unsigned int addr) { - return gpib_address_restrict(addr) | SAD; + return (addr & 0x1f) | SAD; } static inline __u8 PPE_byte(unsigned int dio_line, int sense)