From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: "Dominik Karol Piątkowski"
<dominik.karol.piatkowski@protonmail.com>,
gregkh@linuxfoundation.org
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: vt6655: mac.h: Fix possible precedence issue in macros
Date: Thu, 12 Sep 2024 21:11:17 +0200 [thread overview]
Message-ID: <6141d6af-a959-41af-b612-33c8f4e16645@gmail.com> (raw)
In-Reply-To: <20240911180149.14474-1-dominik.karol.piatkowski@protonmail.com>
On 9/11/24 20:02, Dominik Karol Piątkowski wrote:
> It is safer to put macro arguments in parentheses. This way, accidental
> operator precedence issues can be avoided.
>
> Signed-off-by: Dominik Karol Piątkowski <dominik.karol.piatkowski@protonmail.com>
> ---
> drivers/staging/vt6655/mac.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/vt6655/mac.h b/drivers/staging/vt6655/mac.h
> index acf931c3f5fd..a33af2852227 100644
> --- a/drivers/staging/vt6655/mac.h
> +++ b/drivers/staging/vt6655/mac.h
> @@ -537,9 +537,9 @@
>
> /*--------------------- Export Macros ------------------------------*/
>
> -#define VT6655_MAC_SELECT_PAGE0(iobase) iowrite8(0, iobase + MAC_REG_PAGE1SEL)
> +#define VT6655_MAC_SELECT_PAGE0(iobase) iowrite8(0, (iobase) + MAC_REG_PAGE1SEL)
>
> -#define VT6655_MAC_SELECT_PAGE1(iobase) iowrite8(1, iobase + MAC_REG_PAGE1SEL)
> +#define VT6655_MAC_SELECT_PAGE1(iobase) iowrite8(1, (iobase) + MAC_REG_PAGE1SEL)
>
> #define MAKEWORD(lb, hb) \
> ((unsigned short)(((unsigned char)(lb)) | (((unsigned short)((unsigned char)(hb))) << 8)))
Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
next prev parent reply other threads:[~2024-09-12 19:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-11 18:02 [PATCH] staging: vt6655: mac.h: Fix possible precedence issue in macros Dominik Karol Piątkowski
2024-09-12 19:11 ` Philipp Hortmann [this message]
2024-09-12 19:29 ` Philipp Hortmann
2024-09-12 20:18 ` Dominik Karol Piątkowski
2024-09-12 20:47 ` Philipp Hortmann
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=6141d6af-a959-41af-b612-33c8f4e16645@gmail.com \
--to=philipp.g.hortmann@gmail.com \
--cc=dominik.karol.piatkowski@protonmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox