Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1200114ybx; Thu, 31 Oct 2019 07:08:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqzAZw9u9zhDBtaX2oiKLLsV4JwEb5p1hrMER+yD1CisIgrSast8H8QJf1mn19slPwvsl82q X-Received: by 2002:a05:6402:19ae:: with SMTP id o14mr5069485edz.241.1572530939038; Thu, 31 Oct 2019 07:08:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572530939; cv=none; d=google.com; s=arc-20160816; b=QSxiSsZkWxg08YEjAlLK/H0kE7Vo2ch5253E8FdneRMYXVuNhJcyqVvnYb7GFPcsT0 T7eAz9TbFP4QPbumHZ498g6HCHQyDEJezvNeoYbMEyVNfcTjLyc+tt7AjhyWT6JMA6mV t67lY50T5IScSf88NL7iScNjl44SptHiL8d5CWsp6SXmTD1g+DbSuC36ol2Xmb3aKbA+ RQYdJNvHrKH5wCNNKPFOiZb6A6rYX18mGdYug1FZ4acw8HegOu2/gLBrXpCv7+Fd+IM/ IV19yEM7V6Dj3J+WltsVoOnI3wtgEpWtQr0MQKaIqn/3YcIMUaE4HAqXfj/gVHY4Ny25 l6UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=8g/fCqmTpfKLTY3+g19TSl1xtmw42oOlQtbZEptQxXY=; b=bNZgDwDRSgbjcYTnFbj15Ida5uoN+Etul3zFs0f15MFxkl+FJppNiQ1Y9YUQgLHrfM QPRm9gluvIEyPr6In627lxuBHaf2t2C2md7nfXMergRcKj3DjQqtPEI09yzP5700Ygn4 KLelLAdqnUiVLaKou3/CH2VUQgiLSYykaOcuNdJ7Rd+savasnTvjAaaix9v1rrfLuOdX kvJ3J9kMvkKiID2WTFDr871JgQA1IpqB1yc4nSUCRtlLC1tgTEzA9c7AtkD0VrMviCCn dzk2MFemJlHjIpU0h83X7XxgIZJfvm31I2uaDxfYNcNvZDtYGXCFHDbV3fVWkGCDUI7p aC6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Ojd9BDEa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4si4668722edj.263.2019.10.31.07.08.35; Thu, 31 Oct 2019 07:08:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=Ojd9BDEa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727716AbfJaOFj (ORCPT + 99 others); Thu, 31 Oct 2019 10:05:39 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:42758 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726642AbfJaOFi (ORCPT ); Thu, 31 Oct 2019 10:05:38 -0400 Received: by mail-qk1-f195.google.com with SMTP id m4so7092597qke.9 for ; Thu, 31 Oct 2019 07:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=from:to:cc:subject:date:message-id; bh=8g/fCqmTpfKLTY3+g19TSl1xtmw42oOlQtbZEptQxXY=; b=Ojd9BDEap9xE3g4HQnpHAdCyMWxWnAfFSiVEhn/xryjjQTXRroD9B72k6zI6oz35XG nvS5bWyOWkEYu07cHE+RaZOHJVd4szHa1v/b6LaXkmuY/8NsKYXaw1kEXNFKj1nhtLvQ 8L7v8iwSmFNlH6DHcWDuDDOC9SF90c1r3IkwhiIf6FJKmmACUcBhikG68rM6l7xNAbcO fSoDlE1vBp64Dp9vcPD6egrrMQYRWKXEenVF6lR4v8/3if8Vjkqj87Q4AqQ8tAD4CcRH YnnJnZjMShZjIldORX3KpAvCbb4QetumevJo4jxpSt4cFDxybJBcaQNoVvhRRkyPizDt r3eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8g/fCqmTpfKLTY3+g19TSl1xtmw42oOlQtbZEptQxXY=; b=i+mZXHxcSyRPJWsWYl6ZxxH76Yi8x4ooLkRoB2pFH66oGsOErfhwjSqW1oL891vScm Kx2BqBVQ4vdZN04Z+eC/ynFRXvAtDBi5tJzkj8HdMYCtWxkEOLgsnK40CbsKGAUryMKb qyQzV+nl5ABde68tknlrxF6Toes3lYTyejtNfxTBJ9R2/CcfMrwGY7EpnXNX6NCK1V3I Dr2cHOPVyrDkUiavfHFUzfXc4p5vKb/1RhHpBG9Us3zdf+myDfUgKYw/jNpdWPLRndtQ qUvlpJNYhuJagW56+bXWZlxlLQBfTY7BO3pzPxA6bHWgmB4WBDfMvaysrDKRDCxKyIm6 py9w== X-Gm-Message-State: APjAAAVBZ2PgisjucasihYsZZqNGX0JJ01/LKltB71omuFqvIWpNyKy5 UPudNPd3MyLNat23K28bLFXegQ== X-Received: by 2002:ae9:e714:: with SMTP id m20mr5276736qka.280.1572530736235; Thu, 31 Oct 2019 07:05:36 -0700 (PDT) Received: from qcai.nay.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id y33sm3167025qta.18.2019.10.31.07.05.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Oct 2019 07:05:35 -0700 (PDT) From: Qian Cai To: dan.j.williams@intel.com Cc: vishal.l.verma@intel.com, dave.jiang@intel.com, keith.busch@intel.com, ira.weiny@intel.com, linux-nvdimm@lists.01.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [PATCH v3] nvdimm/btt: fix variable 'rc' set but not used Date: Thu, 31 Oct 2019 10:05:19 -0400 Message-Id: <1572530719-32161-1-git-send-email-cai@lca.pw> X-Mailer: git-send-email 1.8.3.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- v3: remove the unused "rc" per Vishal. v2: include the block address that is returning an error per Dan. drivers/nvdimm/btt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c index 3e9f45aec8d1..5129543a0473 100644 --- a/drivers/nvdimm/btt.c +++ b/drivers/nvdimm/btt.c @@ -1261,11 +1261,11 @@ static int btt_read_pg(struct btt *btt, struct bio_integrity_payload *bip, ret = btt_data_read(arena, page, off, postmap, cur_len); if (ret) { - int rc; - /* Media error - set the e_flag */ - rc = btt_map_write(arena, premap, postmap, 0, 1, - NVDIMM_IO_ATOMIC); + if (btt_map_write(arena, premap, postmap, 0, 1, NVDIMM_IO_ATOMIC)) + dev_warn_ratelimited(to_dev(arena), + "Error persistently tracking bad blocks at %#x\n", + premap); goto out_rtt; } -- 1.8.3.1