All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Kani, Toshimitsu" <toshi.kani@hpe.com>
To: "dave.jiang@intel.com" <dave.jiang@intel.com>
Cc: "linux-nvdimm@lists.01.org" <linux-nvdimm@lists.01.org>
Subject: Re: [PATCH v2] ndctl: add clear error support for ndctl
Date: Mon, 1 May 2017 21:12:18 +0000	[thread overview]
Message-ID: <1493673137.30303.26.camel@hpe.com> (raw)
In-Reply-To: <20170501210241.GA11607@djiang5-desk3.ch.intel.com>

On Mon, 2017-05-01 at 14:02 -0700, Jiang, Dave wrote:
> On Mon, May 01, 2017 at 01:25:45PM -0700, Kani, Toshimitsu wrote:
> > On Thu, 2017-04-27 at 15:38 -0700, Dave Jiang wrote:
 :
> 
> Toshi,
> Can you please try this and see if that fixes the issue? Thanks!
> 
> diff --git a/ndctl/lib/libndctl.c b/ndctl/lib/libndctl.c
> index 7399729..44fc2f3 100644
> --- a/ndctl/lib/libndctl.c
> +++ b/ndctl/lib/libndctl.c
> @@ -1882,10 +1882,8 @@ static int regions_badblocks_init(struct
> ndctl_region *region)
>  		region->badblocks = NULL;
>  	}
>  
> -	if (asprintf(&bb_path,
> "/sys/devices/platform/%s/%s/%s/badblocks",
> -				ndctl_bus_get_provider(bus),
> -				ndctl_bus_get_devname(bus),
> -				ndctl_region_get_devname(region)) <
> 0) {
> +	if (asprintf(&bb_path, "%s/badblocks",
> +				region->region_path) < 0) {
>  		rc = -errno;
>  		err(ctx, "region badblocks path allocation
> failure\n");
>  		return rc;

Yes, this fixes the issue. :-)  Noticed that there is a warning.

  CC       libndctl.lo
libndctl.c: In function 'regions_badblocks_init':
libndctl.c:1875:20: warning: unused variable 'bus' [-Wunused-variable]
  struct ndctl_bus *bus = ndctl_region_get_bus(region);
                    ^
Thanks!!
-Toshi
_______________________________________________
Linux-nvdimm mailing list
Linux-nvdimm@lists.01.org
https://lists.01.org/mailman/listinfo/linux-nvdimm

  reply	other threads:[~2017-05-01 21:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-27 22:38 [PATCH v2] ndctl: add clear error support for ndctl Dave Jiang
2017-05-01 20:25 ` Kani, Toshimitsu
2017-05-01 21:02   ` Jiang, Dave
2017-05-01 21:12     ` Kani, Toshimitsu [this message]
2017-05-01 21:20       ` Dave Jiang

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=1493673137.30303.26.camel@hpe.com \
    --to=toshi.kani@hpe.com \
    --cc=dave.jiang@intel.com \
    --cc=linux-nvdimm@lists.01.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.