All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Selvakumar Elangovan <selvakumar16197@gmail.com>
Cc: devel@driverdev.osuosl.org, oscar.carter@gmx.com,
	tvboxspy@gmail.com, linux-kernel@vger.kernel.org,
	forest@alittletooquiet.net,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [Linux-kernel-mentees] [PATCH] staging: vt6656: fixed a CamelCase coding style issue.
Date: Fri, 19 Feb 2021 15:12:19 +0300	[thread overview]
Message-ID: <20210219121219.GZ2087@kadam> (raw)
In-Reply-To: <20210219095835.9687-1-selvakumar16197@gmail.com>

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

_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees

WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Selvakumar Elangovan <selvakumar16197@gmail.com>
Cc: forest@alittletooquiet.net, gregkh@linuxfoundation.org,
	tvboxspy@gmail.com, oscar.carter@gmx.com,
	devel@driverdev.osuosl.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vt6656: fixed a CamelCase coding style issue.
Date: Fri, 19 Feb 2021 15:12:19 +0300	[thread overview]
Message-ID: <20210219121219.GZ2087@kadam> (raw)
In-Reply-To: <20210219095835.9687-1-selvakumar16197@gmail.com>

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


  parent reply	other threads:[~2021-02-19 12:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-19  9:58 [Linux-kernel-mentees] [PATCH] staging: vt6656: fixed a CamelCase coding style issue Selvakumar Elangovan
2021-02-19  9:58 ` Selvakumar Elangovan
2021-02-19 10:40 ` [Linux-kernel-mentees] " Greg KH
2021-02-19 10:40   ` Greg KH
2021-02-19 12:12 ` Dan Carpenter [this message]
2021-02-19 12:12   ` Dan Carpenter
2021-02-19 12:20   ` [Linux-kernel-mentees] " Selvakumar E
2021-02-19 12:20     ` Selvakumar E

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210219121219.GZ2087@kadam \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=forest@alittletooquiet.net \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oscar.carter@gmx.com \
    --cc=selvakumar16197@gmail.com \
    --cc=tvboxspy@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.