[PATCH v1 01/18] staging: gpib: struct typing for gpib_interface

Michael Rubin posted 18 patches 10 months ago
There is a newer version of this series
[PATCH v1 01/18] staging: gpib: struct typing for gpib_interface
Posted by Michael Rubin 10 months ago
Using Linux code style for gpib_interface struct in .h to allow drivers to
migrate.

Adhering to Linux code style.

In general, a pointer, or a struct that has elements that can reasonably be
directly accessed should never be a typedef.

Reported by CheckPatch

WARNING: do not add new typedefs

Signed-off-by: Michael Rubin <matchstick@neverthere.org>
---
 drivers/staging/gpib/include/gpib_types.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h
index 2d9b9be683f8..10d8776ef425 100644
--- a/drivers/staging/gpib/include/gpib_types.h
+++ b/drivers/staging/gpib/include/gpib_types.h
@@ -22,7 +22,7 @@
 #include <linux/timer.h>
 #include <linux/interrupt.h>
 
-typedef struct gpib_interface_struct gpib_interface_t;
+typedef struct gpib_interface gpib_interface_t;
 struct gpib_board;
 
 /* config parameters that are only used by driver attach functions */
@@ -51,7 +51,7 @@ typedef struct {
 	char *serial_number;
 } gpib_board_config_t;
 
-struct gpib_interface_struct {
+struct gpib_interface {
 	/* name of board */
 	char *name;
 	/* attach() initializes board and allocates resources */
-- 
2.43.0
Re: [PATCH v1 01/18] staging: gpib: struct typing for gpib_interface
Posted by Dan Carpenter 10 months ago
On Tue, Apr 08, 2025 at 10:24:47PM +0000, Michael Rubin wrote:
> Using Linux code style for gpib_interface struct in .h to allow drivers to
> migrate.
> 
> Adhering to Linux code style.
> 
> In general, a pointer, or a struct that has elements that can reasonably be
> directly accessed should never be a typedef.
> 
> Reported by CheckPatch
> 
> WARNING: do not add new typedefs
> 

This commit message is quite long but it's totally unrelated to what the
patch does.

This commit message should just say "Having the word "_struct" in the
name of the struct doesn't add any information so rename struct
gpib_interface_struct to struct gpib_interface."

regards,
dan carpenter

> Signed-off-by: Michael Rubin <matchstick@neverthere.org>
> ---
>  drivers/staging/gpib/include/gpib_types.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/gpib/include/gpib_types.h b/drivers/staging/gpib/include/gpib_types.h
> index 2d9b9be683f8..10d8776ef425 100644
> --- a/drivers/staging/gpib/include/gpib_types.h
> +++ b/drivers/staging/gpib/include/gpib_types.h
> @@ -22,7 +22,7 @@
>  #include <linux/timer.h>
>  #include <linux/interrupt.h>
>  
> -typedef struct gpib_interface_struct gpib_interface_t;
> +typedef struct gpib_interface gpib_interface_t;
>  struct gpib_board;
>  
>  /* config parameters that are only used by driver attach functions */
> @@ -51,7 +51,7 @@ typedef struct {
>  	char *serial_number;
>  } gpib_board_config_t;
>  
> -struct gpib_interface_struct {
> +struct gpib_interface {
>  	/* name of board */
>  	char *name;
>  	/* attach() initializes board and allocates resources */
> -- 
> 2.43.0
>
Re: [PATCH v1 01/18] staging: gpib: struct typing for gpib_interface
Posted by Michael Rubin 10 months ago
On Wed, Apr 09, 2025 at 11:26:41AM +0300, Dan Carpenter wrote:
> On Tue, Apr 08, 2025 at 10:24:47PM +0000, Michael Rubin wrote:
> > Using Linux code style for gpib_interface struct in .h to allow drivers to
> > migrate.
> > 
> > Adhering to Linux code style.
> > 
> > In general, a pointer, or a struct that has elements that can reasonably be
> > directly accessed should never be a typedef.
> > 
> > Reported by CheckPatch
> > 
> > WARNING: do not add new typedefs
> > 
> 
> This commit message is quite long but it's totally unrelated to what the
> patch does.
> 
> This commit message should just say "Having the word "_struct" in the
> name of the struct doesn't add any information so rename struct
> gpib_interface_struct to struct gpib_interface."

Thank you for the input. New commit marked v2 sent to the list.

Michael Rubin
Re: [PATCH v1 01/18] staging: gpib: struct typing for gpib_interface
Posted by Greg KH 9 months, 4 weeks ago
On Wed, Apr 09, 2025 at 05:52:51PM +0000, Michael Rubin wrote:
> On Wed, Apr 09, 2025 at 11:26:41AM +0300, Dan Carpenter wrote:
> > On Tue, Apr 08, 2025 at 10:24:47PM +0000, Michael Rubin wrote:
> > > Using Linux code style for gpib_interface struct in .h to allow drivers to
> > > migrate.
> > > 
> > > Adhering to Linux code style.
> > > 
> > > In general, a pointer, or a struct that has elements that can reasonably be
> > > directly accessed should never be a typedef.
> > > 
> > > Reported by CheckPatch
> > > 
> > > WARNING: do not add new typedefs
> > > 
> > 
> > This commit message is quite long but it's totally unrelated to what the
> > patch does.
> > 
> > This commit message should just say "Having the word "_struct" in the
> > name of the struct doesn't add any information so rename struct
> > gpib_interface_struct to struct gpib_interface."
> 
> Thank you for the input. New commit marked v2 sent to the list.

I think we need a whole new v2 series, I can't just pick up 1 of the 18
patches as a v2 as our tools will get very confused.  Can you just
rebase and resend a v3 for the whole thing?

thanks,

greg k-h
Re: [PATCH v1 01/18] staging: gpib: struct typing for gpib_interface
Posted by Michael Rubin 9 months, 4 weeks ago
On Tue, Apr 15, 2025 at 04:41:47PM +0200, Greg KH wrote:
> On Wed, Apr 09, 2025 at 05:52:51PM +0000, Michael Rubin wrote:
> > On Wed, Apr 09, 2025 at 11:26:41AM +0300, Dan Carpenter wrote:
> > > On Tue, Apr 08, 2025 at 10:24:47PM +0000, Michael Rubin wrote:
> > > > Using Linux code style for gpib_interface struct in .h to allow drivers to
> > > > migrate.
> > > > 
> > > > Adhering to Linux code style.
> > > > 
> > > > In general, a pointer, or a struct that has elements that can reasonably be
> > > > directly accessed should never be a typedef.
> > > > 
> > > > Reported by CheckPatch
> > > > 
> > > > WARNING: do not add new typedefs
> > > > 
> > > 
> > > This commit message is quite long but it's totally unrelated to what the
> > > patch does.
> > > 
> > > This commit message should just say "Having the word "_struct" in the
> > > name of the struct doesn't add any information so rename struct
> > > gpib_interface_struct to struct gpib_interface."
> > 
> > Thank you for the input. New commit marked v2 sent to the list.
> 
> I think we need a whole new v2 series, I can't just pick up 1 of the 18
> patches as a v2 as our tools will get very confused.  Can you just
> rebase and resend a v3 for the whole thing?

I sent a new series. Hope that it looks ok.

Michael