Re: [PATCH] staging: qlge: Remove macro FILL_SEG

From: Dan Carpenter
Date: Thu Apr 06 2023 - 11:06:45 EST


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