Re: [PATCH v1 1/1] nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid()

2022-07-14 Thread Dan Williams
Andy Shevchenko wrote:
> On Thu, Jul 14, 2022 at 11:24:05AM -0700, Dan Williams wrote:
> > Andy Shevchenko wrote:
> > > Refactor nd_dev_to_uuid() in order to make code shorter and cleaner
> > > by joining conditions and hence returning uuid_null only once.
> > 
> > Apologies for the delay, applied for v5.20.
> 
> No problem and thanks!
> 
> P.S. One patch out of three is a fix, would be nice to have it in v5.19
> release.

Found it, applied it.



Re: [PATCH v1 1/1] nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid()

2022-07-14 Thread Andy Shevchenko
On Thu, Jul 14, 2022 at 11:24:05AM -0700, Dan Williams wrote:
> Andy Shevchenko wrote:
> > Refactor nd_dev_to_uuid() in order to make code shorter and cleaner
> > by joining conditions and hence returning uuid_null only once.
> 
> Apologies for the delay, applied for v5.20.

No problem and thanks!

P.S. One patch out of three is a fix, would be nice to have it in v5.19
release.

-- 
With Best Regards,
Andy Shevchenko





RE: [PATCH v1 1/1] nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid()

2022-07-14 Thread Dan Williams
Andy Shevchenko wrote:
> Refactor nd_dev_to_uuid() in order to make code shorter and cleaner
> by joining conditions and hence returning uuid_null only once.

Apologies for the delay, applied for v5.20.



[PATCH v1 1/1] nvdimm/namespace: return uuid_null only once in nd_dev_to_uuid()

2022-06-07 Thread Andy Shevchenko
Refactor nd_dev_to_uuid() in order to make code shorter and cleaner
by joining conditions and hence returning uuid_null only once.

Signed-off-by: Andy Shevchenko 
---
 drivers/nvdimm/namespace_devs.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/nvdimm/namespace_devs.c b/drivers/nvdimm/namespace_devs.c
index bf4f5c09d9b1..3dae17c90e8c 100644
--- a/drivers/nvdimm/namespace_devs.c
+++ b/drivers/nvdimm/namespace_devs.c
@@ -170,15 +170,12 @@ EXPORT_SYMBOL(nvdimm_namespace_disk_name);
 
 const uuid_t *nd_dev_to_uuid(struct device *dev)
 {
-   if (!dev)
-   return _null;
-
-   if (is_namespace_pmem(dev)) {
+   if (dev && is_namespace_pmem(dev)) {
struct nd_namespace_pmem *nspm = to_nd_namespace_pmem(dev);
 
return nspm->uuid;
-   } else
-   return _null;
+   }
+   return _null;
 }
 EXPORT_SYMBOL(nd_dev_to_uuid);
 
-- 
2.35.1