All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Remove typedefs and rename struct
@ 2015-03-16 19:52 Cristina Opriceana
  2015-03-16 19:55 ` [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs Cristina Opriceana
  2015-03-16 19:56 ` [PATCH v2 2/2] Staging: rtl8192u: Rename struct to avoid CamelCase Cristina Opriceana
  0 siblings, 2 replies; 7+ messages in thread
From: Cristina Opriceana @ 2015-03-16 19:52 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patchset removes unnecessary type definitions for structs
detected by coccinelle and renames the structures in order to
keep the notations consistent.

Changes in v2:
 - update script to drop _t in dig_t in [PATCH 1/2]

Cristina Opriceana (2):
  Staging: rtl8192u: Staging: rtl8192u: Do not add new typedefs
  Staging: Staging: rtl8192u: Rename struct to avoid CamelCase

 drivers/staging/rtl8192u/r8192U_dm.c |  5 +++--
 drivers/staging/rtl8192u/r8192U_dm.h | 12 ++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

-- 
1.9.1



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs
  2015-03-16 19:52 [PATCH v2 0/2] Remove typedefs and rename struct Cristina Opriceana
@ 2015-03-16 19:55 ` Cristina Opriceana
  2015-03-17 15:23   ` [Outreachy kernel] " Jes Sorensen
  2015-03-16 19:56 ` [PATCH v2 2/2] Staging: rtl8192u: Rename struct to avoid CamelCase Cristina Opriceana
  1 sibling, 1 reply; 7+ messages in thread
From: Cristina Opriceana @ 2015-03-16 19:55 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch removes the dig_t and DRxPathSel type definitions in order to
avoid the following warning: "WARNING: Do not add new typedefs".
Done with coccinelle and this script:

@r@ type t; identifier id; @@
typedef struct id
{...}
t;

@script:python get_name@
t << r.t;
tdres;
@@
coccinelle.tdres = t.replace("_t", "");

@r_match@ type r.t; identifier r.id;
identifier get_name.tdres; @@
-typedef
struct
-id
+tdres
{...}
-t
;
@r_replace@ type r.t; identifier get_name.tdres; @@
-t
+struct tdres

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/rtl8192u/r8192U_dm.c |  5 +++--
 drivers/staging/rtl8192u/r8192U_dm.h | 12 ++++++------
 2 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 8669162..402abdf 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -36,11 +36,12 @@ static u32 edca_setting_UL[HT_IOT_PEER_MAX] = {
 
 /*------------------------Define global variable-----------------------------*/
 /* Debug variable ? */
-dig_t	dm_digtable;
+struct dig dm_digtable;
 /* Store current software write register content for MAC PHY. */
 u8		dm_shadow[16][256] = { {0} };
 /* For Dynamic Rx Path Selection by Signal Strength */
-DRxPathSel	DM_RxPathSelTable;
+struct DRxPathSel DM_RxPathSelTable;
+
 /*------------------------Define global variable-----------------------------*/
 
 
diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
index 3008f91..091fdd1 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.h
+++ b/drivers/staging/rtl8192u/r8192U_dm.h
@@ -67,7 +67,7 @@
 
 /*------------------------------Define structure----------------------------*/
 /* 2007/10/04 MH Define upper and lower threshold of DIG enable or disable. */
-typedef struct _dynamic_initial_gain_threshold_ {
+struct dig {
 	u8		dig_enable_flag;
 	u8		dig_algorithm;
 	u8		dbg_mode;
@@ -98,7 +98,7 @@ typedef struct _dynamic_initial_gain_threshold_ {
 	bool		initialgain_lowerbound_state;
 
 	long		rssi_val;
-} dig_t;
+};
 
 typedef enum tag_dynamic_init_gain_state_definition {
 	DM_STA_DIG_OFF = 0,
@@ -163,7 +163,7 @@ typedef enum tag_dig_cck_cs_ratio_state_definition {
 	DIG_CS_RATIO_HIGHER = 1,
 	DIG_CS_MAX
 } dm_dig_cs_ratio_e;
-typedef struct _Dynamic_Rx_Path_Selection_ {
+struct DRxPathSel {
 	u8		Enable;
 	u8		DbgMode;
 	u8		cck_method;
@@ -177,7 +177,7 @@ typedef struct _Dynamic_Rx_Path_Selection_ {
 	u8		rf_rssi[4];
 	u8		rf_enable_rssi_th[4];
 	long		cck_pwdb_sta[4];
-} DRxPathSel;
+};
 
 typedef enum tag_CCK_Rx_Path_Method_Definition {
 	CCK_Rx_Version_1 = 0,
@@ -200,9 +200,9 @@ typedef struct tag_Tx_Config_Cmd_Format {
 
 
 /*------------------------Export global variable----------------------------*/
-extern dig_t dm_digtable;
+extern struct dig dm_digtable;
 extern u8 dm_shadow[16][256];
-extern DRxPathSel DM_RxPathSelTable;
+extern struct DRxPathSel DM_RxPathSelTable;
 /*------------------------Export global variable----------------------------*/
 
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v2 2/2] Staging: rtl8192u: Rename struct to avoid CamelCase
  2015-03-16 19:52 [PATCH v2 0/2] Remove typedefs and rename struct Cristina Opriceana
  2015-03-16 19:55 ` [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs Cristina Opriceana
@ 2015-03-16 19:56 ` Cristina Opriceana
  2015-03-17 15:26   ` [Outreachy kernel] " Jes Sorensen
  1 sibling, 1 reply; 7+ messages in thread
From: Cristina Opriceana @ 2015-03-16 19:56 UTC (permalink / raw)
  To: outreachy-kernel; +Cc: outreachy-kernel

This patch renames struct DRxPathSel to dynamic_rx_path_sel in order to
keep the notations consistent and to remove the warning:
"CHECK: Avoid CamelCase". Done with coccinelle:
@@ @@
struct
-DRxPathSel
+dynamic_rx_path_sel
{...}

@@ @@
struct
-DRxPathSel
+dynamic_rx_path_sel

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
---
 drivers/staging/rtl8192u/r8192U_dm.c | 2 +-
 drivers/staging/rtl8192u/r8192U_dm.h | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
index 402abdf..12dd19e 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.c
+++ b/drivers/staging/rtl8192u/r8192U_dm.c
@@ -40,7 +40,7 @@ struct dig dm_digtable;
 /* Store current software write register content for MAC PHY. */
 u8		dm_shadow[16][256] = { {0} };
 /* For Dynamic Rx Path Selection by Signal Strength */
-struct DRxPathSel DM_RxPathSelTable;
+struct dynamic_rx_path_sel DM_RxPathSelTable;
 
 /*------------------------Define global variable-----------------------------*/
 
diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
index 091fdd1..6cd32eb4 100644
--- a/drivers/staging/rtl8192u/r8192U_dm.h
+++ b/drivers/staging/rtl8192u/r8192U_dm.h
@@ -163,7 +163,7 @@ typedef enum tag_dig_cck_cs_ratio_state_definition {
 	DIG_CS_RATIO_HIGHER = 1,
 	DIG_CS_MAX
 } dm_dig_cs_ratio_e;
-struct DRxPathSel {
+struct dynamic_rx_path_sel {
 	u8		Enable;
 	u8		DbgMode;
 	u8		cck_method;
@@ -202,7 +202,7 @@ typedef struct tag_Tx_Config_Cmd_Format {
 /*------------------------Export global variable----------------------------*/
 extern struct dig dm_digtable;
 extern u8 dm_shadow[16][256];
-extern struct DRxPathSel DM_RxPathSelTable;
+extern struct dynamic_rx_path_sel DM_RxPathSelTable;
 /*------------------------Export global variable----------------------------*/
 
 
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs
  2015-03-16 19:55 ` [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs Cristina Opriceana
@ 2015-03-17 15:23   ` Jes Sorensen
  2015-03-17 16:47     ` Julia Lawall
  0 siblings, 1 reply; 7+ messages in thread
From: Jes Sorensen @ 2015-03-17 15:23 UTC (permalink / raw)
  To: Cristina Opriceana, outreachy-kernel

On 03/16/15 15:55, Cristina Opriceana wrote:
> This patch removes the dig_t and DRxPathSel type definitions in order to
> avoid the following warning: "WARNING: Do not add new typedefs".
> Done with coccinelle and this script:
> 
> @r@ type t; identifier id; @@
> typedef struct id
> {...}
> t;
> 
> @script:python get_name@
> t << r.t;
> tdres;
> @@
> coccinelle.tdres = t.replace("_t", "");
> 
> @r_match@ type r.t; identifier r.id;
> identifier get_name.tdres; @@
> -typedef
> struct
> -id
> +tdres
> {...}
> -t
> ;
> @r_replace@ type r.t; identifier get_name.tdres; @@
> -t
> +struct tdres
> 
> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>

Removing pointless typedefs like these is clearly a win. However for
something like this, I don't think you need to include the coccinnelle
rules, simply stating that you are getting rid of unnecessary typedefs
is a win.

Cheers,
Jes


> ---
>  drivers/staging/rtl8192u/r8192U_dm.c |  5 +++--
>  drivers/staging/rtl8192u/r8192U_dm.h | 12 ++++++------
>  2 files changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
> index 8669162..402abdf 100644
> --- a/drivers/staging/rtl8192u/r8192U_dm.c
> +++ b/drivers/staging/rtl8192u/r8192U_dm.c
> @@ -36,11 +36,12 @@ static u32 edca_setting_UL[HT_IOT_PEER_MAX] = {
>  
>  /*------------------------Define global variable-----------------------------*/
>  /* Debug variable ? */
> -dig_t	dm_digtable;
> +struct dig dm_digtable;
>  /* Store current software write register content for MAC PHY. */
>  u8		dm_shadow[16][256] = { {0} };
>  /* For Dynamic Rx Path Selection by Signal Strength */
> -DRxPathSel	DM_RxPathSelTable;
> +struct DRxPathSel DM_RxPathSelTable;
> +
>  /*------------------------Define global variable-----------------------------*/
>  
>  
> diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
> index 3008f91..091fdd1 100644
> --- a/drivers/staging/rtl8192u/r8192U_dm.h
> +++ b/drivers/staging/rtl8192u/r8192U_dm.h
> @@ -67,7 +67,7 @@
>  
>  /*------------------------------Define structure----------------------------*/
>  /* 2007/10/04 MH Define upper and lower threshold of DIG enable or disable. */
> -typedef struct _dynamic_initial_gain_threshold_ {
> +struct dig {
>  	u8		dig_enable_flag;
>  	u8		dig_algorithm;
>  	u8		dbg_mode;
> @@ -98,7 +98,7 @@ typedef struct _dynamic_initial_gain_threshold_ {
>  	bool		initialgain_lowerbound_state;
>  
>  	long		rssi_val;
> -} dig_t;
> +};
>  
>  typedef enum tag_dynamic_init_gain_state_definition {
>  	DM_STA_DIG_OFF = 0,
> @@ -163,7 +163,7 @@ typedef enum tag_dig_cck_cs_ratio_state_definition {
>  	DIG_CS_RATIO_HIGHER = 1,
>  	DIG_CS_MAX
>  } dm_dig_cs_ratio_e;
> -typedef struct _Dynamic_Rx_Path_Selection_ {
> +struct DRxPathSel {
>  	u8		Enable;
>  	u8		DbgMode;
>  	u8		cck_method;
> @@ -177,7 +177,7 @@ typedef struct _Dynamic_Rx_Path_Selection_ {
>  	u8		rf_rssi[4];
>  	u8		rf_enable_rssi_th[4];
>  	long		cck_pwdb_sta[4];
> -} DRxPathSel;
> +};
>  
>  typedef enum tag_CCK_Rx_Path_Method_Definition {
>  	CCK_Rx_Version_1 = 0,
> @@ -200,9 +200,9 @@ typedef struct tag_Tx_Config_Cmd_Format {
>  
>  
>  /*------------------------Export global variable----------------------------*/
> -extern dig_t dm_digtable;
> +extern struct dig dm_digtable;
>  extern u8 dm_shadow[16][256];
> -extern DRxPathSel DM_RxPathSelTable;
> +extern struct DRxPathSel DM_RxPathSelTable;
>  /*------------------------Export global variable----------------------------*/
>  
>  
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 2/2] Staging: rtl8192u: Rename struct to avoid CamelCase
  2015-03-16 19:56 ` [PATCH v2 2/2] Staging: rtl8192u: Rename struct to avoid CamelCase Cristina Opriceana
@ 2015-03-17 15:26   ` Jes Sorensen
  0 siblings, 0 replies; 7+ messages in thread
From: Jes Sorensen @ 2015-03-17 15:26 UTC (permalink / raw)
  To: Cristina Opriceana, outreachy-kernel

On 03/16/15 15:56, Cristina Opriceana wrote:
> This patch renames struct DRxPathSel to dynamic_rx_path_sel in order to
> keep the notations consistent and to remove the warning:
> "CHECK: Avoid CamelCase". Done with coccinelle:
> @@ @@
> struct
> -DRxPathSel
> +dynamic_rx_path_sel
> {...}
> 
> @@ @@
> struct
> -DRxPathSel
> +dynamic_rx_path_sel
> 
> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
> ---
>  drivers/staging/rtl8192u/r8192U_dm.c | 2 +-
>  drivers/staging/rtl8192u/r8192U_dm.h | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)

This is also a win, and again I would prefer to have the commit message
simply state that you are getting rid of the StUdLyCaPs (I never
understood who introduced the phrase CamelCase, it's clearly called
studly caps - don't take too much note at this part :)

Referencing coccinelle is good when you are fixing a technical bug, but
when something is cosmetic, like here, I would leave it out and just
explain the change.

Cheers,
Jes

> diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
> index 402abdf..12dd19e 100644
> --- a/drivers/staging/rtl8192u/r8192U_dm.c
> +++ b/drivers/staging/rtl8192u/r8192U_dm.c
> @@ -40,7 +40,7 @@ struct dig dm_digtable;
>  /* Store current software write register content for MAC PHY. */
>  u8		dm_shadow[16][256] = { {0} };
>  /* For Dynamic Rx Path Selection by Signal Strength */
> -struct DRxPathSel DM_RxPathSelTable;
> +struct dynamic_rx_path_sel DM_RxPathSelTable;
>  
>  /*------------------------Define global variable-----------------------------*/
>  
> diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
> index 091fdd1..6cd32eb4 100644
> --- a/drivers/staging/rtl8192u/r8192U_dm.h
> +++ b/drivers/staging/rtl8192u/r8192U_dm.h
> @@ -163,7 +163,7 @@ typedef enum tag_dig_cck_cs_ratio_state_definition {
>  	DIG_CS_RATIO_HIGHER = 1,
>  	DIG_CS_MAX
>  } dm_dig_cs_ratio_e;
> -struct DRxPathSel {
> +struct dynamic_rx_path_sel {
>  	u8		Enable;
>  	u8		DbgMode;
>  	u8		cck_method;
> @@ -202,7 +202,7 @@ typedef struct tag_Tx_Config_Cmd_Format {
>  /*------------------------Export global variable----------------------------*/
>  extern struct dig dm_digtable;
>  extern u8 dm_shadow[16][256];
> -extern struct DRxPathSel DM_RxPathSelTable;
> +extern struct dynamic_rx_path_sel DM_RxPathSelTable;
>  /*------------------------Export global variable----------------------------*/
>  
>  
> 



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs
  2015-03-17 15:23   ` [Outreachy kernel] " Jes Sorensen
@ 2015-03-17 16:47     ` Julia Lawall
  2015-03-17 16:50       ` Jes Sorensen
  0 siblings, 1 reply; 7+ messages in thread
From: Julia Lawall @ 2015-03-17 16:47 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: Cristina Opriceana, outreachy-kernel



On Tue, 17 Mar 2015, Jes Sorensen wrote:

> On 03/16/15 15:55, Cristina Opriceana wrote:
> > This patch removes the dig_t and DRxPathSel type definitions in order to
> > avoid the following warning: "WARNING: Do not add new typedefs".
> > Done with coccinelle and this script:
> >
> > @r@ type t; identifier id; @@
> > typedef struct id
> > {...}
> > t;
> >
> > @script:python get_name@
> > t << r.t;
> > tdres;
> > @@
> > coccinelle.tdres = t.replace("_t", "");
> >
> > @r_match@ type r.t; identifier r.id;
> > identifier get_name.tdres; @@
> > -typedef
> > struct
> > -id
> > +tdres
> > {...}
> > -t
> > ;
> > @r_replace@ type r.t; identifier get_name.tdres; @@
> > -t
> > +struct tdres
> >
> > Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
>
> Removing pointless typedefs like these is clearly a win. However for
> something like this, I don't think you need to include the coccinnelle
> rules, simply stating that you are getting rid of unnecessary typedefs
> is a win.

Actually, I think the rule is nice, because we can see that she is taking
care of the _t before looking at each case.  I would tend to put a
complete rule like this in a cover letter though, but it depends on how
the patch series is organized.

julia


>
> Cheers,
> Jes
>
>
> > ---
> >  drivers/staging/rtl8192u/r8192U_dm.c |  5 +++--
> >  drivers/staging/rtl8192u/r8192U_dm.h | 12 ++++++------
> >  2 files changed, 9 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/staging/rtl8192u/r8192U_dm.c b/drivers/staging/rtl8192u/r8192U_dm.c
> > index 8669162..402abdf 100644
> > --- a/drivers/staging/rtl8192u/r8192U_dm.c
> > +++ b/drivers/staging/rtl8192u/r8192U_dm.c
> > @@ -36,11 +36,12 @@ static u32 edca_setting_UL[HT_IOT_PEER_MAX] = {
> >
> >  /*------------------------Define global variable-----------------------------*/
> >  /* Debug variable ? */
> > -dig_t	dm_digtable;
> > +struct dig dm_digtable;
> >  /* Store current software write register content for MAC PHY. */
> >  u8		dm_shadow[16][256] = { {0} };
> >  /* For Dynamic Rx Path Selection by Signal Strength */
> > -DRxPathSel	DM_RxPathSelTable;
> > +struct DRxPathSel DM_RxPathSelTable;
> > +
> >  /*------------------------Define global variable-----------------------------*/
> >
> >
> > diff --git a/drivers/staging/rtl8192u/r8192U_dm.h b/drivers/staging/rtl8192u/r8192U_dm.h
> > index 3008f91..091fdd1 100644
> > --- a/drivers/staging/rtl8192u/r8192U_dm.h
> > +++ b/drivers/staging/rtl8192u/r8192U_dm.h
> > @@ -67,7 +67,7 @@
> >
> >  /*------------------------------Define structure----------------------------*/
> >  /* 2007/10/04 MH Define upper and lower threshold of DIG enable or disable. */
> > -typedef struct _dynamic_initial_gain_threshold_ {
> > +struct dig {
> >  	u8		dig_enable_flag;
> >  	u8		dig_algorithm;
> >  	u8		dbg_mode;
> > @@ -98,7 +98,7 @@ typedef struct _dynamic_initial_gain_threshold_ {
> >  	bool		initialgain_lowerbound_state;
> >
> >  	long		rssi_val;
> > -} dig_t;
> > +};
> >
> >  typedef enum tag_dynamic_init_gain_state_definition {
> >  	DM_STA_DIG_OFF = 0,
> > @@ -163,7 +163,7 @@ typedef enum tag_dig_cck_cs_ratio_state_definition {
> >  	DIG_CS_RATIO_HIGHER = 1,
> >  	DIG_CS_MAX
> >  } dm_dig_cs_ratio_e;
> > -typedef struct _Dynamic_Rx_Path_Selection_ {
> > +struct DRxPathSel {
> >  	u8		Enable;
> >  	u8		DbgMode;
> >  	u8		cck_method;
> > @@ -177,7 +177,7 @@ typedef struct _Dynamic_Rx_Path_Selection_ {
> >  	u8		rf_rssi[4];
> >  	u8		rf_enable_rssi_th[4];
> >  	long		cck_pwdb_sta[4];
> > -} DRxPathSel;
> > +};
> >
> >  typedef enum tag_CCK_Rx_Path_Method_Definition {
> >  	CCK_Rx_Version_1 = 0,
> > @@ -200,9 +200,9 @@ typedef struct tag_Tx_Config_Cmd_Format {
> >
> >
> >  /*------------------------Export global variable----------------------------*/
> > -extern dig_t dm_digtable;
> > +extern struct dig dm_digtable;
> >  extern u8 dm_shadow[16][256];
> > -extern DRxPathSel DM_RxPathSelTable;
> > +extern struct DRxPathSel DM_RxPathSelTable;
> >  /*------------------------Export global variable----------------------------*/
> >
> >
> >
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/55084703.4010906%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Outreachy kernel] [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs
  2015-03-17 16:47     ` Julia Lawall
@ 2015-03-17 16:50       ` Jes Sorensen
  0 siblings, 0 replies; 7+ messages in thread
From: Jes Sorensen @ 2015-03-17 16:50 UTC (permalink / raw)
  To: Julia Lawall; +Cc: Cristina Opriceana, outreachy-kernel

On 03/17/15 12:47, Julia Lawall wrote:
> 
> 
> On Tue, 17 Mar 2015, Jes Sorensen wrote:
> 
>> On 03/16/15 15:55, Cristina Opriceana wrote:
>>> This patch removes the dig_t and DRxPathSel type definitions in order to
>>> avoid the following warning: "WARNING: Do not add new typedefs".
>>> Done with coccinelle and this script:
>>>
>>> @r@ type t; identifier id; @@
>>> typedef struct id
>>> {...}
>>> t;
>>>
>>> @script:python get_name@
>>> t << r.t;
>>> tdres;
>>> @@
>>> coccinelle.tdres = t.replace("_t", "");
>>>
>>> @r_match@ type r.t; identifier r.id;
>>> identifier get_name.tdres; @@
>>> -typedef
>>> struct
>>> -id
>>> +tdres
>>> {...}
>>> -t
>>> ;
>>> @r_replace@ type r.t; identifier get_name.tdres; @@
>>> -t
>>> +struct tdres
>>>
>>> Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
>>
>> Removing pointless typedefs like these is clearly a win. However for
>> something like this, I don't think you need to include the coccinnelle
>> rules, simply stating that you are getting rid of unnecessary typedefs
>> is a win.
> 
> Actually, I think the rule is nice, because we can see that she is taking
> care of the _t before looking at each case.  I would tend to put a
> complete rule like this in a cover letter though, but it depends on how
> the patch series is organized.

There is definitely a level of personal preference here. IMHO the rule
doesn't add value to the commit log, since it doesn't deal with an
actual bug. Having it in a cover-letter would be fine.

Cheers,
Jes



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-03-17 16:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16 19:52 [PATCH v2 0/2] Remove typedefs and rename struct Cristina Opriceana
2015-03-16 19:55 ` [PATCH v2 1/2] Staging: rtl8192u: Do not add new typedefs Cristina Opriceana
2015-03-17 15:23   ` [Outreachy kernel] " Jes Sorensen
2015-03-17 16:47     ` Julia Lawall
2015-03-17 16:50       ` Jes Sorensen
2015-03-16 19:56 ` [PATCH v2 2/2] Staging: rtl8192u: Rename struct to avoid CamelCase Cristina Opriceana
2015-03-17 15:26   ` [Outreachy kernel] " Jes Sorensen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.