mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Sumitra Sharma <sumitraartsy@gmail.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 18:06:28 +0300	[thread overview]
Message-ID: <bff9626d-095c-4bed-ae8b-2be50610aee7@kili.mountain> (raw)
In-Reply-To: <20230405150627.GA227254@sumitra.com>

On Wed, Apr 05, 2023 at 08:06:27AM -0700, Sumitra Sharma wrote:
> +	err = err || qlge_fill_seg_(fmsg, &dump->core_regs_seg_hdr, dump->mpi_core_regs);

I have not seen anyone do this before.  I sometimes see people do:

	err |= frob1();
	err |= frob2();
	err |= frob3();

I don't like this very much, but it basically works-ish...  I don't like
that it ORs all the errors together and that it continues after it has
errors.

Another idea would be to do:

	err = err ?: frob1();
	err = err ?: frob2();
	err = err ?: frob3();

BPF and networking have a couple place which do it this way so maybe
it's going to become trendy.

regards,
dan carpenter


      parent reply	other threads:[~2023-04-06 15:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 15:06 Sumitra Sharma
2023-04-05 16:21 ` Simon Horman
2023-04-06 14:46   ` Sumitra Sharma
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 [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=bff9626d-095c-4bed-ae8b-2be50610aee7@kili.mountain \
    --to=error27@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=sumitraartsy@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

all inboxes | Powered by JetHome®