[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <56B7AFFF.1060005@cogentembedded.com>
Date: Sun, 7 Feb 2016 23:58:39 +0300
From: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>
To: Geert Uytterhoeven <geert@...ux-m68k.org>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
linux-renesas-soc@...r.kernel.org
Subject: Re: [PATCH 1/2] ravb: factor out register bit twiddling code
Hello.
On 02/07/2016 11:48 PM, Geert Uytterhoeven wrote:
>> --- net-next.orig/drivers/net/ethernet/renesas/ravb_main.c
>> +++ net-next/drivers/net/ethernet/renesas/ravb_main.c
>> @@ -2,7 +2,7 @@
>> *
>> * Copyright (C) 2014-2015 Renesas Electronics Corporation
>> * Copyright (C) 2015 Renesas Solutions Corp.
>> - * Copyright (C) 2015 Cogent Embedded, Inc. <source@...entembedded.com>
>> + * Copyright (C) 2015-2016 Cogent Embedded, Inc. <source@...entembedded.com>
>> *
>> * Based on the SuperH Ethernet driver
>> *
>> @@ -42,6 +42,12 @@
>> NETIF_MSG_RX_ERR | \
>> NETIF_MSG_TX_ERR)
>>
>> +void ravb_modify(struct net_device *ndev, enum ravb_reg reg, u32 mask,
>> + u32 value)
>> +{
>> + ravb_write(ndev, (ravb_read(ndev, reg) & ~mask) | value, reg);
>> +}
>
> 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".
I'll go with the 2nd option.
> Gr{oetje,eeting}s,
>
> Geert
MBR, Sergei
Powered by blists - more mailing lists