Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600028 > unrolled thread

[PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.

Started bymshan <educha997@gmail.com>
First post2017-03-14 06:00 +0100
Last post2017-03-14 10:50 +0100
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues. mshan <educha997@gmail.com> - 2017-03-14 06:00 +0100
    Re: [PATCH] Fixed a minor coding style warning. Arguments in the  macros should be coverd in brackets to aviod any precedence issues. Greg KH <gregkh@linuxfoundation.org> - 2017-03-14 06:50 +0100
    Re: [PATCH] Fixed a minor coding style warning. Arguments in the  macros should be coverd in brackets to aviod any precedence issues. Dan Carpenter <dan.carpenter@oracle.com> - 2017-03-14 10:50 +0100

#1600028 — [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.

Frommshan <educha997@gmail.com>
Date2017-03-14 06:00 +0100
Subject[PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
Message-ID<tkMIV-3jk-7@gated-at.bofh.it>
Signed-off-by: mshan <mohsinshan1k@gmail.com>
---
 drivers/staging/fwserial/fwserial.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
index 41a49c8..d693c03 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -98,7 +98,7 @@ struct fwtty_transaction {
 	};
 };
 
-#define to_device(a, b)			(a->b)
+#define to_device(a, b)			((a)->(b))
 #define fwtty_err(p, fmt, ...)						\
 	dev_err(to_device(p, device), fmt, ##__VA_ARGS__)
 #define fwtty_info(p, fmt, ...)						\
-- 
2.7.4

[toc] | [next] | [standalone]


#1600039 — Re: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.

FromGreg KH <gregkh@linuxfoundation.org>
Date2017-03-14 06:50 +0100
SubjectRe: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
Message-ID<tkNvj-3Vo-3@gated-at.bofh.it>
In reply to#1600028
On Mon, Mar 13, 2017 at 09:52:14PM -0700, mshan wrote:
> Signed-off-by: mshan <mohsinshan1k@gmail.com>
> ---
>  drivers/staging/fwserial/fwserial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You did not specify a description of why the patch is needed, or
  possibly, any description at all, in the email body.  Please read the
  section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what is needed in order to
  properly describe the change.

- You did not write a descriptive Subject: for the patch, allowing Greg,
  and everyone else, to know what this patch is all about.  Please read
  the section entitled "The canonical patch format" in the kernel file,
  Documentation/SubmittingPatches for what a proper Subject: line should
  look like.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot

[toc] | [prev] | [next] | [standalone]


#1600159 — Re: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.

FromDan Carpenter <dan.carpenter@oracle.com>
Date2017-03-14 10:50 +0100
SubjectRe: [PATCH] Fixed a minor coding style warning. Arguments in the macros should be coverd in brackets to aviod any precedence issues.
Message-ID<tkRfA-6BP-9@gated-at.bofh.it>
In reply to#1600028
On Mon, Mar 13, 2017 at 09:52:14PM -0700, mshan wrote:
> Signed-off-by: mshan <mohsinshan1k@gmail.com>
> ---
>  drivers/staging/fwserial/fwserial.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fwserial/fwserial.c b/drivers/staging/fwserial/fwserial.c
> index 41a49c8..d693c03 100644
> --- a/drivers/staging/fwserial/fwserial.c
> +++ b/drivers/staging/fwserial/fwserial.c
> @@ -98,7 +98,7 @@ struct fwtty_transaction {
>  	};
>  };
>  
> -#define to_device(a, b)			(a->b)
> +#define to_device(a, b)			((a)->(b))

This macro is silly.  Just delete it.

regards,
dan carpenter

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web