Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1221893imm; Tue, 2 Oct 2018 04:59:51 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ad6x0dgeyYxyLoOLw1xpcHZAxa4+Wpx5imt5LGU846LfMtdAw/7UATOxYcNxNvaP4Fxp4 X-Received: by 2002:a62:37c1:: with SMTP id e184-v6mr16256224pfa.112.1538481591107; Tue, 02 Oct 2018 04:59:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538481591; cv=none; d=google.com; s=arc-20160816; b=d2BWc0fJ/D3GEH/mxR2F3LqUIKfqT5zF6m4tWejZAvyHIfcMzy+yF+mxtDwtB0PGg3 o8v61zG5IYrvbi7xLx4+2kOnig6JXpYHf3CYedU/0+DoM3rtFnWQgN1Hx8EVUSl3qI59 BNTFPqjB+ZS5l+cBP16oycSMwZIXCfqO1zsepFKC+Lp6V3guGmwY6+4vQSW5q2kD5uMl Yfp1gzkaTlLe3HZ3NrRtSyK431KbfVc0PFqnks1MRT6RpokJtzhoFYDfhuHjPTj6Fbbw Wn4weyH2mCdnKM+wLkv8bOMEiy0ckGO+URFDI3Q8pmRo+ov04njJuVMBV6QzUNzKfBx7 bSrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=HanyxJjqmJFAhbQAJCmaMd1FuxthfmtTJx5SYhZGOIU=; b=vOcdvfM9vcUtEZHIIfbYRcsC/LozagvZv/hhj05peF/baeBCrCxcFLJ5AFKB1UMp7c F/knx8soQkS36qb03PeQYIAxaPujQyyRAEKZCsLSnO4y6JMqXAha0jPixdrmlEoOSeEb wBGbBJ0Zmn3fhmkyeey+QNJTvEi2TroO1jWqbd6Aca9SqVb20t9jiiC2K3Niqtcwm9op wnwOl3skxovUlv5bDQWbN5maygJQwXWfQF9tOEtlWnvKBS7KH5ADUyJWWl875/lylEna KRX2+wVzygS0Cw2EqrG5RQyVo8UL+684ejATWWxM9HrYWUnMlzut4Ud1/E01/vU7w5CE Eo3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=uHL3BqSx; 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 j10-v6si14231507pgi.223.2018.10.02.04.59.36; Tue, 02 Oct 2018 04:59:51 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=uHL3BqSx; 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 S1727588AbeJBSm1 (ORCPT + 99 others); Tue, 2 Oct 2018 14:42:27 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:46719 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727557AbeJBSm0 (ORCPT ); Tue, 2 Oct 2018 14:42:26 -0400 Received: by mail-ot1-f66.google.com with SMTP id o21so1277693otb.13 for ; Tue, 02 Oct 2018 04:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=HanyxJjqmJFAhbQAJCmaMd1FuxthfmtTJx5SYhZGOIU=; b=uHL3BqSx5n8RUgV+ZJf7c+KQ8/DgHJgiwS+fMypwwFCVRW8qdav8WcHQyCkRQHL5BR kKxcchnVp0w2K5fFI2Vp7dyeKTYkL5U/kbYj3Be1ejrXXn6+JfSM3fZox8ui9EUhi6Jt jBwVMX11DNoRLDckqlsmKLWUL6t8gadsgY6G8j2eOMc9w8Z34OMJoj5mCU7MLfUYC1A0 x3fb+2tYaTp/UVLoh8byTdx83A+8KIdFGSur8vy/2w7TzYVLWoVqUcPNOqjxt1ZBckzl FPrMpxeOhX10GcjiMPm2tvtFvRN23gzhAlwXRkKBHZd0M++OoxEDMBBP2npuC77ksTGP 1bOA== 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:content-transfer-encoding; bh=HanyxJjqmJFAhbQAJCmaMd1FuxthfmtTJx5SYhZGOIU=; b=Gx6Ci5OgBpvc0rFQVhQbDZJGhzK3PbDgxXERvj3sMi8U8XQGyng7EDCx6CiJWbG6h0 lOzOsaIgk6Y7DFHbYaYw3qTgUUWjAMknAgyisY3ESRfrgwch/2VwPALY7ygh0gh/tvBa oAGljbLBhwm0L7T/qqghuhKwHwoYLucDNuvP5tCbx8/u9jH/oLT5kgCLnXuwnJiPB3xJ iQJyGnqRm4sf8kqFn4qD31h6tD5z4xd1W/XqoZIAWEKaun4i4GW0XjPDoGK+jtY+rk+Z V67etW6v7zW0Ofr/1IBmJWKnz9uXWRRRkIQgi84SjR7WJX1Mz9d6remckusEJuJOHDcD l7Xw== X-Gm-Message-State: ABuFfoiOHfVFcsczG8cN2nwXqy7FaWACkOyGv0uuObuQeSisiUfU+vkb KTeEsyYtFBDf+rho4MMJZCq6DiOkTwmeJc3xO3a+HA== X-Received: by 2002:a9d:1707:: with SMTP id i7mr852993ota.236.1538481569056; Tue, 02 Oct 2018 04:59:29 -0700 (PDT) MIME-Version: 1.0 References: <20181002110246.3175-1-brgl@bgdev.pl> <13b4b871-8f81-d007-ef37-eb697f984f01@linaro.org> In-Reply-To: <13b4b871-8f81-d007-ef37-eb697f984f01@linaro.org> From: Bartosz Golaszewski Date: Tue, 2 Oct 2018 13:59:18 +0200 Message-ID: Subject: Re: [PATCH] nvmem: only build nvmem_find_cell_by_index() if OF is enabled To: Srinivas Kandagatla Cc: Bartosz Golaszewski , Arnd Bergmann , GregKH , sfr@canb.auug.org.au, arm-soc , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org wt., 2 pa=C5=BA 2018 o 13:49 Srinivas Kandagatla napisa=C5=82(a): > > > > On 02/10/18 12:02, Bartosz Golaszewski wrote: > > From: Bartosz Golaszewski > > > > The following warning is produced when building nvmem core if > > CONFIG_OF is disabled: > > > > drivers/nvmem/core.c:496:1: warning: 'nvmem_find_cell_by_index' defined= but not used [-Wunused-function] > > nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) > > ^~~~~~~~~~~~~~~~~~~~~~~~ > > > > This is caused by the fact that the only caller of this routine is > > under an ifdef depending on this option. Fix it by adding a relevant > > ifdef to the function in question as well. > > > > Signed-off-by: Bartosz Golaszewski > > --- > > drivers/nvmem/core.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c > > index cc815bb2eebd..65f61cd0a687 100644 > > --- a/drivers/nvmem/core.c > > +++ b/drivers/nvmem/core.c > > @@ -492,6 +492,7 @@ static int nvmem_add_cells_from_table(struct nvmem_= device *nvmem) > > return rval; > > } > > > > +#if IS_ENABLED(CONFIG_OF) > > You should probably attribute the function with "__maybe_unused" > Instead of adding this condition. > Sounds better indeed. I'll resend tomorrow to avoid spamming. Bart > --srini > > > > static struct nvmem_cell * > > nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) > > { > > @@ -507,6 +508,7 @@ nvmem_find_cell_by_index(struct nvmem_device *nvmem= , int index) > > > > return cell; > > } > > +#endif > > > > static struct nvmem_cell * > > nvmem_find_cell_by_name(struct nvmem_device *nvmem, const char *cell_= id) > >