Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1124064yba; Wed, 15 May 2019 16:28:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyY7bz/z8dHqqFoJfQPp+IyhY/lSlXVrpfQys9XRupU2nMEMf26Oh70M2PR7TN08H3ZRz05 X-Received: by 2002:a17:902:e785:: with SMTP id cp5mr27824894plb.167.1557962936432; Wed, 15 May 2019 16:28:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557962936; cv=none; d=google.com; s=arc-20160816; b=MB8clDfKKQusFKyw6SqOrcp2qHH3HoRejgFLJL6654yZgq/1AMLOa3AsnIM0sZr7HH ckE/Hh2Oau8dfdFrxPQbWM+rZVEJtTKQ4fAk2N3Z1TSLwkELcch0OtwHFRf+pWm+Uo1M w+tL/QP+1fGf/joUmBZOlj4tioVkOftB6tsaRUmjRLJJPA4WqUqkh4SGoHoIrHwNg/PO w9j1nCRrSMQMuO9ziVXAB7qY/L58nIlyslKlgTvNt1N9rdCsXGE0L+x0DPnzAUTrCWRw wF52J/WiyR+q5AfyO3w6+Iq9NZCNZH/LVA7Ae7GhYk1Dqis4mlCMWY6igZZQVmDXA+TE 1J+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=klWe1X2kwGWTqHnD0kZUJYyAWHWMIBILlhfu7UeUVVU=; b=fj5wlF53mPyQiyXcMZ+IV+4eoA1HB6bb7yVhmVyG0rG+UrNDxgMlRrnaYehY7qYmyY kinrqSiQAQnaTZTFSg5+ImdIJhu8TaSsTF6LeoWGQwff6S0AhSzObLwY65aAt1+xS6Fw 5n4QiA7we4cB9iUkMyeOZXwGab7KVkvdTBdJny1IvNbpepnxioaR7wfG5lNff69GeaLq 0BEf8GlkSvqKh16LN6L8r/xDG9CxQ0Kfj3SvExT7ldcKqVYFOcw00uDldj5/wbp6GmIf gTDorOAUad6tCy7uztRKo+07oU2fcAxIK+YWHaKg9J8fUbm6zyBdvwyI6DCF+U4rPYYd pjdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=TtbGAGWd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w14si2994922ply.226.2019.05.15.16.28.39; Wed, 15 May 2019 16:28:56 -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=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=TtbGAGWd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726462AbfEOX1a (ORCPT + 99 others); Wed, 15 May 2019 19:27:30 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:34037 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726363AbfEOXZ3 (ORCPT ); Wed, 15 May 2019 19:25:29 -0400 Received: by mail-ot1-f67.google.com with SMTP id l17so1726466otq.1 for ; Wed, 15 May 2019 16:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=klWe1X2kwGWTqHnD0kZUJYyAWHWMIBILlhfu7UeUVVU=; b=TtbGAGWdg/sFEvxvKLNEZ3rTz7M7jfaRfe9gkKZaWkcRY6wmWibUhniy4j6lMmowes k4ZkROyySNl28Ly0EaCwYr/DoQLXncEJMz04K6R1TSilBAWE5LGJc8AsxZS1firED+jR BGlWjEZACXditdDy5plTGSvMT+HiPDAmujo8v6hFs0xeAFhq+qeHMCfFJGGYgYIYdys+ KIVydwcyDbANs8aIX5IB35f+4IB3uZkBBggGc1aP2h+WC9lrQPgXB2T0LN9LXo4EGDI6 2il7zKY5TwInDXv+g52o6VMtQVQNFZ/ggEmKBDPef5GIGedriiglj5vbuzLNqEdHC7+0 IcFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=klWe1X2kwGWTqHnD0kZUJYyAWHWMIBILlhfu7UeUVVU=; b=G/p3YiLn+1DfMZsxtPPgEz/niAnsdJPnLTtExwcSFC7WxlA7raL1ybGLZb1pF2BxIE oVZKcEcFHbYSZ9/35cEoVlLpVwdgdRbqg0Pr+e1/QFVS+H2EmEbykE70W5w3MAKWrpcg 6M7BhXM2VdUjPlVlHRvxa8kALGKOpED74PC0dwgmmc/7d3ZjRDHQ0M7nno1/ykW0ah08 Orsx2vcoD+P4aOaVYzVkTu81Bf+6QTMRvxrNQ4rYdtQfmF7zErK2qVVgZDswY4up9WkN rh9gSrK8cGeQACZz3aDn5Dt8C8uZPR01ji4Y5ee24UN4U5oiqXnLodSUi6Xyoo5qb6Uv U7vA== X-Gm-Message-State: APjAAAVn4kp7RZQF+Jhr5R4pF+2ngwUH4YPM68hV1zwjaUKloAKHVQep HJ4rU3pzN1siqzle2oZ5Kn7PCE2kitGDzJti0CkZTQ== X-Received: by 2002:a9d:12f2:: with SMTP id g105mr11455354otg.116.1557962728184; Wed, 15 May 2019 16:25:28 -0700 (PDT) MIME-Version: 1.0 References: <20190514150735.39625-1-cai@lca.pw> In-Reply-To: <20190514150735.39625-1-cai@lca.pw> From: Dan Williams Date: Wed, 15 May 2019 16:25:16 -0700 Message-ID: Subject: Re: [RESEND PATCH] nvdimm: fix some compilation warnings To: Qian Cai Cc: Andrew Morton , Vishal L Verma , Dave Jiang , Keith Busch , "Weiny, Ira" , linux-nvdimm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 14, 2019 at 8:08 AM Qian Cai wrote: > > Several places (dimm_devs.c, core.c etc) include label.h but only > label.c uses NSINDEX_SIGNATURE, so move its definition to label.c > instead. > In file included from drivers/nvdimm/dimm_devs.c:23: > drivers/nvdimm/label.h:41:19: warning: 'NSINDEX_SIGNATURE' defined but > not used [-Wunused-const-variable=] > > The commit d9b83c756953 ("libnvdimm, btt: rework error clearing") left > an unused variable. > drivers/nvdimm/btt.c: In function 'btt_read_pg': > drivers/nvdimm/btt.c:1272:8: warning: variable 'rc' set but not used > [-Wunused-but-set-variable] > > Last, some places abuse "/**" which is only reserved for the kernel-doc. > drivers/nvdimm/bus.c:648: warning: cannot understand function prototype: > 'struct attribute_group nd_device_attribute_group = ' > drivers/nvdimm/bus.c:677: warning: cannot understand function prototype: > 'struct attribute_group nd_numa_attribute_group = ' Can you include the compiler where these errors start appearing, since I don't see these warnings with gcc-8.3.1 > > Reviewed-by: Vishal Verma > Signed-off-by: Qian Cai > --- > drivers/nvdimm/btt.c | 6 ++---- > drivers/nvdimm/bus.c | 4 ++-- > drivers/nvdimm/label.c | 2 ++ > drivers/nvdimm/label.h | 2 -- > 4 files changed, 6 insertions(+), 8 deletions(-) > > diff --git a/drivers/nvdimm/btt.c b/drivers/nvdimm/btt.c > index 4671776f5623..9f02a99cfac0 100644 > --- a/drivers/nvdimm/btt.c > +++ b/drivers/nvdimm/btt.c > @@ -1269,11 +1269,9 @@ 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); > + btt_map_write(arena, premap, postmap, 0, 1, > + NVDIMM_IO_ATOMIC); > goto out_rtt; This doesn't look correct to me, shouldn't we at least be logging that the bad-block failed to be persistently tracked? > } > > diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c > index 7ff684159f29..2eb6a6cfe9e4 100644 > --- a/drivers/nvdimm/bus.c > +++ b/drivers/nvdimm/bus.c > @@ -642,7 +642,7 @@ static struct attribute *nd_device_attributes[] = { > NULL, > }; > > -/** > +/* > * nd_device_attribute_group - generic attributes for all devices on an nd bus > */ > struct attribute_group nd_device_attribute_group = { > @@ -671,7 +671,7 @@ static umode_t nd_numa_attr_visible(struct kobject *kobj, struct attribute *a, > return a->mode; > } > > -/** > +/* > * nd_numa_attribute_group - NUMA attributes for all devices on an nd bus > */ Lets just fix this to be a valid kernel-doc format for a struct. @@ -672,7 +672,7 @@ static umode_t nd_numa_attr_visible(struct kobject *kobj, struct attribute *a, } /** - * nd_numa_attribute_group - NUMA attributes for all devices on an nd bus + * struct nd_numa_attribute_group - NUMA attributes for all devices on an nd bus */ struct attribute_group nd_numa_attribute_group = { .attrs = nd_numa_attributes, > struct attribute_group nd_numa_attribute_group = { > diff --git a/drivers/nvdimm/label.c b/drivers/nvdimm/label.c > index f3d753d3169c..02a51b7775e1 100644 > --- a/drivers/nvdimm/label.c > +++ b/drivers/nvdimm/label.c > @@ -25,6 +25,8 @@ static guid_t nvdimm_btt2_guid; > static guid_t nvdimm_pfn_guid; > static guid_t nvdimm_dax_guid; > > +static const char NSINDEX_SIGNATURE[] = "NAMESPACE_INDEX\0"; > + Looks good to me. > static u32 best_seq(u32 a, u32 b) > { > a &= NSINDEX_SEQ_MASK; > diff --git a/drivers/nvdimm/label.h b/drivers/nvdimm/label.h > index e9a2ad3c2150..4bb7add39580 100644 > --- a/drivers/nvdimm/label.h > +++ b/drivers/nvdimm/label.h > @@ -38,8 +38,6 @@ enum { > ND_NSINDEX_INIT = 0x1, > }; > > -static const char NSINDEX_SIGNATURE[] = "NAMESPACE_INDEX\0"; > - > /** > * struct nd_namespace_index - label set superblock > * @sig: NAMESPACE_INDEX\0 > -- > 2.20.1 (Apple Git-117) >