Skip to contentSkip to conversation

staging: sm750fb: remove typedef for enum

PATCH Superseded Keerthi Reddy 2 participants 2 messages Oct 1, 2017

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: sm750fb: remove typedef for enum

Using typedef will hide that 'DPMS_t' is enum. Removing this will make sure that we are actually working with enum. Also is not a good coding style to use typedef.

---
 drivers/staging/sm750fb/ddk750_power.c | 2 +-
 drivers/staging/sm750fb/ddk750_power.h | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/ddk750_power.c +1 -1
index 222ae1a..5d85593 100644
@@ -2,7 +2,7 @@
 #include "ddk750_reg.h"
 #include "ddk750_power.h"
 
-void ddk750_set_dpms(DPMS_t state)
+void ddk750_set_dpms(enum DPMS_t state)
 {
 	unsigned int value;
 
drivers/staging/sm750fb/ddk750_power.h +3 -4
index 44c4fc5..a0a5bbf 100644
@@ -1,20 +1,19 @@
 #ifndef DDK750_POWER_H__
 #define DDK750_POWER_H__
 
-typedef enum _DPMS_t {
+enum DPMS_t {
 	crtDPMS_ON = 0x0,
 	crtDPMS_STANDBY = 0x1,
 	crtDPMS_SUSPEND = 0x2,
 	crtDPMS_OFF = 0x3,
-}
-DPMS_t;
+};
 
 #define setDAC(off) {							\
 	poke32(MISC_CTRL,						\
 	       (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \
 }
 
-void ddk750_set_dpms(DPMS_t state);
+void ddk750_set_dpms(enum DPMS_t state);
 void sm750_set_power_mode(unsigned int powerMode);
 void sm750_set_current_gate(unsigned int gate);
 
Signature · 1 line
2.7.4
#1 lore raw
Quoted 3 lines · Keerthi Reddy

Using typedef will hide that 'DPMS_t' is enum. Removing this will make sure that we are actually working with enum. Also is not a good coding style to use typedef.

Please lowercase the name and drop the _t, which traditionally indicates a typedef.

julia

Quoted 58 lines
---
 drivers/staging/sm750fb/ddk750_power.c | 2 +-
 drivers/staging/sm750fb/ddk750_power.h | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/staging/sm750fb/ddk750_power.c +1 -1
index 222ae1a..5d85593 100644
@@ -2,7 +2,7 @@
 #include "ddk750_reg.h"
 #include "ddk750_power.h"
 
-void ddk750_set_dpms(DPMS_t state)
+void ddk750_set_dpms(enum DPMS_t state)
 {
 	unsigned int value;
 
drivers/staging/sm750fb/ddk750_power.h +3 -5
index 44c4fc5..a0a5bbf 100644
@@ -1,20 +1,19 @@
 #ifndef DDK750_POWER_H__
 #define DDK750_POWER_H__
 
-typedef enum _DPMS_t {
+enum DPMS_t {
 	crtDPMS_ON = 0x0,
 	crtDPMS_STANDBY = 0x1,
 	crtDPMS_SUSPEND = 0x2,
 	crtDPMS_OFF = 0x3,
-}
-DPMS_t;
+};
 
 #define setDAC(off) {							\
 	poke32(MISC_CTRL,						\
 	       (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \
 }
 
-void ddk750_set_dpms(DPMS_t state);
+void ddk750_set_dpms(enum DPMS_t state);
 void sm750_set_power_mode(unsigned int powerMode);
 void sm750_set_current_gate(unsigned int gate);
 
--

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 [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20171001115936.GA4941%40manoharreddy.
For more options, visit https://groups.google.com/d/optout.