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@xxxxxxxxxxxxxxxxxx>
+ * Copyright (C) 2015-2016 Cogent Embedded, Inc. <source@xxxxxxxxxxxxxxxxxx>
*
* 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