netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Norris <briannorris@chromium.org>
To: Kalle Valo <kvalo@codeaurora.org>
Cc: Len Baker <len.baker@gmx.com>,
	Yan-Hsuan Chuang <tony0620emma@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>, Pkshih <pkshih@realtek.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	"<netdev@vger.kernel.org>" <netdev@vger.kernel.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] rtw88: Remove unnecessary check code
Date: Tue, 27 Jul 2021 11:16:11 -0700	[thread overview]
Message-ID: <CA+ASDXNm_aKAJcJVCx45VqAXTgXjfOju7xZPa_3MAvBzn2r7_w@mail.gmail.com> (raw)
In-Reply-To: <87eebkgt8t.fsf@codeaurora.org>

On Mon, Jul 26, 2021 at 11:34 PM Kalle Valo <kvalo@codeaurora.org> wrote:
>
> Len Baker <len.baker@gmx.com> writes:
>
> > The rtw_pci_init_rx_ring function is only ever called with a fixed
> > constant or RTK_MAX_RX_DESC_NUM for the "len" argument. Since this
> > constant is defined as 512, the "if (len > TRX_BD_IDX_MASK)" check
> > can never happen (TRX_BD_IDX_MASK is defined as GENMASK(11, 0) or in
> > other words as 4095).
> >
> > So, remove this check.
> >
> > Signed-off-by: Len Baker <len.baker@gmx.com>
>
> Are everyone ok with this version?

I suppose? I'm not really sure where the line should be drawn on
excessive bounds checking, false warnings from otherwise quite useful
static analysis tools, etc., but I suppose it doesn't make much sense
to add additional excess bounds checks just to quiet Coverity.

It might be nice to include the true motivation in the patch
description though, which is: "this also quiets a false warning from
Coverity".

Anyway, feel free to pick one of these:

Shrug-by: Brian Norris <briannorris@chromium.org>

or

Reviewed-by: Brian Norris <briannorris@chromium.org>

  reply	other threads:[~2021-07-27 18:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-18  8:42 [PATCH v3] rtw88: Remove unnecessary check code Len Baker
2021-07-27  6:34 ` Kalle Valo
2021-07-27 18:16   ` Brian Norris [this message]
2021-07-28 17:50     ` Len Baker

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=CA+ASDXNm_aKAJcJVCx45VqAXTgXjfOju7xZPa_3MAvBzn2r7_w@mail.gmail.com \
    --to=briannorris@chromium.org \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kuba@kernel.org \
    --cc=kvalo@codeaurora.org \
    --cc=len.baker@gmx.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pkshih@realtek.com \
    --cc=tony0620emma@gmail.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).