From: Jakub Kicinski <kuba@kernel.org>
To: Corentin Labbe <clabbe.montjoie@gmail.com>
Cc: Conley Lee <conleylee@foxmail.com>,
davem@davemloft.net, mripard@kernel.org, wens@csie.org,
netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: ethernet: sun4i-emac: replace magic number with macro
Date: Mon, 10 Jan 2022 09:28:36 -0800 [thread overview]
Message-ID: <20220110092836.113dbae1@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net> (raw)
In-Reply-To: <Ydw7EzPvwArW/siQ@Red>
On Mon, 10 Jan 2022 14:56:35 +0100 Corentin Labbe wrote:
> > @@ -61,7 +62,21 @@
> > #define EMAC_RX_IO_DATA_STATUS_OK (1 << 7)
> > #define EMAC_RX_FBC_REG (0x50)
> > #define EMAC_INT_CTL_REG (0x54)
> > +#define EMAC_INT_CTL_RX_EN (1 << 8)
> > +#define EMAC_INT_CTL_TX0_EN (1)
> > +#define EMAC_INT_CTL_TX1_EN (1 << 1)
> > +#define EMAC_INT_CTL_TX_EN (EMAC_INT_CTL_TX0_EN | EMAC_INT_CTL_TX1_EN)
> > +#define EMAC_INT_CTL_TX0_ABRT_EN (0x1 << 2)
> > +#define EMAC_INT_CTL_TX1_ABRT_EN (0x1 << 3)
> > +#define EMAC_INT_CTL_TX_ABRT_EN (EMAC_INT_CTL_TX0_ABRT_EN | EMAC_INT_CTL_TX1_ABRT_EN)
> > #define EMAC_INT_STA_REG (0x58)
> > +#define EMAC_INT_STA_TX0_COMPLETE (0x1)
> > +#define EMAC_INT_STA_TX1_COMPLETE (0x1 << 1)
> > +#define EMAC_INT_STA_TX_COMPLETE (EMAC_INT_STA_TX0_COMPLETE | EMAC_INT_STA_TX1_COMPLETE)
> > +#define EMAC_INT_STA_TX0_ABRT (0x1 << 2)
> > +#define EMAC_INT_STA_TX1_ABRT (0x1 << 3)
> > +#define EMAC_INT_STA_TX_ABRT (EMAC_INT_STA_TX0_ABRT | EMAC_INT_STA_TX1_ABRT)
> > +#define EMAC_INT_STA_RX_COMPLETE (0x1 << 8)
>
> As proposed by checkpatch, I thing there are several place (like all
> EMAC_INT_STA) where you could use BIT(x) instead of (0xX << x)
That's not a hard requirement, if the driver already uses the shift you
can leave your code as is, some upstream developers actually prefer to
avoid the BIT() macro.
next prev parent reply other threads:[~2022-01-10 17:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-10 7:23 [PATCH 0/2] sun4i-emac: replace magic number with marcos conleylee
2022-01-10 8:32 ` Corentin Labbe
2022-01-10 11:35 ` [PATCH v2] net: ethernet: sun4i-emac: replace magic number with macro Conley Lee
2022-01-10 13:05 ` Leon Romanovsky
2022-01-10 14:42 ` Conley Lee
2022-01-10 13:31 ` Andrew Lunn
2022-01-10 14:40 ` Conley Lee
2022-01-10 13:56 ` Corentin Labbe
2022-01-10 17:28 ` Jakub Kicinski [this message]
2022-01-11 3:19 ` Conley Lee
2022-01-11 3:05 ` [PATCH v3] " Conley Lee
2022-01-11 16:32 ` Corentin Labbe
2022-01-12 6:16 ` Conley Lee
2022-01-12 4:40 ` patchwork-bot+netdevbpf
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=20220110092836.113dbae1@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net \
--to=kuba@kernel.org \
--cc=clabbe.montjoie@gmail.com \
--cc=conleylee@foxmail.com \
--cc=davem@davemloft.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).