From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Nikolay Kyx <knv418@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-media@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: media: omap4iss: code style - avoid macro argument precedence issues
Date: Sun, 21 Feb 2021 23:33:26 +0200 [thread overview]
Message-ID: <YDLRpmZmq/ZpeoSW@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20210221195308.1451-1-knv418@gmail.com>
Hi Nikolay,
Thank you for the patch.
On Sun, Feb 21, 2021 at 10:53:08PM +0300, Nikolay Kyx wrote:
> This patch fixes the following checkpatch.pl check:
>
> CHECK: Macro argument 'i' may be better as '(i)' to avoid precedence issues
>
> in file iss_regs.h
>
> Signed-off-by: Nikolay Kyx <knv418@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>
> Additionally some style warnings remain valid here and could be fixed by
> another patch.
>
> drivers/staging/media/omap4iss/iss_regs.h | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/media/omap4iss/iss_regs.h b/drivers/staging/media/omap4iss/iss_regs.h
> index 09a7375c89ac..cfe0bb075072 100644
> --- a/drivers/staging/media/omap4iss/iss_regs.h
> +++ b/drivers/staging/media/omap4iss/iss_regs.h
> @@ -197,7 +197,7 @@
> #define CSI2_TIMING_STOP_STATE_COUNTER_IO1_MASK (0x1fff << 0)
> #define CSI2_TIMING_STOP_STATE_COUNTER_IO1_SHIFT 0
>
> -#define CSI2_CTX_CTRL1(i) (0x70 + (0x20 * i))
> +#define CSI2_CTX_CTRL1(i) (0x70 + (0x20 * (i)))
> #define CSI2_CTX_CTRL1_GENERIC BIT(30)
> #define CSI2_CTX_CTRL1_TRANSCODE (0xf << 24)
> #define CSI2_CTX_CTRL1_FEC_NUMBER_MASK (0xff << 16)
> @@ -210,7 +210,7 @@
> #define CSI2_CTX_CTRL1_PING_PONG BIT(3)
> #define CSI2_CTX_CTRL1_CTX_EN BIT(0)
>
> -#define CSI2_CTX_CTRL2(i) (0x74 + (0x20 * i))
> +#define CSI2_CTX_CTRL2(i) (0x74 + (0x20 * (i)))
> #define CSI2_CTX_CTRL2_FRAME_MASK (0xffff << 16)
> #define CSI2_CTX_CTRL2_FRAME_SHIFT 16
> #define CSI2_CTX_CTRL2_USER_DEF_MAP_SHIFT 13
> @@ -222,19 +222,19 @@
> #define CSI2_CTX_CTRL2_FORMAT_MASK (0x3ff << 0)
> #define CSI2_CTX_CTRL2_FORMAT_SHIFT 0
>
> -#define CSI2_CTX_DAT_OFST(i) (0x78 + (0x20 * i))
> +#define CSI2_CTX_DAT_OFST(i) (0x78 + (0x20 * (i)))
> #define CSI2_CTX_DAT_OFST_MASK (0xfff << 5)
>
> -#define CSI2_CTX_PING_ADDR(i) (0x7c + (0x20 * i))
> +#define CSI2_CTX_PING_ADDR(i) (0x7c + (0x20 * (i)))
> #define CSI2_CTX_PING_ADDR_MASK 0xffffffe0
>
> -#define CSI2_CTX_PONG_ADDR(i) (0x80 + (0x20 * i))
> +#define CSI2_CTX_PONG_ADDR(i) (0x80 + (0x20 * (i)))
> #define CSI2_CTX_PONG_ADDR_MASK CSI2_CTX_PING_ADDR_MASK
>
> -#define CSI2_CTX_IRQENABLE(i) (0x84 + (0x20 * i))
> -#define CSI2_CTX_IRQSTATUS(i) (0x88 + (0x20 * i))
> +#define CSI2_CTX_IRQENABLE(i) (0x84 + (0x20 * (i)))
> +#define CSI2_CTX_IRQSTATUS(i) (0x88 + (0x20 * (i)))
>
> -#define CSI2_CTX_CTRL3(i) (0x8c + (0x20 * i))
> +#define CSI2_CTX_CTRL3(i) (0x8c + (0x20 * (i)))
> #define CSI2_CTX_CTRL3_ALPHA_SHIFT 5
> #define CSI2_CTX_CTRL3_ALPHA_MASK \
> (0x3fff << CSI2_CTX_CTRL3_ALPHA_SHIFT)
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2021-02-21 21:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-21 19:53 Nikolay Kyx
2021-02-21 20:02 ` Laurent Pinchart
2021-02-21 21:33 ` Laurent Pinchart [this message]
2021-02-21 21:21 Nikolay K.
2021-02-21 21:33 ` Laurent Pinchart
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=YDLRpmZmq/ZpeoSW@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=knv418@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/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
all inboxes | Powered by JetHome®