public inbox for nvdimm@lists.linux.dev
 help / color / mirror / Atom feed
From: Jonathan Cameron <jonathan.cameron@huawei.com>
To: Dave Jiang <dave.jiang@intel.com>
Cc: <nvdimm@lists.linux.dev>, <ira.weiny@intel.com>,
	<vishal.l.verma@intel.com>, <dan.j.williams@intel.com>,
	<s.neeraj@samsung.com>
Subject: Re: [PATCH v2 1/2] nvdimm: Introduce guard() for nvdimm_bus_lock
Date: Mon, 29 Sep 2025 10:05:01 +0100	[thread overview]
Message-ID: <20250929100501.00004bc6@huawei.com> (raw)
In-Reply-To: <20250923174013.3319780-2-dave.jiang@intel.com>

On Tue, 23 Sep 2025 10:40:12 -0700
Dave Jiang <dave.jiang@intel.com> wrote:

> Converting nvdimm_bus_lock/unlock to guard() to clean up usage
> of gotos for error handling and avoid future mistakes of missed
> unlock on error paths.
> 
> Link: https://lore.kernel.org/linux-cxl/20250917163623.00004a3c@huawei.com/
> Suggested-by: Jonathan Cameron <jonathan.cameron@huawei.com>
> Signed-off-by: Dave Jiang <dave.jiang@intel.com>
Nice.

I still wince a little the places where sharing a dev_dbg()
leads to more complex code flow that we'd otherwise have, but that
is probably not worth the effort of cleaning up further.

Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>

> ---
> v2:
> - Moved cleanup of __nd_ioctl() cleanup to a different patch. (Dan)
> - Various minor fixes and cleanups. (Jonathan)
> ---
>  drivers/nvdimm/badrange.c       |   3 +-
>  drivers/nvdimm/btt_devs.c       |  24 +++----
>  drivers/nvdimm/bus.c            |   6 +-
>  drivers/nvdimm/claim.c          |   7 +-
>  drivers/nvdimm/core.c           |  17 +++--
>  drivers/nvdimm/dax_devs.c       |  12 ++--
>  drivers/nvdimm/dimm.c           |   5 +-
>  drivers/nvdimm/dimm_devs.c      |  48 +++++--------
>  drivers/nvdimm/namespace_devs.c | 117 +++++++++++++++----------------
>  drivers/nvdimm/nd.h             |   3 +
>  drivers/nvdimm/pfn_devs.c       |  61 +++++++----------
>  drivers/nvdimm/region.c         |  14 ++--
>  drivers/nvdimm/region_devs.c    | 118 ++++++++++++++------------------
>  drivers/nvdimm/security.c       |  10 +--
>  14 files changed, 194 insertions(+), 251 deletions(-)


  parent reply	other threads:[~2025-09-29  9:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-23 17:40 [PATCH v2 0/2] nvdimm: Introduce guard() for nvdimm_bus_lock and clean up usages Dave Jiang
2025-09-23 17:40 ` [PATCH v2 1/2] nvdimm: Introduce guard() for nvdimm_bus_lock Dave Jiang
2025-09-23 18:32   ` dan.j.williams
2025-09-29  9:05   ` Jonathan Cameron [this message]
2025-09-23 17:40 ` [PATCH v2 2/2] nvdimm: Clean up __nd_ioctl() and remove gotos Dave Jiang
2025-09-23 18:32   ` dan.j.williams
2025-09-29  9:06   ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250929100501.00004bc6@huawei.com \
    --to=jonathan.cameron@huawei.com \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=ira.weiny@intel.com \
    --cc=nvdimm@lists.linux.dev \
    --cc=s.neeraj@samsung.com \
    --cc=vishal.l.verma@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox