mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Subject: Re: [PATCH 5/5] staging: fsl-dpaa2/eth: Remove Rx frame size check
Date: Tue, 10 Jul 2018 19:45:42 +0300	[thread overview]
Message-ID: <20180710164541.ywfwlw5b7ecufuqa@mwanda> (raw)
In-Reply-To: <AM3PR04MB338B88A42C1B4802D832DCE945B0@AM3PR04MB338.eurprd04.prod.outlook.com>

On Tue, Jul 10, 2018 at 03:55:32PM +0000, Ioana Ciocoi Radulescu wrote:
> > -----Original Message-----
> > From: Dan Carpenter [mailto:dan.carpenter@oracle.com]
> > Sent: Monday, July 9, 2018 10:28 PM
> > To: Ioana Ciocoi Radulescu <ruxandra.radulescu@nxp.com>
> > Cc: gregkh@linuxfoundation.org; devel@driverdev.osuosl.org; linux-
> > kernel@vger.kernel.org; Ioana Ciornei <ioana.ciornei@nxp.com>
> > Subject: Re: [PATCH 5/5] staging: fsl-dpaa2/eth: Remove Rx frame size check
> > 
> > On Mon, Jul 09, 2018 at 10:01:11AM -0500, Ioana Radulescu wrote:
> > > @@ -2385,6 +2365,12 @@ static int netdev_init(struct net_device
> > *net_dev)
> > >
> > >  	/* Set MTU upper limit; lower limit is 68B (default value) */
> > >  	net_dev->max_mtu = DPAA2_ETH_MAX_MTU;
> > > +	err = dpni_set_max_frame_length(priv->mc_io, 0, priv->mc_token,
> > > +					(u16)DPAA2_ETH_MFL);
> > 
> > The cast was there in the original code so this is not a comment on this
> > particular patch (which seems fine) but there is no need to cast.
> > 
> > Generally it's best to avoid unnecessary casts.  As a human reader, I
> > find the cast confusing.  It indicates that DPAA2_ETH_MFL somehow
> > requires special handling.  Perhaps it's negative or we are trying to
> > truncate away the high bits.  But neither of those things really make
> > sense.
> > 
> > From a static analysis perspective if DPAA2_ETH_MFL doesn't fit nicely
> > then we would want to generate a warning.  But the cast explicitly
> > disables the check.
> 
> I really don't remember why the cast was there in the first place.
> It doesn't look like it's needed anymore, DPAA2_ETH_MFL has a
> positive value (around 10K) that fits just fine inside a u16.
> 
> I see Greg already applied the patch, so I'll send a separate one to
> remove the cast.

Yeah.  I wasn't saying redo the patch.  That was there in the original
and it's not like it's a bug or anything.

regards,
dan carpenter


      reply	other threads:[~2018-07-10 16:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-09 15:01 [PATCH 0/5] staging: fsl-dpaa2/eth: Cleanup and minor fixes Ioana Radulescu
2018-07-09 15:01 ` [PATCH 1/5] staging: fsl-dpaa2/eth: Fix DMA mapping direction Ioana Radulescu
2018-07-09 15:01 ` [PATCH 2/5] staging: fsl-dpaa2/eth: Remove obsolete reference Ioana Radulescu
2018-07-09 15:01 ` [PATCH 3/5] staging: fsl-dpaa2/eth: Remove pointless instruction Ioana Radulescu
2018-07-09 15:01 ` [PATCH 4/5] staging: fsl-dpaa2/eth: MTU cleanup Ioana Radulescu
2018-07-09 15:01 ` [PATCH 5/5] staging: fsl-dpaa2/eth: Remove Rx frame size check Ioana Radulescu
2018-07-09 19:28   ` Dan Carpenter
2018-07-10 15:55     ` Ioana Ciocoi Radulescu
2018-07-10 16:45       ` Dan Carpenter [this message]

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=20180710164541.ywfwlw5b7ecufuqa@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ioana.ciornei@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ruxandra.radulescu@nxp.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

all inboxes | Powered by JetHome®