From: Sumitra Sharma <sumitraartsy@gmail.com>
To: Simon Horman <simon.horman@corigine.com>
Cc: Manish Chopra <manishc@marvell.com>,
GR-Linux-NIC-Dev@marvell.com, Coiby Xu <coiby.xu@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
netdev@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: qlge: Remove macro FILL_SEG
Date: Thu, 6 Apr 2023 07:46:44 -0700 [thread overview]
Message-ID: <20230406144644.GB231658@sumitra.com> (raw)
In-Reply-To: <ZC2gJdUA6zGOjX4P@corigine.com>
On Wed, Apr 05, 2023 at 06:21:57PM +0200, Simon Horman wrote:
> On Wed, Apr 05, 2023 at 08:06:27AM -0700, Sumitra Sharma wrote:
> > Remove macro FILL_SEG to fix the checkpatch warning:
> >
> > WARNING: Macros with flow control statements should be avoided
> >
> > Macros with flow control statements must be avoided as they
> > break the flow of the calling function and make it harder to
> > test the code.
> >
> > Replace all FILL_SEG() macro calls with:
> >
> > err = err || qlge_fill_seg_(...);
>
> Perhaps I'm missing the point here.
> But won't this lead to err always either being true or false (1 or 0).
> Rather than the current arrangement where err can be
> either 0 or a negative error value, such as -EINVAL.
>
Hi Simon
Thank you for the point you mentioned which I missed while working on this
patch.
However, after thinking on it, I am still not able to get any fix to this
except that we can possibly implement the Ira's solution here which is:
https://lore.kernel.org/outreachy/64154d438f0c8_28ae5229421@iweiny-mobl.notmuch/
Although we have to then deal with 40 lines of ifs.
Regards
Sumitra
> ...
next prev parent reply other threads:[~2023-04-06 14:46 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 15:06 [PATCH] staging: qlge: Remove macro FILL_SEG Sumitra Sharma
2023-04-05 16:21 ` Simon Horman
2023-04-06 14:46 ` Sumitra Sharma [this message]
2023-04-06 14:57 ` Greg Kroah-Hartman
2023-04-06 15:28 ` Sumitra Sharma
2023-04-06 16:33 ` Greg Kroah-Hartman
2023-04-08 17:57 ` Sumitra Sharma
2023-04-06 15:06 ` Dan Carpenter
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=20230406144644.GB231658@sumitra.com \
--to=sumitraartsy@gmail.com \
--cc=GR-Linux-NIC-Dev@marvell.com \
--cc=coiby.xu@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=manishc@marvell.com \
--cc=netdev@vger.kernel.org \
--cc=simon.horman@corigine.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 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.