Thread (4 messages) 4 messages, 3 authors, 2021-02-19

Re: [Linux-kernel-mentees] [PATCH] staging: vt6656: fixed a CamelCase coding style issue.

From: Selvakumar E <hidden>
Date: 2021-02-19 12:21:47
Also in: lkml

Hi Dan Carpenter

Thanks for the feedback, I'll work on the suggestion and come back with a fix.

Regards
Selvakumar Elangovan

On Fri, Feb 19, 2021 at 5:42 PM Dan Carpenter [off-list ref] wrote:
You're not asking the right questions.

On Fri, Feb 19, 2021 at 03:28:35PM +0530, Selvakumar Elangovan wrote:
quoted
This patch renames CamelCase macros uVar and uModulo into u_var and
u_module in device.h
Is "u_var" a good name?  What does the "u_" even mean?
quoted
This issue was reported by checkpatch.pl

Signed-off-by: Selvakumar Elangovan <redacted>
---
 drivers/staging/vt6656/device.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/vt6656/device.h b/drivers/staging/vt6656/device.h
index 947530fefe94..6615d356f74a 100644
--- a/drivers/staging/vt6656/device.h
+++ b/drivers/staging/vt6656/device.h
@@ -385,11 +385,11 @@ struct vnt_private {
      struct ieee80211_low_level_stats low_stats;
 };

-#define ADD_ONE_WITH_WRAP_AROUND(uVar, uModulo) {    \
-     if ((uVar) >= ((uModulo) - 1))                  \
-             (uVar) = 0;                             \
+#define ADD_ONE_WITH_WRAP_AROUND(u_var, u_modulo) {  \
+     if ((u_var) >= ((u_modulo) - 1))                        \
The \ is not aligned any more.
quoted
+             (u_var) = 0;                            \
      else                                            \
-             (uVar)++;                               \
+             (u_var)++;                              \
 }

This macro is rubbish.  How does the wrap around even make sense?
I hope that if you review the code a bit I think you will find that the
wrap around is impossible?  Just fix the two callers and delete this
macro.

regards,
dan carpenter
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help