All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Torgue <alexandre.torgue@st.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: stmmac: add descriptors function for GMAC 4.xx
Date: Tue, 05 Apr 2016 09:24:06 +0000	[thread overview]
Message-ID: <57038436.8060004@st.com> (raw)
In-Reply-To: <20160404204609.GA9128@mwanda>

Hello Dan,

On 04/04/2016 10:46 PM, Dan Carpenter wrote:
> Hello Alexandre TORGUE,
>
> The patch 753a71090f33: "stmmac: add descriptors function for GMAC
> 4.xx" from Apr 1, 2016, leads to the following static checker warning:
>
> 	drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c:261 dwmac4_rd_prepare_tx_desc()
> 	warn: odd binop '0x4000 & 0x3fff'
>
> drivers/net/ethernet/stmicro/stmmac/dwmac4_descs.c
>     251  static void dwmac4_rd_prepare_tx_desc(struct dma_desc *p, int is_fs, int len,
>     252                                        bool csum_flag, int mode, bool tx_own,
>     253                                        bool ls)
>     254  {
>     255          unsigned int tdes3 = p->des3;
>     256
>     257          if (unlikely(len > BUF_SIZE_16KiB)) {
>     258                  p->des2 |= (((len - BUF_SIZE_16KiB) <<
>     259                               TDES2_BUFFER2_SIZE_MASK_SHIFT)
>     260                              & TDES2_BUFFER2_SIZE_MASK)
>     261                              | (BUF_SIZE_16KiB & TDES2_BUFFER1_SIZE_MASK);
>                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Should this be "len & TDES2_BUFFER1_SIZE_MASK" or are you rounding down
> the length deliberately?

It is a mistake. Could be "len & TDES2_BUFFER1_SIZE_MASK" or 
"(BUF_SIZE_16KiB - 1) & TDES2_BUFFER1_SIZE_MASK".
I will send a fix.

Thanks.

regards,

Alex

>
>     262          } else {
>     263                  p->des2 |= (len & TDES2_BUFFER1_SIZE_MASK);
>     264          }
>     265
>     266          if (is_fs)
>     267                  tdes3 |= TDES3_FIRST_DESCRIPTOR;
>     268          else
>     269                  tdes3 &= ~TDES3_FIRST_DESCRIPTOR;
>     270
>
> regards,
> dan carpenter
>



      reply	other threads:[~2016-04-05  9:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-04 20:46 stmmac: add descriptors function for GMAC 4.xx Dan Carpenter
2016-04-05  9:24 ` Alexandre Torgue [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=57038436.8060004@st.com \
    --to=alexandre.torgue@st.com \
    --cc=kernel-janitors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.