diff mbox series

[v2,08/49] staging: sm750fb: Update enum values in dpms to snake case

Message ID 16693e7cc62f84ea1ec34b7d5cbd77c4cd1965e8.1617776878.git.pavle.rohalj@gmail.com (mailing list archive)
State Superseded, archived
Headers show
Series *** SUBJECT HERE *** | expand

Commit Message

Pavle Rohalj April 7, 2021, 6:36 a.m. UTC
Fix "Avoid CamelCase" checkpatch.pl checks for values in
enum dpms.

Signed-off-by: Pavle Rohalj <pavle.rohalj@gmail.com>
---
 drivers/staging/sm750fb/ddk750_power.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Greg Kroah-Hartman April 7, 2021, 7:24 a.m. UTC | #1
On Tue, Apr 06, 2021 at 11:36:16PM -0700, Pavle Rohalj wrote:
> Fix "Avoid CamelCase" checkpatch.pl checks for values in
> enum dpms.
> 
> Signed-off-by: Pavle Rohalj <pavle.rohalj@gmail.com>
> ---
>  drivers/staging/sm750fb/ddk750_power.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
> index 7002567a47d2..4756db1ccb9c 100644
> --- a/drivers/staging/sm750fb/ddk750_power.h
> +++ b/drivers/staging/sm750fb/ddk750_power.h
> @@ -3,10 +3,10 @@
>  #define DDK750_POWER_H__
>  
>  enum dpms {
> -	crtDPMS_ON = 0x0,
> -	crtDPMS_STANDBY = 0x1,
> -	crtDPMS_SUSPEND = 0x2,
> -	crtDPMS_OFF = 0x3,
> +	CRT_DPMS_ON = 0x0,
> +	CRT_DPMS_STANDBY = 0x1,
> +	CRT_DPMS_SUSPEND = 0x2,
> +	CRT_DPMS_OFF = 0x3,
>  };

And the build does not break with this change?  If so, then why are
these here at all?

thanks,

greg k-h
Pavle Rohalj April 7, 2021, 8:27 a.m. UTC | #2
On Wed, Apr 07, 2021 at 09:24:07AM +0200, Greg KH wrote:
> On Tue, Apr 06, 2021 at 11:36:16PM -0700, Pavle Rohalj wrote:
> > Fix "Avoid CamelCase" checkpatch.pl checks for values in
> > enum dpms.
> > 
> > Signed-off-by: Pavle Rohalj <pavle.rohalj@gmail.com>
> > ---
> >  drivers/staging/sm750fb/ddk750_power.h | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
> > index 7002567a47d2..4756db1ccb9c 100644
> > --- a/drivers/staging/sm750fb/ddk750_power.h
> > +++ b/drivers/staging/sm750fb/ddk750_power.h
> > @@ -3,10 +3,10 @@
> >  #define DDK750_POWER_H__
> >  
> >  enum dpms {
> > -	crtDPMS_ON = 0x0,
> > -	crtDPMS_STANDBY = 0x1,
> > -	crtDPMS_SUSPEND = 0x2,
> > -	crtDPMS_OFF = 0x3,
> > +	CRT_DPMS_ON = 0x0,
> > +	CRT_DPMS_STANDBY = 0x1,
> > +	CRT_DPMS_SUSPEND = 0x2,
> > +	CRT_DPMS_OFF = 0x3,
> >  };
> 
> And the build does not break with this change?  If so, then why are
> these here at all?
> 
> thanks,
> 
> greg k-h

I do not think so, I was able to build and load the driver with these
changes. It looks like this enum is used as a type of the state parameter of
ddk750_set_dpms function, but the three defined constants are never referenced. 
Should we get rid of dpms enum and change the type of the parameter to an unsigned integer?

-Pavle
Greg Kroah-Hartman April 7, 2021, 8:39 a.m. UTC | #3
On Wed, Apr 07, 2021 at 01:27:49AM -0700, Pavle Rohalj wrote:
> On Wed, Apr 07, 2021 at 09:24:07AM +0200, Greg KH wrote:
> > On Tue, Apr 06, 2021 at 11:36:16PM -0700, Pavle Rohalj wrote:
> > > Fix "Avoid CamelCase" checkpatch.pl checks for values in
> > > enum dpms.
> > > 
> > > Signed-off-by: Pavle Rohalj <pavle.rohalj@gmail.com>
> > > ---
> > >  drivers/staging/sm750fb/ddk750_power.h | 8 ++++----
> > >  1 file changed, 4 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
> > > index 7002567a47d2..4756db1ccb9c 100644
> > > --- a/drivers/staging/sm750fb/ddk750_power.h
> > > +++ b/drivers/staging/sm750fb/ddk750_power.h
> > > @@ -3,10 +3,10 @@
> > >  #define DDK750_POWER_H__
> > >  
> > >  enum dpms {
> > > -	crtDPMS_ON = 0x0,
> > > -	crtDPMS_STANDBY = 0x1,
> > > -	crtDPMS_SUSPEND = 0x2,
> > > -	crtDPMS_OFF = 0x3,
> > > +	CRT_DPMS_ON = 0x0,
> > > +	CRT_DPMS_STANDBY = 0x1,
> > > +	CRT_DPMS_SUSPEND = 0x2,
> > > +	CRT_DPMS_OFF = 0x3,
> > >  };
> > 
> > And the build does not break with this change?  If so, then why are
> > these here at all?
> > 
> > thanks,
> > 
> > greg k-h
> 
> I do not think so, I was able to build and load the driver with these
> changes. It looks like this enum is used as a type of the state parameter of
> ddk750_set_dpms function, but the three defined constants are never referenced. 
> Should we get rid of dpms enum and change the type of the parameter to an unsigned integer?

If the enum is used, but the names are not used, that's not good and
should be fixed up.

thanks,

greg k-h
Dan Carpenter May 8, 2021, 9:47 a.m. UTC | #4
On Tue, Apr 06, 2021 at 11:36:16PM -0700, Pavle Rohalj wrote:
> Fix "Avoid CamelCase" checkpatch.pl checks for values in
> enum dpms.
> 
> Signed-off-by: Pavle Rohalj <pavle.rohalj@gmail.com>
> ---
>  drivers/staging/sm750fb/ddk750_power.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
> index 7002567a47d2..4756db1ccb9c 100644
> --- a/drivers/staging/sm750fb/ddk750_power.h
> +++ b/drivers/staging/sm750fb/ddk750_power.h
> @@ -3,10 +3,10 @@
>  #define DDK750_POWER_H__
>  
>  enum dpms {
> -	crtDPMS_ON = 0x0,
> -	crtDPMS_STANDBY = 0x1,
> -	crtDPMS_SUSPEND = 0x2,
> -	crtDPMS_OFF = 0x3,
> +	CRT_DPMS_ON = 0x0,
> +	CRT_DPMS_STANDBY = 0x1,
> +	CRT_DPMS_SUSPEND = 0x2,
> +	CRT_DPMS_OFF = 0x3,
>  };

These must be unused.  Delete.

regards,
dan carpenter
diff mbox series

Patch

diff --git a/drivers/staging/sm750fb/ddk750_power.h b/drivers/staging/sm750fb/ddk750_power.h
index 7002567a47d2..4756db1ccb9c 100644
--- a/drivers/staging/sm750fb/ddk750_power.h
+++ b/drivers/staging/sm750fb/ddk750_power.h
@@ -3,10 +3,10 @@ 
 #define DDK750_POWER_H__
 
 enum dpms {
-	crtDPMS_ON = 0x0,
-	crtDPMS_STANDBY = 0x1,
-	crtDPMS_SUSPEND = 0x2,
-	crtDPMS_OFF = 0x3,
+	CRT_DPMS_ON = 0x0,
+	CRT_DPMS_STANDBY = 0x1,
+	CRT_DPMS_SUSPEND = 0x2,
+	CRT_DPMS_OFF = 0x3,
 };
 
 #define set_DAC(off) {							\