[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <690e1d0428207_301e35100f6@iweiny-mobl.notmuch>
Date: Fri, 7 Nov 2025 10:23:32 -0600
From: Ira Weiny <ira.weiny@...el.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Ira Weiny
<ira.weiny@...el.com>
CC: <nvdimm@...ts.linux.dev>, <linux-kernel@...r.kernel.org>, Dan Williams
<dan.j.williams@...el.com>, Vishal Verma <vishal.l.verma@...el.com>, "Dave
Jiang" <dave.jiang@...el.com>
Subject: Re: [PATCH v1 1/1] libnvdimm/labels: Get rid of redundant 'else'
Andy Shevchenko wrote:
> On Thu, Nov 06, 2025 at 06:46:48PM -0600, Ira Weiny wrote:
> > Andy Shevchenko wrote:
[snip]
> > > - else if (claim_class == NVDIMM_CCLASS_UNKNOWN) {
> > > - /*
> > > - * If we're modifying a namespace for which we don't
> > > - * know the claim_class, don't touch the existing guid.
> > > - */
> > > - return target;
> > > - } else
> > > + if (claim_class == NVDIMM_CCLASS_NONE)
> > > return &guid_null;
> > > +
> > > + /*
> > > + * If we're modifying a namespace for which we don't
> > > + * know the claim_class, don't touch the existing guid.
> > > + */
> > > + return target;
> >
> > This is not an equivalent change.
>
> It's (okau. almost. later on that). The parameter to the function is enum and
> the listed values of the enum is all there.
True.
> The problematic part can be if
> somebody supplies an arbitrary value here. Yes, in such a case it will change
> behaviour and I think it is correct in my case as UNKNOWN is unknown, and NONE
> is actually well known UUID.
Yea putting this in the commit message but more importantly knowing you
looked through the logic of how claim class is used is what I'm looking
for.
Thanks,
Ira
[snip]
Powered by blists - more mailing lists