linux-nvdimm.lists.01.org archive mirror
 help / color / mirror / Atom feed
From: Dan Williams <dan.j.williams@intel.com>
To: Qian Cai <cai@lca.pw>
Cc: linux-nvdimm <linux-nvdimm@lists.01.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] nvdimm/btt: fix variable 'rc' set but not used
Date: Wed, 30 Oct 2019 13:25:47 -0700	[thread overview]
Message-ID: <CAPcyv4jvoo2Ez5hMivt+-B3-9giX3v6VZ0xZWLBQzL=7spVnrg@mail.gmail.com> (raw)
In-Reply-To: <1572462939-18201-1-git-send-email-cai@lca.pw>

On Wed, Oct 30, 2019 at 12:16 PM Qian Cai <cai@lca.pw> wrote:
>
> drivers/nvdimm/btt.c: In function 'btt_read_pg':
> drivers/nvdimm/btt.c:1264:8: warning: variable 'rc' set but not used
> [-Wunused-but-set-variable]
>     int rc;
>         ^~
>
> Add a ratelimited message in case a storm of errors is encountered.
>
> Fixes: d9b83c756953 ("libnvdimm, btt: rework error clearing")
> Signed-off-by: Qian Cai <cai@lca.pw>
> ---
>  drivers/nvdimm/btt.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c
> index 3e9f45aec8d1..59852f7e2d60 100644
> --- a/drivers/nvdimm/btt.c
> +++ b/drivers/nvdimm/btt.c
> @@ -1266,6 +1266,11 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip,
>                         /* Media error - set the e_flag */
>                         rc = btt_map_write(arena, premap, postmap, 0, 1,
>                                 NVDIMM_IO_ATOMIC);
> +
> +                       if (rc)
> +                               dev_warn_ratelimited(to_dev(arena),
> +                                       "Error persistently tracking bad blocks\n");

If the driver is going to warn about bad blocks it should at least
include the block address that is returning an error.
_______________________________________________
Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org
To unsubscribe send an email to linux-nvdimm-leave@lists.01.org

      reply	other threads:[~2019-10-30 20:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-30 19:15 [PATCH] nvdimm/btt: fix variable 'rc' set but not used Qian Cai
2019-10-30 20:25 ` Dan Williams [this message]

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='CAPcyv4jvoo2Ez5hMivt+-B3-9giX3v6VZ0xZWLBQzL=7spVnrg@mail.gmail.com' \
    --to=dan.j.williams@intel.com \
    --cc=cai@lca.pw \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).