DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Michał Krawczyk" <mk@semihalf.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: Marcin Wojtas <mw@semihalf.com>,
	Shai Brandes <shaibran@amazon.com>,
	 Evgeny Schemeilin <evgenys@amazon.com>,
	Igor Chauskin <igorch@amazon.com>, dev <dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] net/ena: remove useless address check
Date: Mon, 11 Oct 2021 08:49:33 +0200	[thread overview]
Message-ID: <CAJMMOfONUE19e_0-TcEAMx63qLe=FpM7xjCTO_i7EF_vagMaMw@mail.gmail.com> (raw)
In-Reply-To: <20211004172702.3461360-1-ferruh.yigit@intel.com>

pon., 4 paź 2021 o 19:27 Ferruh Yigit <ferruh.yigit@intel.com> napisał(a):
>
> Reported by "gcc (GCC) 12.0.0 20211003 (experimental)":
>
> ./drivers/net/ena/ena_rss.c: In function ‘ena_rss_reta_query’:
> ./drivers/net/ena/ena_rss.c:140:66:
>         error: the comparison will always evaluate as ‘false’ for the
>         pointer operand in ‘reta_conf + 136’ must not be NULL
>         [-Werror=address]
>   140 |  (reta_size > RTE_RETA_GROUP_SIZE && ((reta_conf + 1) == NULL)))
>       |                                                       ^~
>
> Fixing it by removing useless check.
>
> Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Michal Krawczyk <mk@semihalf.com>

> ---
> Not clear about the intention of the check, removing it in this patch to
> trigger the discussion.

It looks like this condition was unneeded from the beginning and is in
general invalid and comes from some misunderstanding. I'm ok with
removing this as it was dead code anyway.

> ---
>  drivers/net/ena/ena_rss.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/ena/ena_rss.c b/drivers/net/ena/ena_rss.c
> index 88afe13da04d..152098410fa2 100644
> --- a/drivers/net/ena/ena_rss.c
> +++ b/drivers/net/ena/ena_rss.c
> @@ -136,8 +136,7 @@ int ena_rss_reta_query(struct rte_eth_dev *dev,
>         int reta_conf_idx;
>         int reta_idx;
>
> -       if (reta_size == 0 || reta_conf == NULL ||
> -           (reta_size > RTE_RETA_GROUP_SIZE && ((reta_conf + 1) == NULL)))
> +       if (reta_size == 0 || reta_conf == NULL)
>                 return -EINVAL;
>
>         if (!(dev->data->dev_conf.rxmode.offloads & DEV_RX_OFFLOAD_RSS_HASH)) {
> --
> 2.31.1
>

  reply	other threads:[~2021-10-11  6:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 17:27 Ferruh Yigit
2021-10-11  6:49 ` Michał Krawczyk [this message]
2021-10-11 15:49   ` Ferruh Yigit

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='CAJMMOfONUE19e_0-TcEAMx63qLe=FpM7xjCTO_i7EF_vagMaMw@mail.gmail.com' \
    --to=mk@semihalf.com \
    --cc=dev@dpdk.org \
    --cc=evgenys@amazon.com \
    --cc=ferruh.yigit@intel.com \
    --cc=igorch@amazon.com \
    --cc=mw@semihalf.com \
    --cc=shaibran@amazon.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).