All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum
@ 2018-03-23 18:33 Nishka Dasgupta
  2018-03-23 18:33 ` [PATCH v2 2/5] staging: vt6655: Change CARD_STATUS_TYPE " Nishka Dasgupta
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-23 18:33 UTC (permalink / raw)
  To: forest, gregkh, outreachy-kernel; +Cc: Nishka Dasgupta

Change CARD_PKT_TYPE from typedef enum to enum. Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
---
Changes in v2:
 - Clarify subject and commit message.

 drivers/staging/vt6655/card.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index 487039a..be5254a 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -39,12 +39,12 @@
 #define CB_MAX_CHANNEL_5G       42
 #define CB_MAX_CHANNEL          (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
 
-typedef enum _CARD_PKT_TYPE {
+enum CARD_PKT_TYPE {
 	PKT_TYPE_802_11_BCN,
 	PKT_TYPE_802_11_MNG,
 	PKT_TYPE_802_11_DATA,
 	PKT_TYPE_802_11_ALL
-} CARD_PKT_TYPE, *PCARD_PKT_TYPE;
+};
 
 typedef enum _CARD_STATUS_TYPE {
 	CARD_STATUS_MEDIA_CONNECT,
-- 
2.7.4



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

* [PATCH v2 2/5] staging: vt6655: Change CARD_STATUS_TYPE from typedef to enum
  2018-03-23 18:33 [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Nishka Dasgupta
@ 2018-03-23 18:33 ` Nishka Dasgupta
  2018-03-23 18:33 ` [PATCH v2 3/5] staging: vt6655: Change _version from typedef struct to struct Nishka Dasgupta
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-23 18:33 UTC (permalink / raw)
  To: forest, gregkh, outreachy-kernel; +Cc: Nishka Dasgupta

Replace typedef enum _CARD_STATUS_TYPE with enum CARD_STATUS_TYPE. 
Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
---
Changes in v2:
 - Make subject and commit message clearer.

 drivers/staging/vt6655/card.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
index be5254a..f599624 100644
--- a/drivers/staging/vt6655/card.h
+++ b/drivers/staging/vt6655/card.h
@@ -46,11 +46,11 @@ enum CARD_PKT_TYPE {
 	PKT_TYPE_802_11_ALL
 };
 
-typedef enum _CARD_STATUS_TYPE {
+enum CARD_STATUS_TYPE {
 	CARD_STATUS_MEDIA_CONNECT,
 	CARD_STATUS_MEDIA_DISCONNECT,
 	CARD_STATUS_PMKID
-} CARD_STATUS_TYPE, *PCARD_STATUS_TYPE;
+};
 
 struct vnt_private;
 
-- 
2.7.4



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

* [PATCH v2 3/5] staging: vt6655: Change _version from typedef struct to struct
  2018-03-23 18:33 [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Nishka Dasgupta
  2018-03-23 18:33 ` [PATCH v2 2/5] staging: vt6655: Change CARD_STATUS_TYPE " Nishka Dasgupta
@ 2018-03-23 18:33 ` Nishka Dasgupta
  2018-03-23 18:33 ` [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum Nishka Dasgupta
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-23 18:33 UTC (permalink / raw)
  To: forest, gregkh, outreachy-kernel; +Cc: Nishka Dasgupta

Change _version from typedef struct to struct. 
Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
---
Changes in v2:
 - Make subject and commit message clear.

 drivers/staging/vt6655/device_cfg.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h
index 73f904b..3972881 100644
--- a/drivers/staging/vt6655/device_cfg.h
+++ b/drivers/staging/vt6655/device_cfg.h
@@ -16,12 +16,11 @@
 
 #include <linux/types.h>
 
-typedef
-struct _version {
+struct version {
 	unsigned char   major;
 	unsigned char   minor;
 	unsigned char   build;
-} version_t, *pversion_t;
+};
 
 #define VID_TABLE_SIZE      64
 #define MCAST_TABLE_SIZE    64
-- 
2.7.4



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

* [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum
  2018-03-23 18:33 [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Nishka Dasgupta
  2018-03-23 18:33 ` [PATCH v2 2/5] staging: vt6655: Change CARD_STATUS_TYPE " Nishka Dasgupta
  2018-03-23 18:33 ` [PATCH v2 3/5] staging: vt6655: Change _version from typedef struct to struct Nishka Dasgupta
@ 2018-03-23 18:33 ` Nishka Dasgupta
  2018-03-23 18:38   ` [Outreachy kernel] " Julia Lawall
  2018-03-23 18:34 ` [PATCH v2 5/5] staging: vt6655: Remove else after return Nishka Dasgupta
  2018-03-23 18:36 ` [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Julia Lawall
  4 siblings, 1 reply; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-23 18:33 UTC (permalink / raw)
  To: forest, gregkh, outreachy-kernel; +Cc: Nishka Dasgupta

Change _chip_type from typedef enum to enum. 
Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
---
Changes in v2:
 - Make subject and commit message clear.

 drivers/staging/vt6655/device_cfg.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h
index 3972881..2f38634 100644
--- a/drivers/staging/vt6655/device_cfg.h
+++ b/drivers/staging/vt6655/device_cfg.h
@@ -51,8 +51,8 @@ struct version {
 
 #define PKT_BUF_SZ          2390
 
-typedef enum  _chip_type {
+enum CHIP_TYPE {
 	VT3253 = 1
-} CHIP_TYPE, *PCHIP_TYPE;
+};
 
 #endif
-- 
2.7.4



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

* [PATCH v2 5/5] staging: vt6655: Remove else after return
  2018-03-23 18:33 [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Nishka Dasgupta
                   ` (2 preceding siblings ...)
  2018-03-23 18:33 ` [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum Nishka Dasgupta
@ 2018-03-23 18:34 ` Nishka Dasgupta
  2018-03-23 18:36 ` [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Julia Lawall
  4 siblings, 0 replies; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-23 18:34 UTC (permalink / raw)
  To: forest, gregkh, outreachy-kernel; +Cc: Nishka Dasgupta

Remove else after return. Issue found with checkpatch.

Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
---
Changes in v2:
 - No changes.

 drivers/staging/vt6655/rxtx.c | 37 ++++++++++++++++++-------------------
 1 file changed, 18 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
index 9c4a532..89adee4 100644
--- a/drivers/staging/vt6655/rxtx.c
+++ b/drivers/staging/vt6655/rxtx.c
@@ -568,28 +568,27 @@ s_uFillDataHead(
 										wCurrentRate, bNeedAck, uFragIdx, cbLastFragmentSize, uMACfragNum, byFBOption));
 			buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
 			return buf->duration;
-		} else {
-			struct vnt_tx_datahead_ab *buf = pTxDataHead;
-			/* Get SignalField, ServiceField & Length */
-			vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
-					  byPktType, &buf->ab);
-
-			if (is_pspoll) {
-				__le16 dur = cpu_to_le16(pDevice->current_aid | BIT(14) | BIT(15));
+		}
+		struct vnt_tx_datahead_ab *buf = pTxDataHead;
+		/* Get SignalField, ServiceField & Length */
+		vnt_get_phy_field(pDevice, cbFrameLength, wCurrentRate,
+				  byPktType, &buf->ab);
 
-				buf->duration = dur;
-			} else {
-				/* Get Duration and TimeStampOff */
-				buf->duration =
-					cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType,
-									    wCurrentRate, bNeedAck, uFragIdx,
-									    cbLastFragmentSize, uMACfragNum,
-									    byFBOption));
-			}
+		if (is_pspoll) {
+			__le16 dur = cpu_to_le16(pDevice->current_aid | BIT(14) | BIT(15));
 
-			buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
-			return buf->duration;
+			buf->duration = dur;
+		} else {
+			/* Get Duration and TimeStampOff */
+			buf->duration =
+				cpu_to_le16((u16)s_uGetDataDuration(pDevice, DATADUR_A, cbFrameLength, byPktType,
+								    wCurrentRate, bNeedAck, uFragIdx,
+								    cbLastFragmentSize, uMACfragNum,
+								    byFBOption));
 		}
+
+		buf->time_stamp_off = vnt_time_stamp_off(pDevice, wCurrentRate);
+		return buf->duration;
 	} else {
 		struct vnt_tx_datahead_ab *buf = pTxDataHead;
 		/* Get SignalField, ServiceField & Length */
-- 
2.7.4



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

* Re: [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum
  2018-03-23 18:33 [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Nishka Dasgupta
                   ` (3 preceding siblings ...)
  2018-03-23 18:34 ` [PATCH v2 5/5] staging: vt6655: Remove else after return Nishka Dasgupta
@ 2018-03-23 18:36 ` Julia Lawall
  2018-03-23 20:33   ` Nishka Dasgupta
  4 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2018-03-23 18:36 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: forest, gregkh, outreachy-kernel



On Fri, 23 Mar 2018, Nishka Dasgupta wrote:

> Change CARD_PKT_TYPE from typedef enum to enum. Issue found with checkpatch.
>
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
> ---
> Changes in v2:
>  - Clarify subject and commit message.
>
>  drivers/staging/vt6655/card.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
> index 487039a..be5254a 100644
> --- a/drivers/staging/vt6655/card.h
> +++ b/drivers/staging/vt6655/card.h
> @@ -39,12 +39,12 @@
>  #define CB_MAX_CHANNEL_5G       42
>  #define CB_MAX_CHANNEL          (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
>
> -typedef enum _CARD_PKT_TYPE {
> +enum CARD_PKT_TYPE {
>  	PKT_TYPE_802_11_BCN,
>  	PKT_TYPE_802_11_MNG,
>  	PKT_TYPE_802_11_DATA,
>  	PKT_TYPE_802_11_ALL
> -} CARD_PKT_TYPE, *PCARD_PKT_TYPE;
> +};

Were the typedefs never use?  If they were used, then this should result
in a kernel that doesn't compile.

julia

>
>  typedef enum _CARD_STATUS_TYPE {
>  	CARD_STATUS_MEDIA_CONNECT,
> --
> 2.7.4
>
> --
> 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/1521830040-7138-1-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum
  2018-03-23 18:33 ` [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum Nishka Dasgupta
@ 2018-03-23 18:38   ` Julia Lawall
  2018-03-24  7:16     ` Nishka Dasgupta
  0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2018-03-23 18:38 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: forest, gregkh, outreachy-kernel



On Fri, 23 Mar 2018, Nishka Dasgupta wrote:

> Change _chip_type from typedef enum to enum.
> Issue found with checkpatch.
>
> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
> ---
> Changes in v2:
>  - Make subject and commit message clear.
>
>  drivers/staging/vt6655/device_cfg.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h
> index 3972881..2f38634 100644
> --- a/drivers/staging/vt6655/device_cfg.h
> +++ b/drivers/staging/vt6655/device_cfg.h
> @@ -51,8 +51,8 @@ struct version {
>
>  #define PKT_BUF_SZ          2390
>
> -typedef enum  _chip_type {
> +enum CHIP_TYPE {
>  	VT3253 = 1
> -} CHIP_TYPE, *PCHIP_TYPE;
> +};

I don't think that a type name in all capital letters is such a good idea.
But maybe this type is never used?  If it is not used, it should be
removed.

julia

>
>  #endif
> --
> 2.7.4
>
> --
> 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/1521830040-7138-4-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
> For more options, visit https://groups.google.com/d/optout.
>


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

* Re: [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum
  2018-03-23 18:36 ` [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Julia Lawall
@ 2018-03-23 20:33   ` Nishka Dasgupta
  2018-03-23 22:31     ` Julia Lawall
  0 siblings, 1 reply; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-23 20:33 UTC (permalink / raw)
  To: Julia Lawall; +Cc: forest, Greg KH, outreachy-kernel

On Sat, Mar 24, 2018 at 12:06 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Fri, 23 Mar 2018, Nishka Dasgupta wrote:
>
>> Change CARD_PKT_TYPE from typedef enum to enum. Issue found with checkpatch.
>>
>> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
>> ---
>> Changes in v2:
>>  - Clarify subject and commit message.
>>
>>  drivers/staging/vt6655/card.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
>> index 487039a..be5254a 100644
>> --- a/drivers/staging/vt6655/card.h
>> +++ b/drivers/staging/vt6655/card.h
>> @@ -39,12 +39,12 @@
>>  #define CB_MAX_CHANNEL_5G       42
>>  #define CB_MAX_CHANNEL          (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
>>
>> -typedef enum _CARD_PKT_TYPE {
>> +enum CARD_PKT_TYPE {
>>       PKT_TYPE_802_11_BCN,
>>       PKT_TYPE_802_11_MNG,
>>       PKT_TYPE_802_11_DATA,
>>       PKT_TYPE_802_11_ALL
>> -} CARD_PKT_TYPE, *PCARD_PKT_TYPE;
>> +};
>
> Were the typedefs never use?  If they were used, then this should result
> in a kernel that doesn't compile.

This particular driver is compiling at my end; if I remember
correctly, all of drivers/staging/ also compiled with the changes in
this patchset.
Just to be sure, I also searched within this driver for this (and
other) typedefs being used after the definition, and I couldn't find
any occurrences, which confused me a little. Am I doing something
wrong?

> julia
>
>>
>>  typedef enum _CARD_STATUS_TYPE {
>>       CARD_STATUS_MEDIA_CONNECT,
>> --
>> 2.7.4
>>
>> --
>> 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/1521830040-7138-1-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
>> For more options, visit https://groups.google.com/d/optout.
>>

Thanking you,
Nishka Dasgupta


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

* Re: [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum
  2018-03-23 20:33   ` Nishka Dasgupta
@ 2018-03-23 22:31     ` Julia Lawall
  2018-03-24  7:14       ` Nishka Dasgupta
  0 siblings, 1 reply; 13+ messages in thread
From: Julia Lawall @ 2018-03-23 22:31 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: forest, Greg KH, outreachy-kernel



On Sat, 24 Mar 2018, Nishka Dasgupta wrote:

> On Sat, Mar 24, 2018 at 12:06 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> > On Fri, 23 Mar 2018, Nishka Dasgupta wrote:
> >
> >> Change CARD_PKT_TYPE from typedef enum to enum. Issue found with checkpatch.
> >>
> >> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
> >> ---
> >> Changes in v2:
> >>  - Clarify subject and commit message.
> >>
> >>  drivers/staging/vt6655/card.h | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
> >> index 487039a..be5254a 100644
> >> --- a/drivers/staging/vt6655/card.h
> >> +++ b/drivers/staging/vt6655/card.h
> >> @@ -39,12 +39,12 @@
> >>  #define CB_MAX_CHANNEL_5G       42
> >>  #define CB_MAX_CHANNEL          (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
> >>
> >> -typedef enum _CARD_PKT_TYPE {
> >> +enum CARD_PKT_TYPE {
> >>       PKT_TYPE_802_11_BCN,
> >>       PKT_TYPE_802_11_MNG,
> >>       PKT_TYPE_802_11_DATA,
> >>       PKT_TYPE_802_11_ALL
> >> -} CARD_PKT_TYPE, *PCARD_PKT_TYPE;
> >> +};
> >
> > Were the typedefs never use?  If they were used, then this should result
> > in a kernel that doesn't compile.
>
> This particular driver is compiling at my end; if I remember
> correctly, all of drivers/staging/ also compiled with the changes in
> this patchset.
> Just to be sure, I also searched within this driver for this (and
> other) typedefs being used after the definition, and I couldn't find
> any occurrences, which confused me a little. Am I doing something
> wrong?

For an enum, it could be useful even if the type name is never used,
because the enum serves to define some constants, eg PKT_TYPE_802_11_BCN.
But even the constants don't seem to be used in this case.  So it seems
that the whole thing could just be dropped.

julia


>
> > julia
> >
> >>
> >>  typedef enum _CARD_STATUS_TYPE {
> >>       CARD_STATUS_MEDIA_CONNECT,
> >> --
> >> 2.7.4
> >>
> >> --
> >> 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/1521830040-7138-1-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
> Thanking you,
> Nishka Dasgupta
>


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

* Re: [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum
  2018-03-23 22:31     ` Julia Lawall
@ 2018-03-24  7:14       ` Nishka Dasgupta
  2018-03-24 10:00         ` Julia Lawall
  0 siblings, 1 reply; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-24  7:14 UTC (permalink / raw)
  To: Julia Lawall; +Cc: forest, Greg KH, outreachy-kernel

On Sat, Mar 24, 2018 at 4:01 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>
> On Sat, 24 Mar 2018, Nishka Dasgupta wrote:
>
> > On Sat, Mar 24, 2018 at 12:06 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > >
> > >
> > > On Fri, 23 Mar 2018, Nishka Dasgupta wrote:
> > >
> > >> Change CARD_PKT_TYPE from typedef enum to enum. Issue found with checkpatch.
> > >>
> > >> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
> > >> ---
> > >> Changes in v2:
> > >>  - Clarify subject and commit message.
> > >>
> > >>  drivers/staging/vt6655/card.h | 4 ++--
> > >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > >>
> > >> diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
> > >> index 487039a..be5254a 100644
> > >> --- a/drivers/staging/vt6655/card.h
> > >> +++ b/drivers/staging/vt6655/card.h
> > >> @@ -39,12 +39,12 @@
> > >>  #define CB_MAX_CHANNEL_5G       42
> > >>  #define CB_MAX_CHANNEL          (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
> > >>
> > >> -typedef enum _CARD_PKT_TYPE {
> > >> +enum CARD_PKT_TYPE {
> > >>       PKT_TYPE_802_11_BCN,
> > >>       PKT_TYPE_802_11_MNG,
> > >>       PKT_TYPE_802_11_DATA,
> > >>       PKT_TYPE_802_11_ALL
> > >> -} CARD_PKT_TYPE, *PCARD_PKT_TYPE;
> > >> +};
> > >
> > > Were the typedefs never use?  If they were used, then this should result
> > > in a kernel that doesn't compile.
> >
> > This particular driver is compiling at my end; if I remember
> > correctly, all of drivers/staging/ also compiled with the changes in
> > this patchset.
> > Just to be sure, I also searched within this driver for this (and
> > other) typedefs being used after the definition, and I couldn't find
> > any occurrences, which confused me a little. Am I doing something
> > wrong?
>
> For an enum, it could be useful even if the type name is never used,
> because the enum serves to define some constants, eg PKT_TYPE_802_11_BCN.
> But even the constants don't seem to be used in this case.  So it seems
> that the whole thing could just be dropped.

No, I couldn't find the constants being used either. Should I delete
all of these in that case?

> julia
>
>
> >
> > > julia
> > >
> > >>
> > >>  typedef enum _CARD_STATUS_TYPE {
> > >>       CARD_STATUS_MEDIA_CONNECT,
> > >> --
> > >> 2.7.4
> > >>
> > >> --
> > >> 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/1521830040-7138-1-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
> > >> For more options, visit https://groups.google.com/d/optout.
> > >>
> >
> > Thanking you,
> > Nishka Dasgupta
> >

Thanking you,
Nishka Dasgupta


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

* Re: [Outreachy kernel] [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum
  2018-03-23 18:38   ` [Outreachy kernel] " Julia Lawall
@ 2018-03-24  7:16     ` Nishka Dasgupta
  2018-03-24 10:02       ` Julia Lawall
  0 siblings, 1 reply; 13+ messages in thread
From: Nishka Dasgupta @ 2018-03-24  7:16 UTC (permalink / raw)
  To: Julia Lawall; +Cc: forest, Greg KH, outreachy-kernel

On Sat, Mar 24, 2018 at 12:08 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
> On Fri, 23 Mar 2018, Nishka Dasgupta wrote:
>
>> Change _chip_type from typedef enum to enum.
>> Issue found with checkpatch.
>>
>> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
>> ---
>> Changes in v2:
>>  - Make subject and commit message clear.
>>
>>  drivers/staging/vt6655/device_cfg.h | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h
>> index 3972881..2f38634 100644
>> --- a/drivers/staging/vt6655/device_cfg.h
>> +++ b/drivers/staging/vt6655/device_cfg.h
>> @@ -51,8 +51,8 @@ struct version {
>>
>>  #define PKT_BUF_SZ          2390
>>
>> -typedef enum  _chip_type {
>> +enum CHIP_TYPE {
>>       VT3253 = 1
>> -} CHIP_TYPE, *PCHIP_TYPE;
>> +};
>
> I don't think that a type name in all capital letters is such a good idea.
> But maybe this type is never used?  If it is not used, it should be
> removed.

All the other typedefs I found in this driver had names in all upper
case; I modified this one for the sake of parity (and also because I
could not find any usage of it).

> julia
>
>>
>>  #endif
>> --
>> 2.7.4
>>
>> --
>> 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/1521830040-7138-4-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
>> For more options, visit https://groups.google.com/d/optout.
>>

Thanking you,
Nishka Dasgupta


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

* Re: [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum
  2018-03-24  7:14       ` Nishka Dasgupta
@ 2018-03-24 10:00         ` Julia Lawall
  0 siblings, 0 replies; 13+ messages in thread
From: Julia Lawall @ 2018-03-24 10:00 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: forest, Greg KH, outreachy-kernel



On Sat, 24 Mar 2018, Nishka Dasgupta wrote:

> On Sat, Mar 24, 2018 at 4:01 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> >
> > On Sat, 24 Mar 2018, Nishka Dasgupta wrote:
> >
> > > On Sat, Mar 24, 2018 at 12:06 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> > > >
> > > >
> > > > On Fri, 23 Mar 2018, Nishka Dasgupta wrote:
> > > >
> > > >> Change CARD_PKT_TYPE from typedef enum to enum. Issue found with checkpatch.
> > > >>
> > > >> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
> > > >> ---
> > > >> Changes in v2:
> > > >>  - Clarify subject and commit message.
> > > >>
> > > >>  drivers/staging/vt6655/card.h | 4 ++--
> > > >>  1 file changed, 2 insertions(+), 2 deletions(-)
> > > >>
> > > >> diff --git a/drivers/staging/vt6655/card.h b/drivers/staging/vt6655/card.h
> > > >> index 487039a..be5254a 100644
> > > >> --- a/drivers/staging/vt6655/card.h
> > > >> +++ b/drivers/staging/vt6655/card.h
> > > >> @@ -39,12 +39,12 @@
> > > >>  #define CB_MAX_CHANNEL_5G       42
> > > >>  #define CB_MAX_CHANNEL          (CB_MAX_CHANNEL_24G + CB_MAX_CHANNEL_5G)
> > > >>
> > > >> -typedef enum _CARD_PKT_TYPE {
> > > >> +enum CARD_PKT_TYPE {
> > > >>       PKT_TYPE_802_11_BCN,
> > > >>       PKT_TYPE_802_11_MNG,
> > > >>       PKT_TYPE_802_11_DATA,
> > > >>       PKT_TYPE_802_11_ALL
> > > >> -} CARD_PKT_TYPE, *PCARD_PKT_TYPE;
> > > >> +};
> > > >
> > > > Were the typedefs never use?  If they were used, then this should result
> > > > in a kernel that doesn't compile.
> > >
> > > This particular driver is compiling at my end; if I remember
> > > correctly, all of drivers/staging/ also compiled with the changes in
> > > this patchset.
> > > Just to be sure, I also searched within this driver for this (and
> > > other) typedefs being used after the definition, and I couldn't find
> > > any occurrences, which confused me a little. Am I doing something
> > > wrong?
> >
> > For an enum, it could be useful even if the type name is never used,
> > because the enum serves to define some constants, eg PKT_TYPE_802_11_BCN.
> > But even the constants don't seem to be used in this case.  So it seems
> > that the whole thing could just be dropped.
>
> No, I couldn't find the constants being used either. Should I delete
> all of these in that case?

Yes.

julia

>
> > julia
> >
> >
> > >
> > > > julia
> > > >
> > > >>
> > > >>  typedef enum _CARD_STATUS_TYPE {
> > > >>       CARD_STATUS_MEDIA_CONNECT,
> > > >> --
> > > >> 2.7.4
> > > >>
> > > >> --
> > > >> 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/1521830040-7138-1-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
> > > >> For more options, visit https://groups.google.com/d/optout.
> > > >>
> > >
> > > Thanking you,
> > > Nishka Dasgupta
> > >
>
> Thanking you,
> Nishka Dasgupta
>


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

* Re: [Outreachy kernel] [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum
  2018-03-24  7:16     ` Nishka Dasgupta
@ 2018-03-24 10:02       ` Julia Lawall
  0 siblings, 0 replies; 13+ messages in thread
From: Julia Lawall @ 2018-03-24 10:02 UTC (permalink / raw)
  To: Nishka Dasgupta; +Cc: forest, Greg KH, outreachy-kernel



On Sat, 24 Mar 2018, Nishka Dasgupta wrote:

> On Sat, Mar 24, 2018 at 12:08 AM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> > On Fri, 23 Mar 2018, Nishka Dasgupta wrote:
> >
> >> Change _chip_type from typedef enum to enum.
> >> Issue found with checkpatch.
> >>
> >> Signed-off-by: Nishka Dasgupta <nishka.dasgupta_ug18@ashoka.edu.in>
> >> ---
> >> Changes in v2:
> >>  - Make subject and commit message clear.
> >>
> >>  drivers/staging/vt6655/device_cfg.h | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/staging/vt6655/device_cfg.h b/drivers/staging/vt6655/device_cfg.h
> >> index 3972881..2f38634 100644
> >> --- a/drivers/staging/vt6655/device_cfg.h
> >> +++ b/drivers/staging/vt6655/device_cfg.h
> >> @@ -51,8 +51,8 @@ struct version {
> >>
> >>  #define PKT_BUF_SZ          2390
> >>
> >> -typedef enum  _chip_type {
> >> +enum CHIP_TYPE {
> >>       VT3253 = 1
> >> -} CHIP_TYPE, *PCHIP_TYPE;
> >> +};
> >
> > I don't think that a type name in all capital letters is such a good idea.
> > But maybe this type is never used?  If it is not used, it should be
> > removed.
>
> All the other typedefs I found in this driver had names in all upper
> case; I modified this one for the sake of parity (and also because I
> could not find any usage of it).

In the kernel, normally only macros are in upper case.

But since this is not used, you can just drop it.

julia

>
> > julia
> >
> >>
> >>  #endif
> >> --
> >> 2.7.4
> >>
> >> --
> >> 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/1521830040-7138-4-git-send-email-nishka.dasgupta_ug18%40ashoka.edu.in.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
> Thanking you,
> Nishka Dasgupta
>


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

end of thread, other threads:[~2018-03-24 10:02 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 18:33 [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Nishka Dasgupta
2018-03-23 18:33 ` [PATCH v2 2/5] staging: vt6655: Change CARD_STATUS_TYPE " Nishka Dasgupta
2018-03-23 18:33 ` [PATCH v2 3/5] staging: vt6655: Change _version from typedef struct to struct Nishka Dasgupta
2018-03-23 18:33 ` [PATCH v2 4/5] staging: vt6655: Change _chip_type from typedef enum to enum Nishka Dasgupta
2018-03-23 18:38   ` [Outreachy kernel] " Julia Lawall
2018-03-24  7:16     ` Nishka Dasgupta
2018-03-24 10:02       ` Julia Lawall
2018-03-23 18:34 ` [PATCH v2 5/5] staging: vt6655: Remove else after return Nishka Dasgupta
2018-03-23 18:36 ` [Outreachy kernel] [PATCH v2 1/5] staging: vt6655: Change CARD_PKT_TYPE from typedef to enum Julia Lawall
2018-03-23 20:33   ` Nishka Dasgupta
2018-03-23 22:31     ` Julia Lawall
2018-03-24  7:14       ` Nishka Dasgupta
2018-03-24 10:00         ` Julia Lawall

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.