2018-01-11 15:08:54

by Ajay Singh

[permalink] [raw]
Subject: [PATCH v3 0/6] fixes to remove enum typedefs

Changes since v2: Removed v2 patch number 3,4,5 , where were handling
different changes under same subject line.
As those changes were independent, will work on those items and
send as separate patch later.


Ajay Singh (6):
staging: wilc1000: removed typedef from enum BSSTYPE_T
staging: wilc1000: remove unnecessary typedef enum G_OPERATING_MODE_T
staging: wilc1000: removed enums typedef for BEACON_IE & TX_RATE_T
staging: wilc1000: removed enum typedef CHIP_PS_STATE_T
staging: wilc1000: removed enum typedef BUS_ACQUIRE_T
staging: wilc1000: removed enum typedef BUS_RELEASE_T

drivers/staging/wilc1000/host_interface.c | 2 +-
drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
drivers/staging/wilc1000/wilc_wlan_if.h | 28 ++++++++++++++--------------
3 files changed, 18 insertions(+), 18 deletions(-)

--
2.7.4


2018-01-11 15:09:13

by Ajay Singh

[permalink] [raw]
Subject: [PATCH v3 6/6] staging: wilc1000: removed enum typedef BUS_RELEASE_T

This patch removes enum typedef BUS_RELEASE_T and define
"enum bus_release" to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 80a5a0b..a2b26ec 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -13,7 +13,7 @@ static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire)
chip_wakeup(wilc);
}

-static inline void release_bus(struct wilc *wilc, BUS_RELEASE_T release)
+static inline void release_bus(struct wilc *wilc, enum bus_release release)
{
if (release == RELEASE_ALLOW_SLEEP)
chip_allow_sleep(wilc);
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index 2bc500d..1641ddb 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -148,10 +148,10 @@ enum bus_acquire {
ACQUIRE_AND_WAKEUP = 1,
};

-typedef enum {
+enum bus_release {
RELEASE_ONLY = 0,
RELEASE_ALLOW_SLEEP = 1,
-} BUS_RELEASE_T;
+};

typedef enum {
NO_SECURITY = 0,
--
2.7.4

2018-01-11 15:08:57

by Ajay Singh

[permalink] [raw]
Subject: [PATCH v3 1/6] staging: wilc1000: removed typedef from enum BSSTYPE_T

This patch removes typedef from enum BSSTYPE_T and
rename it to bss_types.

It fixes "WARNING: do not add new typdefs" warning
reported by checkpatch.pl.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/host_interface.c | 2 +-
drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index d69248a..4ff1a59 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -202,7 +202,7 @@ struct host_if_msg {
};

struct join_bss_param {
- BSSTYPE_T bss_type;
+ enum bss_types bss_type;
u8 dtim_period;
u16 beacon_period;
u16 cap_info;
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index c1693cf..2baf6c4 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -85,11 +85,11 @@ typedef enum {
P2P_IE = 221,
} BEACON_IE;

-typedef enum {
+enum bss_types {
INFRASTRUCTURE = 0,
INDEPENDENT,
AP,
-} BSSTYPE_T;
+};

typedef enum {
RATE_AUTO = 0,
--
2.7.4

2018-01-11 15:09:07

by Ajay Singh

[permalink] [raw]
Subject: [PATCH v3 4/6] staging: wilc1000: removed enum typedef CHIP_PS_STATE_T

This patch removes enum typedef CHIP_PS_STATE_T and introduce
enum chip_ps_states to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index f49dfa8..3a58a62 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -4,7 +4,7 @@
#include "wilc_wfi_netdevice.h"
#include "wilc_wlan_cfg.h"

-static CHIP_PS_STATE_T chip_ps_state = CHIP_WAKEDUP;
+static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;

static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
{
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index db2dab4..ab12090 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -137,11 +137,11 @@ typedef enum {
MAX_PSPOLL_PS = 4
} USER_PS_MODE_T;

-typedef enum {
+enum chip_ps_states {
CHIP_WAKEDUP = 0,
CHIP_SLEEPING_AUTO = 1,
CHIP_SLEEPING_MANUAL = 2
-} CHIP_PS_STATE_T;
+};

typedef enum {
ACQUIRE_ONLY = 0,
--
2.7.4

2018-01-11 17:04:46

by Claudiu Beznea

[permalink] [raw]
Subject: Re: [PATCH v3 0/6] fixes to remove enum typedefs

Hi Ajay,

Just a little note for your future patches: all changes history would
be good to be kept here, something like this:

changes in v3: this, this and this

changes in v2: this and this

Thanks,
Claudiu

On 11.01.2018 16:12, Ajay Singh wrote:
> Changes since v2: Removed v2 patch number 3,4,5 , where were handling
> different changes under same subject line.
> As those changes were independent, will work on those items and
> send as separate patch later.
>
>
> Ajay Singh (6):
> staging: wilc1000: removed typedef from enum BSSTYPE_T
> staging: wilc1000: remove unnecessary typedef enum G_OPERATING_MODE_T
> staging: wilc1000: removed enums typedef for BEACON_IE & TX_RATE_T
> staging: wilc1000: removed enum typedef CHIP_PS_STATE_T
> staging: wilc1000: removed enum typedef BUS_ACQUIRE_T
> staging: wilc1000: removed enum typedef BUS_RELEASE_T
>
> drivers/staging/wilc1000/host_interface.c | 2 +-
> drivers/staging/wilc1000/wilc_wlan.c | 6 +++---
> drivers/staging/wilc1000/wilc_wlan_if.h | 28 ++++++++++++++--------------
> 3 files changed, 18 insertions(+), 18 deletions(-)
>

2018-01-11 15:09:10

by Ajay Singh

[permalink] [raw]
Subject: [PATCH v3 5/6] staging: wilc1000: removed enum typedef BUS_ACQUIRE_T

This patch removes enum typedef BUS_ACQUIRE_T and define
enum bus_acquire to use instead of typedef.

checkpatch.pl not to add new typedef warning is fixed with this patch.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan.c | 2 +-
drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 3a58a62..80a5a0b 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -6,7 +6,7 @@

static enum chip_ps_states chip_ps_state = CHIP_WAKEDUP;

-static inline void acquire_bus(struct wilc *wilc, BUS_ACQUIRE_T acquire)
+static inline void acquire_bus(struct wilc *wilc, enum bus_acquire acquire)
{
mutex_lock(&wilc->hif_cs);
if (acquire == ACQUIRE_AND_WAKEUP)
diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index ab12090..2bc500d 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -143,10 +143,10 @@ enum chip_ps_states {
CHIP_SLEEPING_MANUAL = 2
};

-typedef enum {
+enum bus_acquire {
ACQUIRE_ONLY = 0,
ACQUIRE_AND_WAKEUP = 1,
-} BUS_ACQUIRE_T;
+};

typedef enum {
RELEASE_ONLY = 0,
--
2.7.4

2018-01-11 15:09:03

by Ajay Singh

[permalink] [raw]
Subject: [PATCH v3 3/6] staging: wilc1000: removed enums typedef for BEACON_IE & TX_RATE_T

This patch removed the unnecessary enum typedef for BEACON_IE &
TX_RATE_T
It fix "WARNING: do not add new typedefs" reported by checkpatch.pl

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan_if.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index 222bde2..db2dab4 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -75,7 +75,7 @@ typedef void (*wilc_tx_complete_func_t)(void *, int);
#define MAX_SSID_LEN 33
#define MAX_RATES_SUPPORTED 12

-typedef enum {
+enum {
SUPP_RATES_IE = 1,
EXT_SUPP_RATES_IE = 50,
HT_CAPABILITY_IE = 45,
@@ -83,7 +83,7 @@ typedef enum {
WPA_IE = 221,
WMM_IE = 221,
P2P_IE = 221,
-} BEACON_IE;
+};

enum bss_types {
INFRASTRUCTURE = 0,
@@ -91,7 +91,7 @@ enum bss_types {
AP,
};

-typedef enum {
+enum {
RATE_AUTO = 0,
RATE_1MB = 1,
RATE_2MB = 2,
@@ -105,7 +105,7 @@ typedef enum {
RATE_26MB = 36,
RATE_48MB = 48,
RATE_54MB = 54
-} TX_RATE_T;
+};

enum {
B_ONLY_MODE = 0, /* 1, 2 M, otherwise 5, 11 M */
--
2.7.4

2018-01-11 15:09:00

by Ajay Singh

[permalink] [raw]
Subject: [PATCH v3 2/6] staging: wilc1000: remove unnecessary typedef enum G_OPERATING_MODE_T

This patch has removed G_OPERATING_MODE_T typedef enum.
Now, its used as anonymous-enums for constants.
checkpatch.pl warning to avoid new typedef is fixes with this patch.

Signed-off-by: Ajay Singh <[email protected]>
---
drivers/staging/wilc1000/wilc_wlan_if.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wlan_if.h b/drivers/staging/wilc1000/wilc_wlan_if.h
index 2baf6c4..222bde2 100644
--- a/drivers/staging/wilc1000/wilc_wlan_if.h
+++ b/drivers/staging/wilc1000/wilc_wlan_if.h
@@ -107,12 +107,12 @@ typedef enum {
RATE_54MB = 54
} TX_RATE_T;

-typedef enum {
+enum {
B_ONLY_MODE = 0, /* 1, 2 M, otherwise 5, 11 M */
G_ONLY_MODE, /* 6,12,24 otherwise 9,18,36,48,54 */
G_MIXED_11B_1_MODE, /* 1,2,5.5,11 otherwise all on */
G_MIXED_11B_2_MODE, /* 1,2,5,11,6,12,24 otherwise all on */
-} G_OPERATING_MODE_T;
+};

typedef enum {
G_SHORT_PREAMBLE = 0, /* Short Preamble */
--
2.7.4