Skip to contentSkip to conversation

staging: gpib: Cleanup and fixes for lpvo driver

PATCH In review Dave Penkler 3 participants 7 messages Dec 4, 2024 Staging

lore
Share & tools
lore
#0 lore raw

cover staging: gpib: Cleanup and fixes for lpvo driver

These are the accumulated patches for the lpvo driver Patches 1 & 2: Remove redundant includes Patch 3: Fix protocol constants
Patch 4: Fix unreachable code

Dave Penkler (4):
staging: gpib: Remove useless include
staging: gpib: Remove duplicate include
staging: gpib: Fix erroneous removal of blank before newline
staging: gpib: Fix faulty workaround for assignment in if

 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)
Signature · 1 line
2.47.1
#1 lore raw

PATCH 1/4 staging: gpib: Remove useless include

linux/version.h not needed.

---
 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +0 -1
index 796c3a5be545..9a3271e885d2 100644
@@ -10,7 +10,6 @@
 
 /* base module includes */
 
-#include <linux/version.h>
 #include <linux/module.h>
 #include <linux/sched.h>
 #include <linux/init.h>
Signature · 1 line
2.47.1
#2 lore raw

PATCH 2/4 staging: gpib: Remove duplicate include

In reply to Dave Penkler

linux/uaccess.h is included more than once.

---
 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 1 -
 1 file changed, 1 deletion(-)
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +0 -1
index 9a3271e885d2..47db17418a74 100644
@@ -24,7 +24,6 @@
 #include <linux/timer.h>
 #include <linux/delay.h>
 #include <linux/sched/signal.h>
-#include <linux/uaccess.h>
 #include <linux/usb.h>
 
 #include "gpibP.h"
Signature · 1 line
2.47.1
#3 lore raw

PATCH 3/4 staging: gpib: Fix erroneous removal of blank before newline

In reply to Dave Penkler

Replace original blanks with "."

Fixes fce79512a96a ("staging: gpib: Add LPVO DIY USB GPIB driver")
---
 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +3 -3
index 47db17418a74..c30db3615f49 100644
@@ -97,8 +97,8 @@ module_param(debug, int, 0644);
 #define USB_GPIB_DEBUG_ON    "\nIBDE\xAA\n"
 #define USB_GPIB_SET_LISTEN  "\nIBDT0\n"
 #define USB_GPIB_SET_TALK    "\nIBDT1\n"
-#define USB_GPIB_SET_LINES   "\nIBDC\n"
-#define USB_GPIB_SET_DATA    "\nIBDM\n"
+#define USB_GPIB_SET_LINES   "\nIBDC.\n"
+#define USB_GPIB_SET_DATA    "\nIBDM.\n"
 #define USB_GPIB_READ_LINES  "\nIBD?C\n"
 #define USB_GPIB_READ_DATA   "\nIBD?M\n"
 #define USB_GPIB_READ_BUS    "\nIBD??\n"
@@ -587,7 +587,7 @@ static int usb_gpib_command(gpib_board_t *board,
 			    size_t *bytes_written)
 {
 	int i, retval;
-	char command[6] = "IBc\n";
+        char command[6]="IBc.\n";
 
 	DIA_LOG(1, "enter %p\n", board);
 
Signature · 1 line
2.47.1
maintainer
#4 lore raw

Re: [PATCH 3/4] staging: gpib: Fix erroneous removal of blank before newline

Quoted 26 lines · Dave Penkler

Replace original blanks with "."

Fixes fce79512a96a ("staging: gpib: Add LPVO DIY USB GPIB driver")
---
 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +2 -2
index 47db17418a74..c30db3615f49 100644
@@ -97,8 +97,8 @@ module_param(debug, int, 0644);
 #define USB_GPIB_DEBUG_ON    "\nIBDE\xAA\n"
 #define USB_GPIB_SET_LISTEN  "\nIBDT0\n"
 #define USB_GPIB_SET_TALK    "\nIBDT1\n"
-#define USB_GPIB_SET_LINES   "\nIBDC\n"
-#define USB_GPIB_SET_DATA    "\nIBDM\n"
+#define USB_GPIB_SET_LINES   "\nIBDC.\n"
+#define USB_GPIB_SET_DATA    "\nIBDM.\n"
 #define USB_GPIB_READ_LINES  "\nIBD?C\n"
 #define USB_GPIB_READ_DATA   "\nIBD?M\n"
 #define USB_GPIB_READ_BUS    "\nIBD??\n"

drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c static int usb_gpib_command(gpib_board_t *board, · line 590

Quoted 5 lines
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +1 -1
@@ -587,7 +587,7 @@ static int usb_gpib_command(gpib_board_t *board,
 			    size_t *bytes_written)
 {
 	int i, retval;
-	char command[6] = "IBc\n";
+        char command[6]="IBc.\n";

Did you run this through scripts/checkpatch.pl before sending it out? Please always do so.

And what is the "." for? Why is this needed? Please explain that in the changelog text.

thanks,

greg k-h

#5 lore raw

Re: [PATCH 3/4] staging: gpib: Fix erroneous removal of blank before newline

In reply to Dave Penkler

You're going to need to resend this. Run checkpatch.pl etc.

Quoted 2 lines · Dave Penkler

Replace original blanks with "."

Take a look at how this look like on lore:
https://lore.kernel.org/all/[email protected]/
The subject is hard to see. It's better to think of it as the title instead of the first sentence.

To be honest, I don't really understand this commit. Presumably this gets printed out or something? Can you cut a paste a few lines of before and after text to show us how it looks like?

regards,
dan carpenter

#6 lore raw

PATCH 4/4 staging: gpib: Fix faulty workaround for assignment in if

In reply to Dave Penkler

This was detected by Coverity.

Add the missing assignment in the else branch of the if

Fixes fce79512a96a ("staging: gpib: Add LPVO DIY USB GPIB driver")
---
 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +1 -1
index c30db3615f49..5114f6c519e5 100644
@@ -899,7 +899,7 @@ static int usb_gpib_read(gpib_board_t *board,
 
 		} else {
 			/* we are in the closing <DLE><ETX> sequence */
-
+			c = nc;
 			if (c == ETX) {
 				c = one_char(board, &b);
 				if (c == ACK) {
Signature · 1 line
2.47.1