Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1169661imm; Tue, 2 Oct 2018 04:03:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV61z3qpojAnEO7+J9sQofHYVNr4LeSv+Wtdu+LAqEPdAVqLH0Zf+Rx7bxgZrkRBFMMxRB7v1 X-Received: by 2002:a63:1f0a:: with SMTP id f10-v6mr13876515pgf.313.1538478201215; Tue, 02 Oct 2018 04:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538478201; cv=none; d=google.com; s=arc-20160816; b=q4YIKqjOwTz6mu1Sd5LBCYlH/xrGPsHmDGDCS3eQmrJFr3afaK0/M1YjStVtaTYPwx lnSYBqfkXcv7wOTle2NCIjIG6n9UjakVmqkRcD6n36gzxj9/tesjXsz3wpChgsIPFZfx 9hpV7GM9QXx48hx2VQfla8bAcb0GPuzp80KEAdC8Kxlebv9guRDGvj+MSBzEZ4waZkvg 3Lb/uKwyoVtvNBaT8lI5yFA4keTUGty+24V5cXZWYhQJUuotGxiHvZs1fZOF8GIq2E3F Nr9nhBBNb0bGiROXZJuSdRW5QIDWS5/y8nHvOimDNlKqF4lzPzb4RdsW0WvBOdvMWCS6 /flA== 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:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ZjH3oP4pB7OAvUTFFLHmADLqEaeyoxuNOhTzGEMhy38=; b=ut+u93LIlzmBYeetdyGztTVyX9AaEWoECm8i1ebCOitrzpMHmbf4jaKnId7ywXqeBX RysNjhfEtVgoQ3EUQaAGhRb5GSW7SrbOHlTtuK+hTHc7g35Q59RpmVIbaYk/1l3u4Jcn xPI17tuwu0HpTahC4qS+DBgyjBMPj5Gf1RvkSnR0qrfyHuKZgl/V61zUwB9kCTj8A4VV A3yp8PvwCzGOcLPtEVVBbjuupPevfl1NIFMF0S43iPlx8UjYRkg4L7HWDDAHRmmz1HIz oQneIDHN4SFbBiInF0Y9rUHW5lE5c5Srjpx1THOHCv9rR/6H1e6LgYzOVUeMma0OJVsG QDXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="p223/OvF"; 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 n23-v6si15071872plp.77.2018.10.02.04.03.06; Tue, 02 Oct 2018 04:03:21 -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=@bgdev-pl.20150623.gappssmtp.com header.s=20150623 header.b="p223/OvF"; 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 S1727524AbeJBRpe (ORCPT + 99 others); Tue, 2 Oct 2018 13:45:34 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:38479 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727240AbeJBRpe (ORCPT ); Tue, 2 Oct 2018 13:45:34 -0400 Received: by mail-wm1-f66.google.com with SMTP id 193-v6so1732375wme.3 for ; Tue, 02 Oct 2018 04:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZjH3oP4pB7OAvUTFFLHmADLqEaeyoxuNOhTzGEMhy38=; b=p223/OvFSla/ZIfxtenmivIM0JwkmCYd89pSV6ugHXqEqzDFhqrz7YpjxDz4kFnZNa cKKim/NmUWOTzDG/PKrIovNoivCk+Wv0WiStJ+q+h2K0yXrBpo7BIGMzhJnZuwjubChl UNyhYuMdBs1+K9SNUIrk+C7shlBtOS77JPn4iyGKzSAYWw+Zh7vyF4VrxKUwuclx+Huw RigFGNXjphcx+MZVDP3S980BsjdfpCL97jeL8eDKZWsqSmmSt4wimKC/UE555bTJiZq3 8YkfnU0yTIIurxlyBiuH0qhkxLAqHxGwkaaNp0IgnhA6kvFdsVajXJx8SXbN7b2PvEgV TIWA== 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:mime-version :content-transfer-encoding; bh=ZjH3oP4pB7OAvUTFFLHmADLqEaeyoxuNOhTzGEMhy38=; b=TiKSVotks6I+/ugZHMm9FpaMkMi49e064m1pd2VhjXBudWe184fbfJM5v/ZSYuWC2E 0LzIDLLFqaqG6lgKh/pZ7zFsjEys/3Zwg6am/ecVtL2sKMucKGnDm+XjsSMfoemXxXjn iPwrXFLntUXT48C3czC3Q+q8aSjyFwFs9YSLubp5t0AQi+7trsIx2kOqSBkJlVJteImW 4jec4hEuwOx8bpqhluD5TKipa5m4T1lOPFGJcY4I9IHftaOZgN5+q+Ccqg4CzEWn8Zzt AaGzerKWSA8H5mWYEr/ivBFXaxeqz6a006v6NEL/u0jpKI8XGZ2B/cazewQSRPh1zRgf fOlA== X-Gm-Message-State: ABuFfog3F7Ro/Be/n8vWmaNPStocmJc35zkTbJXKcxHgVnVe4siB6pdh c3Q6thceUbMFCIRs8g8IM6wtKw== X-Received: by 2002:a1c:2bc3:: with SMTP id r186-v6mr1533311wmr.71.1538478169390; Tue, 02 Oct 2018 04:02:49 -0700 (PDT) Received: from debian-brgl.home ([2a01:cb1d:af:5b00:217b:7d7b:52aa:bc53]) by smtp.gmail.com with ESMTPSA id y203-v6sm11118326wmd.1.2018.10.02.04.02.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 04:02:48 -0700 (PDT) From: Bartosz Golaszewski To: Srinivas Kandagatla , Arnd Bergmann , Greg KH , Stephen Rothwell Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH] nvmem: only build nvmem_find_cell_by_index() if OF is enabled Date: Tue, 2 Oct 2018 13:02:46 +0200 Message-Id: <20181002110246.3175-1-brgl@bgdev.pl> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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) 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) -- 2.19.0