DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: Amit Prakash Shukla <amitprakashs@marvell.com>
Cc: dev@dpdk.org, Nithin Kumar Dabilpuram <ndabilpuram@marvell.com>,
	Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>,
	"dev@dpdk.org" <dev@dpdk.org>,
	Jerin Jacob Kollanukkaran <jerinj@marvell.com>
Subject: Re: [EXT] Re: [PATCH] lib: fix coverity for unused variable
Date: Wed, 28 Jun 2023 00:17:29 +0200	[thread overview]
Message-ID: <3032049.kC03pvyZki@thomas> (raw)
In-Reply-To: <3192443.l52yBJDM9G@thomas>

27/06/2023 23:52, Thomas Monjalon:
> 27/06/2023 18:05, Amit Prakash Shukla:
> > From: Thomas Monjalon <thomas@monjalon.net>
> > > 16/06/2023 13:06, Amit Prakash Shukla:
> > > > Removed variable "rc" that stored a return value from a function
> > > > rte_lpm6_lookup_bulk_func.
> > > 
> > > You are not really removing the variable, right?
> > > It looks you just stop storing the return of this function.
> > > Whouldn't it better to check the return code?
> > 
> > Yes, I am just not storing the return value. The reason to not
> > store return code is to avoid return code check in datapath.
> > rte_lpm6_lookup_bulk_func will return error only if
> >  lpm6, ip_batch, next_hop are NULL. In function ip6_lookup_node_process_scalar
> > these variables will never be NULL.
> 
> I will update the commit message accordingly.

Applied with updated explanation:

    node: remove useless return code assignment
    
    No need to store the return code of rte_lpm6_lookup_bulk_func()
    as it returns error only if parameters are NULL.
    In the function ip6_lookup_node_process_scalar(),
    these variables will never be NULL.
    
    Not checking the return code will avoid check in datapath.
    Storing of the return code is useless and removed.




      reply	other threads:[~2023-06-27 22:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-16 11:06 Amit Prakash Shukla
2023-06-27 13:45 ` Thomas Monjalon
2023-06-27 16:05   ` [EXT] " Amit Prakash Shukla
2023-06-27 21:52     ` Thomas Monjalon
2023-06-27 22:17       ` Thomas Monjalon [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=3032049.kC03pvyZki@thomas \
    --to=thomas@monjalon.net \
    --cc=amitprakashs@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=pbhagavatula@marvell.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).