lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+db+r5nCFmk1Jugx+afED-EZdzS2w9HOa7-jrPRAo2mDzm9-w@mail.gmail.com>
Date: Wed, 13 Aug 2025 18:37:30 +0530
From: Darshan Rathod <darshanrathod475@...il.com>
To: Jonathan Cameron <Jonathan.Cameron@...wei.com>
Cc: dave@...olabs.net, dave.jiang@...el.com, alison.schofield@...el.com, 
	vishal.l.verma@...el.com, ira.weiny@...el.com, dan.j.williams@...el.com, 
	shiju.jose@...wei.com, ming.li@...omail.com, peterz@...radead.org, 
	linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cxl: remove assignment from if condition in cxl_mem_get_poison

Hi Jonathan,

Thanks for pointing that out.
I’ll hold off on this change and wait for the outcome of Alison’s
patch discussion before proceeding further.

Regards,
Darshan

On Wed, Aug 13, 2025 at 6:22 PM Jonathan Cameron
<Jonathan.Cameron@...wei.com> wrote:
>
> On Wed, 13 Aug 2025 17:25:54 +0530
> darshanrathod475@...il.com wrote:
>
> > From: Darshan Rathod <darshanrathod475@...il.com>
> >
> > Refactor cxl_mem_get_poison() to assign the return value of
> > ACQUIRE_ERR() before the conditional check, instead of performing the
> > assignment inside the if condition. This resolves a checkpatch.pl
> > warning ("do not use assignment in if condition") and improves
> > readability.
> >
> > Signed-off-by: Darshan Rathod <darshanrathod475@...il.com>
> See:
> https://lore.kernel.org/all/20250813003821.2891532-1-alison.schofield@intel.com/
>
> Which stops checkpatch complaining about this.
> Let's see where that discussion ends up before considering 'fixing' this.
>
> Jonathan
>
> > ---
> >  drivers/cxl/core/mbox.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/cxl/core/mbox.c b/drivers/cxl/core/mbox.c
> > index fa6dd0c94656..9c5066631896 100644
> > --- a/drivers/cxl/core/mbox.c
> > +++ b/drivers/cxl/core/mbox.c
> > @@ -1426,7 +1426,9 @@ int cxl_mem_get_poison(struct cxl_memdev *cxlmd, u64 offset, u64 len,
> >       int rc;
> >
> >       ACQUIRE(mutex_intr, lock)(&mds->poison.mutex);
> > -     if ((rc = ACQUIRE_ERR(mutex_intr, &lock)))
> > +
> > +     rc = ACQUIRE_ERR(mutex_intr, &lock);
> > +     if (rc)
> >               return rc;
> >
> >       po = mds->poison.list_out;
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ