From: Joe Perches <joe@perches.com>
To: Francois Romieu <romieu@fr.zoreil.com>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
netdev@vger.kernel.org, davem@davemloft.net, cernekee@gmail.com,
devicetree@vger.kernel.org
Subject: Re: [PATCH net-next v2 06/10] net: bcmgenet: add main driver file
Date: Thu, 13 Feb 2014 02:58:43 -0800 [thread overview]
Message-ID: <1392289123.2214.36.camel@joe-AO722> (raw)
In-Reply-To: <20140213103506.GB14941@electric-eye.fr.zoreil.com>
On Thu, 2014-02-13 at 11:35 +0100, Francois Romieu wrote:
> Florian Fainelli <f.fainelli@gmail.com> :
> [...]
> > diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
[]
> > +static int bcmgenet_set_rx_csum(struct net_device *dev,
> > + netdev_features_t wanted)
> > +{
> > + struct bcmgenet_priv *priv = netdev_priv(dev);
> > + u32 rbuf_chk_ctrl;
> > + int rx_csum_en;
> > +
> > + rx_csum_en = !!(wanted & NETIF_F_RXCSUM);
>
> It's a bool.
It could be a bool.
The struct definition has:
+ unsigned int desc_rxchk_en;
but perhaps a lot of these members could be bool.
It'd be nicer if the variable types were the same.
> > + spin_lock_bh(&priv->bh_lock);
> > + rbuf_chk_ctrl = bcmgenet_rbuf_readl(priv, RBUF_CHK_CTRL);
> > +
> > + /* enable rx checksumming */
> > + if (!rx_csum_en)
> > + rbuf_chk_ctrl &= ~RBUF_RXCHK_EN;
> > + else
> > + rbuf_chk_ctrl |= RBUF_RXCHK_EN;
This is more normally written with a positive test like:
if (rx_csum_en)
rbuf_chk_ctrl |= RBUF_RXCHK_EN;
else
rbuf_chk_ctrl &= RBUF_RXCHK_EN;
> > + priv->desc_rxchk_en = rx_csum_en;
next prev parent reply other threads:[~2014-02-13 10:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 5:29 [PATCH net-next v2 00/10] Support for the Broadcom GENET driver Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 02/10] net: phy: add MoCA PHY type Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 03/10] net: phy: update port type for MoCA PHYs Florian Fainelli
[not found] ` <1392269395-23513-1-git-send-email-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-02-13 5:29 ` [PATCH net-next v2 01/10] net: phy: add "internal" PHY mode Florian Fainelli
2014-02-13 20:34 ` David Miller
2014-02-13 20:41 ` Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 04/10] net: phy: add Broadcom BCM7xxx internal PHY driver Florian Fainelli
2014-02-13 10:34 ` Francois Romieu
2014-02-13 18:41 ` Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 05/10] net: bcmgenet: add driver definitions and private structure Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 06/10] net: bcmgenet: add main driver file Florian Fainelli
2014-02-13 10:35 ` Francois Romieu
2014-02-13 10:58 ` Joe Perches [this message]
2014-02-13 11:38 ` Mark Rutland
2014-02-13 5:29 ` [PATCH net-next v2 07/10] net: bcmgenet: add MDIO routines Florian Fainelli
2014-02-13 11:50 ` Mark Rutland
2014-02-13 17:00 ` Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 08/10] net: bcmgenet: hook into the build system Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 09/10] Documentation: add Device tree bindings for Broadcom GENET Florian Fainelli
[not found] ` <1392269395-23513-10-git-send-email-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-02-13 11:13 ` Mark Rutland
[not found] ` <20140213111328.GB30705-NuALmloUBlrZROr8t4l/smS4ubULX0JqMm0uRHvK7Nw@public.gmane.org>
2014-02-13 16:57 ` Florian Fainelli
2014-02-13 5:29 ` [PATCH net-next v2 10/10] MAINTAINERS: add entry for the Broadcom GENET driver Florian Fainelli
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=1392289123.2214.36.camel@joe-AO722 \
--to=joe@perches.com \
--cc=cernekee@gmail.com \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=romieu@fr.zoreil.com \
/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).