[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1931444790.41759726382136.JavaMail.epsvc@epcpadp2new>
Date: Mon, 29 Sep 2025 18:54:06 +0530
From: Neeraj Kumar <s.neeraj@...sung.com>
To: Dave Jiang <dave.jiang@...el.com>
Cc: linux-cxl@...r.kernel.org, nvdimm@...ts.linux.dev,
linux-kernel@...r.kernel.org, gost.dev@...sung.com,
a.manzanares@...sung.com, vishak.g@...sung.com, neeraj.kernel@...il.com,
cpgs@...sung.com
Subject: Re: [PATCH V3 06/20] nvdimm/region_label: Add region label update
support
On 22/09/25 04:11PM, Dave Jiang wrote:
>> +static inline bool is_region_label(struct nvdimm_drvdata *ndd,
>> + union nd_lsa_label *nd_label)
>> +{
>> + uuid_t region_type, *ns_type;
>> +
>> + if (!ndd->cxl || !nd_label)
>> + return false;
>> +
>> + uuid_parse(CXL_REGION_UUID, ®ion_type);
>> + ns_type = (uuid_t *) nd_label->ns_label.cxl.type;
>
>So in addition to Jonathan's comments, I think we should consider utilizing the common field (UUID) of all the labels. i.e. if you are to use a union, you can also include 'uuid_t label_type' as a member. Perhaps this function can just pass in a UUID rather than a label struct. And we can probably skip passing in 'ndd' and not bother with ndd->cxl check. This function can just rely on checking the UUID and see if it's the expected region label UUID. Just thinking of the places we can maybe avoid doing casting if possible.
>
>DJ
Thanks Dave for detailed suggestion. I will handle this in next
patch-set
Regards,
Neeraj
Powered by blists - more mailing lists