* [PATCH] staging: vt6656: fixed a CamelCase coding style issue.
@ 2021-02-19 9:58 Selvakumar Elangovan
2021-02-19 10:40 ` Greg KH
2021-02-19 12:12 ` Dan Carpenter
0 siblings, 2 replies; 4+ messages in thread
From: Selvakumar Elangovan @ 2021-02-19 9:58 UTC (permalink / raw)
To: forest, gregkh, tvboxspy, oscar.carter
Cc: devel, linux-kernel, linux-kernel-mentees
This patch renames CamelCase macros uVar and uModulo into u_var and
u_module in device.h
This issue was reported by checkpatch.pl
Signed-off-by: Selvakumar Elangovan <selvakumar16197@gmail.com>
---
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)) \
+ (u_var) = 0; \
else \
- (uVar)++; \
+ (u_var)++; \
}
int vnt_init(struct vnt_private *priv);
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: vt6656: fixed a CamelCase coding style issue.
2021-02-19 9:58 [PATCH] staging: vt6656: fixed a CamelCase coding style issue Selvakumar Elangovan
@ 2021-02-19 10:40 ` Greg KH
2021-02-19 12:12 ` Dan Carpenter
1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2021-02-19 10:40 UTC (permalink / raw)
To: Selvakumar Elangovan
Cc: forest, tvboxspy, oscar.carter, devel, linux-kernel,
linux-kernel-mentees
On Fri, Feb 19, 2021 at 03:28:35PM +0530, Selvakumar Elangovan wrote:
> This patch renames CamelCase macros uVar and uModulo into u_var and
> u_module in device.h
>
> This issue was reported by checkpatch.pl
>
> Signed-off-by: Selvakumar Elangovan <selvakumar16197@gmail.com>
> ---
> 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) { \
"u_" does not really make any sense, right?
Just use "var" and "modulo" please.
But first, why is this needed at all? Isn't there an in-kernel function
that should be used instead?
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: vt6656: fixed a CamelCase coding style issue.
2021-02-19 9:58 [PATCH] staging: vt6656: fixed a CamelCase coding style issue Selvakumar Elangovan
2021-02-19 10:40 ` Greg KH
@ 2021-02-19 12:12 ` Dan Carpenter
2021-02-19 12:20 ` Selvakumar E
1 sibling, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2021-02-19 12:12 UTC (permalink / raw)
To: Selvakumar Elangovan
Cc: forest, gregkh, tvboxspy, oscar.carter, devel,
linux-kernel-mentees, linux-kernel
You're not asking the right questions.
On Fri, Feb 19, 2021 at 03:28:35PM +0530, Selvakumar Elangovan wrote:
> 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?
> This issue was reported by checkpatch.pl
>
> Signed-off-by: Selvakumar Elangovan <selvakumar16197@gmail.com>
> ---
> 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.
> + (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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] staging: vt6656: fixed a CamelCase coding style issue.
2021-02-19 12:12 ` Dan Carpenter
@ 2021-02-19 12:20 ` Selvakumar E
0 siblings, 0 replies; 4+ messages in thread
From: Selvakumar E @ 2021-02-19 12:20 UTC (permalink / raw)
To: Dan Carpenter
Cc: forest, gregkh, tvboxspy, oscar.carter, devel,
linux-kernel-mentees, linux-kernel
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 <dan.carpenter@oracle.com> wrote:
>
> You're not asking the right questions.
>
> On Fri, Feb 19, 2021 at 03:28:35PM +0530, Selvakumar Elangovan wrote:
> > 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?
>
> > This issue was reported by checkpatch.pl
> >
> > Signed-off-by: Selvakumar Elangovan <selvakumar16197@gmail.com>
> > ---
> > 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.
>
> > + (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
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-02-19 12:21 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-19 9:58 [PATCH] staging: vt6656: fixed a CamelCase coding style issue Selvakumar Elangovan
2021-02-19 10:40 ` Greg KH
2021-02-19 12:12 ` Dan Carpenter
2021-02-19 12:20 ` Selvakumar E
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).