Fwd: Need guidance regarding fixing styleguide error in rtl871x_pwrctrl.h

Ankit Pandey itsankitkp at gmail.com
Tue Feb 8 12:56:54 EST 2022

I had submitted following patch:

 drivers/staging/rtl8712/rtl871x_pwrctrl.h | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
index b35b9c792..29f8b6136 100644
--- a/drivers/staging/rtl8712/rtl871x_pwrctrl.h
+++ b/drivers/staging/rtl8712/rtl871x_pwrctrl.h
@@ -74,14 +74,14 @@ struct reportpwrstate_parm {

 struct pwrctrl_priv {
        struct mutex mutex_lock;
-       /*volatile*/ u8 rpwm; /* requested power state for fw */
+       u8 rpwm; /* requested power state for fw */
        /* fw current power state. updated when 1. read from HCPWM or
         * 2. driver lowers power level
-       /*volatile*/ u8 cpwm;
-       /*volatile*/ u8 tog; /* toggling */
-       /*volatile*/ u8 cpwm_tog; /* toggling */
-       /*volatile*/ u8 tgt_rpwm; /* wanted power state */
+       u8 cpwm;
+       u8 tog; /* toggling */
+       u8 cpwm_tog; /* toggling */
+       u8 tgt_rpwm; /* wanted power state */
        uint pwr_mode;
        uint smart_ps;
        uint alives;
@@ -106,7 +106,7 @@ void r8712_unregister_cmd_alive(struct _adapter
 void r8712_cpwm_int_hdl(struct _adapter *padapter,
                        struct reportpwrstate_parm *preportpwrstate);
 void r8712_set_ps_mode(struct _adapter *padapter, uint ps_mode,
-                       uint smart_ps);
+                      uint smart_ps);
 void r8712_set_rpwm(struct _adapter *padapter, u8 val8);
 void r8712_flush_rwctrl_works(struct _adapter *padapter);
And I was asked to verify if there is some specific meaning is attached to
comment here (which was causing the issue).
I would be glad you could explain me how should I approach this issue? One
way would
be to rewrite that these variables could be defined as volatile (just add a
comment) and then compile driver and see that build goes through without
any error.
Other way would be that try to understand what this function is supposed to
be doing and then figure out author's intent of putting volatile there. How
should I take decision on these (or if they are wrong approaches) ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20220208/c8374248/attachment.html>

More information about the Kernelnewbies mailing list