summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorEverest K.C. <everestkc@everestkc.com.np>2024-10-16 10:55:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-10-16 11:04:49 +0300
commitfef10146def91e02126aeebaa9ff87871adbde1d (patch)
treee6e16fe75775c55d490e38758eff58257fa436ae /drivers
parent214c2754fb0af78fde9faa2e5f9693c4618f3d5b (diff)
downloadlinux-fef10146def91e02126aeebaa9ff87871adbde1d.tar.xz
staging: gpib: Remove unused value
The variable `complement_count` is assigned a value which is again overwritten in the next statement. Fix this by removing the first value assigning statement This issue was reported by Coverity Scan. Report: CID 1600790: (#1 of 1): Unused value (UNUSED_VALUE) assigned_value: Assigning value from length to complement_count here, but that stored value is overwritten before it can be used. Signed-off-by: Everest K.C. <everestkc@everestkc.com.np> Reviewed-by: Shuah Khan <skhan@linuxfoundation.org> Link: https://lore.kernel.org/r/20241016075544.4125-1-everestkc@everestkc.com.np Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/gpib/ni_usb/ni_usb_gpib.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
index 75f39e1f3ed1..28b17575a463 100644
--- a/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
+++ b/drivers/staging/gpib/ni_usb/ni_usb_gpib.c
@@ -759,7 +759,6 @@ static int ni_usb_write(gpib_board_t *board, uint8_t *buffer, size_t length,
if (!out_data)
return -ENOMEM;
out_data[i++] = 0x0d;
- complement_count = length;
complement_count = length - 1;
complement_count = ~complement_count;
out_data[i++] = complement_count & 0xff;