[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdW5p3w4MPxQoPqrrmX1W6WE40SEOZKwp6YEVqhmy49_6g@mail.gmail.com>
Date: Sun, 7 Feb 2016 21:49:50 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH 2/2] sh_eth: factor out register bit twiddling code
Hi Sergei,
On Sun, Feb 7, 2016 at 8:30 PM, Sergei Shtylyov
<sergei.shtylyov@...entembedded.com> wrote:
> --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c
> +++ net-next/drivers/net/ethernet/renesas/sh_eth.c
> @@ -428,6 +428,13 @@ static u32 sh_eth_read(struct net_device
> return ioread32(mdp->addr + offset);
> }
>
> +static void sh_eth_modify(struct net_device *ndev, int enum_index, u32 mask,
> + u32 value)
> +{
> + sh_eth_write(ndev, (sh_eth_read(ndev, enum_index) & ~mask) | value,
> + enum_index);
> +}
Same comment as for ravb:
Usually "mask"is used for the bits to keep, not for the bits to clear.
So I'd either
1. AND with "mask" instead of "~mask", and update all callers, or
2. rename "mask" to "clear", and "value" to "set".
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
Powered by blists - more mailing lists