Skip to contentSkip to conversation

staging: gpib: some cleanups in lpvo_usb_gpib.c

PATCH New Gaston Gonzalez 1 participant 5 messages Mar 5, 2025 Staging

lore
Share & tools
lore
#0 lore raw

v2 cover staging: gpib: some cleanups in lpvo_usb_gpib.c

This series comprises three kernel-doc comments fixes and one commented-out code cleanup.

v1 -> v2: remove extra blank line in patch 3: 'staging: gpib: fix kernel-doc section for usb_gpib_line_status() function'

Gaston Gonzalez (4):
staging: gpib: fix kernel-doc section for write_loop() function
staging: gpib: fix kernel-doc section for function
usb_gpib_interface_clear()
staging: gpib: fix kernel-doc section for usb_gpib_line_status()
function
staging: gpib: remove commented-out lines

 .../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c        | 26 +++++--------------
 1 file changed, 7 insertions(+), 19 deletions(-)
Signature · 1 line
2.49.0.rc0
#1 lore raw

PATCH v2 1/4 staging: gpib: fix kernel-doc section for write_loop() function

Add a colon character in the kernel-doc section of write_loop() in order 'leng' to be picked as argument by the kernel-doc compiler.

This change fix the following warning:

warning: Function parameter or struct member 'leng' not described in 'send_command'

---
v1 -> v2: no changes in this patch.

 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 50faa0c17617..eeabbdb39057 100644
@@ -232,7 +232,7 @@ static int write_loop(void *dev, char *msg, int leng)
  *
  * @board:    the gpib_board_struct data area for this gpib interface
  * @msg:      the byte sequence.
- * @leng      the byte sequence length; can be given as zero and is
+ * @leng:     the byte sequence length; can be given as zero and is
  *	      computed automatically, but if 'msg' contains a zero byte,
  *	      it has to be given explicitly.
  */
Signature · 1 line
2.49.0.rc0
#2 lore raw

PATCH v2 2/4 staging: gpib: fix kernel-doc section for function usb_gpib_interface_clear()

In reply to Gaston Gonzalez

Add '@' character in kernel-doc comment in order 'assert' to be picked as argument by the kernel-doc compiler.

This change fix the following warning:

warning: Function parameter or struct member 'assert' not described in 'usb_gpib_interface_clear'

---
v1 -> v2: no changes in this patch.

 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 eeabbdb39057..090857824d07 100644
@@ -621,7 +621,7 @@ static int usb_gpib_go_to_standby(gpib_board_t *board)
  * usb_gpib_interface_clear() - Assert or de-assert IFC
  *
  * @board:    the gpib_board data area for this gpib interface
- * assert:    1: assert IFC;  0: de-assert IFC
+ * @assert:   1: assert IFC;  0: de-assert IFC
  *
  *    Currently on the assert request we issue the lpvo IBZ
  *    command that cycles IFC low for 100 usec, then we ignore
Signature · 1 line
2.49.0.rc0
#3 lore raw

PATCH v2 3/4 staging: gpib: fix kernel-doc section for usb_gpib_line_status() function

In reply to Gaston Gonzalez

The function name field in the kernel-doc section for the usb_gpib_line_status() is defined as 'line_status'. In addition, after the kernel-doc section, there are three macro definition instead of the function definition.

These issues trigger the warning:

warning: expecting prototype for line_status(). Prototype was for WQT() instead.

Fix the warning by renaming the function in the kernel-doc section and by moving the macros to the beginning of the file with the rest of macros definition.

---
v1 -> v2: remove extra blank line added by mistake in v1.

 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +5 -6
index 090857824d07..4a8e5905daf9 100644
@@ -78,6 +78,10 @@ module_param(debug, int, 0644);
 			dev_dbg(board->gpib_dev, format, ## __VA_ARGS__); } \
 	while (0)
 
+#define WQT wait_queue_entry_t
+#define WQH head
+#define WQE entry
+
 /* standard and extended command sets of the usb-gpib adapter */
 
 #define USB_GPIB_ON	 "\nIB\n"
@@ -644,17 +648,12 @@ static void usb_gpib_interface_clear(gpib_board_t *board, int assert)
 }
 
 /**
- * line_status() - Read the status of the bus lines.
+ * usb_gpib_line_status() - Read the status of the bus lines.
  *
  *  @board:    the gpib_board data area for this gpib interface
  *
  *    We can read all lines.
  */
-
-#define WQT wait_queue_entry_t
-#define WQH head
-#define WQE entry
-
 static int usb_gpib_line_status(const gpib_board_t *board)
 {
 	int buffer;
Signature · 1 line
2.49.0.rc0
#4 lore raw

PATCH v2 4/4 staging: gpib: remove commented-out lines

In reply to Gaston Gonzalez

Remove commented-out code in function write_loop().

---
v1 -> v2: no changes in this patch.

 drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 11 -----------
 1 file changed, 11 deletions(-)
drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c +0 -11
index 4a8e5905daf9..08c64b111a1f 100644
@@ -217,18 +217,7 @@ static inline int usec_diff(struct timespec64 *a, struct timespec64 *b)
 
 static int write_loop(void *dev, char *msg, int leng)
 {
-//	  int nchar = 0, val;
-
-//	  do {
-
 	return skel_do_write(dev, msg, leng);
-
-//		  if (val < 1) {
-//			  return -EIO;
-//		  }
-//		  nchar +=val;
-//	  } while (nchar < leng);
-//	  return leng;
 }
 
 /**
Signature · 1 line
2.49.0.rc0