From patchwork Tue Oct 2 21:11:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 148024 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5640108lji; Tue, 2 Oct 2018 14:11:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV613JPy9WwSK2KAksfuAPfsUutRAQ8H54WX+kYjyecIHiu/rAlUa9wx3PIiwFUbMC5sJpGKX X-Received: by 2002:a62:5b85:: with SMTP id p127-v6mr18140794pfb.33.1538514689884; Tue, 02 Oct 2018 14:11:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538514689; cv=none; d=google.com; s=arc-20160816; b=znbIWPJPkKIazz85hFCi1bRlcYl/8Jp6vGH3lGtfQ0002HbjnXYY7TJ7rhRefdczVB /yWswU3AquOWc1cnffrz7T8230P8rcfWLyn5OYt9Eb5O38VgKqQ6SRZYrOltpbH+p9E1 C7L2ENYIpkjv71lQG/urwGtI1Js92TdvVxFhW8YEaH+xFyPt5Ur4lwLjXSXqaCKMoBoL 3i6GuecYnSa5uOWE2x+f8GZLbSD5/ldpkrRxGKr+EZl8yzdTV23E3JRCK2JahxjZ3x+P mWYTiurse+lOQmQ48LM20ABvMw39mOhjLjjyUvjGD9hM759ya8twskHugj9D6pdf36sJ 8kzA== 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; bh=1w2LYlDXmj9/BEugVXKlnWVs+R51JPt4UsfrVItudZw=; b=xVxn1ty/Tl8X7hp23DT395jlVm8QE3kj7PT2XVzeLWiU1i0iy4Bue4lWSxdgL+zV98 C1n8i7gqrGBZbikdFIU3rsqDqKlKkYmd0UkouTmxbhEfwGOooNJfiINVwMcBTsjUluxd MWELaeNBreD4+f37NmzK2QBKCpQUzGlp8Qe58Dqz+tCnH4+TiapwDfJhptiMAOniapCI aFT/sBo7jJv5e7LEU2n+WLs7BblOlO7nm7pOx9TQnqf6H9nhxizKSBzrFzwFsy6lgylE QStTZKaDHoVfIXBCkSqlTNSbs1mnzAhr9brjHvoG1bywpkeH0sBT7cLnOCc2bIZf/bAE Zxqg== ARC-Authentication-Results: i=1; mx.google.com; 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 cb8-v6si17882416plb.178.2018.10.02.14.11.29; Tue, 02 Oct 2018 14:11:29 -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; 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 S1728446AbeJCD4o (ORCPT + 32 others); Tue, 2 Oct 2018 23:56:44 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:60903 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbeJCD4o (ORCPT ); Tue, 2 Oct 2018 23:56:44 -0400 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1M738r-1g5Ufb2uUB-008ef4; Tue, 02 Oct 2018 23:11:24 +0200 Received: from wuerfel.lan ([109.193.40.16]) by mrelayeu.kundenserver.de (mreue106 [212.227.15.145]) with ESMTPA (Nemesis) id 1M738r-1g5Ufb2uUB-008ef4; Tue, 02 Oct 2018 23:11:24 +0200 From: Arnd Bergmann To: Srinivas Kandagatla Cc: Arnd Bergmann , Greg Kroah-Hartman , Bartosz Golaszewski , Andrey Smirnov , Heiner Kallweit , linux-kernel@vger.kernel.org Subject: [PATCH] nvmem: hide unused nvmem_find_cell_by_index function Date: Tue, 2 Oct 2018 23:11:12 +0200 Message-Id: <20181002211123.2662419-1-arnd@arndb.de> X-Mailer: git-send-email 2.18.0 X-Provags-ID: V03:K1:TvEE8/YQAixbvqvV6ZGvlneBXw9+k2lvchvHpIiTo9lxGoRSGE1 K0saL7SNLVS3HcW6k3qDjC+AcNoyd8JMiBTBk0b7clkoMKkJNBu2oJOkU9CcOqLk7q5n28k noQTOQjFpAuDTwhLAYvXhAUbGUiXahN9IWyRjdcvW9oQh09zxcb2QDKlnQDRCkQu6RrkHu2 pHQE6I150MHrNDP8ZEbNA== X-UI-Out-Filterresults: notjunk:1; V01:K0:mwRHanT7PPo=:Mb5caRYx9CuyTh4p1sAFtQ D0645J2m69ERVDh9FsvvDV8DoLs/q8lPMv5HugiubLLZIBGtV1eJ6FLEcpk0HM5EoZT0feSC7 jWgdVnfrrX6Q0N0TwSIsLfnojw/CTAgIu6PbxCX7K4HcVWI9cKrJHietLQpFQT0iYgiWASEPt rcGZkHxGP1DUIhFST1lWOvY4DilHd7K5vOpK4jyV7yp4N8shDaC5zFNJ1SHqkQEuREmo++CgC JgkNv/imzkf9BjT08F5dDECzNkC/UooKMU6SUpAKkQQfaiEGTkUFdaKNE/7+cS1kvrQeWQdCr KunwCqLtl2Cq/r+2YZKKegNTKoAeM18c+TnXwhlbGjYLBg/YjMg5QGHxpqNQVyAlDnp2UPsDS 2uE5cHzYXl8zIMipeU8AsDUcTnTPDgfWIrLvRK+zqokzv0fMRx6R+9LH7a8xEfuEANnOLTxLC OuGUQiiJ+InfzjinHOdJy1Tns8SBBTq5q4sTY+wZu/vmWDVga+VsHw0Eo+hoeaGkdFquTwnqv xS2K3fz/4aDzFpWbJh8CV3Rfw7OddF57oACY37St3dt7grB9unU3i1nuO4Uh6lrYrXFtihhHy S3ibRFyqJ+TNJdGLGxSkmExIerbfGSIKk4sh7QvcYe6r7LgfPAhk+lTVHE654nPQCgtGFZlQt ffvgPz5/A/NaeAg0+LavU5L9ti/oy3taSE8qhmSUAqTceQc3q6KKkuXDr61feVHNdl1M= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org nvmem_find_cell_by_index() is only called from inside an #ifdef, so we get a build warning without CONFIG_OF: drivers/nvmem/core.c:496:1: error: 'nvmem_find_cell_by_index' defined but not used [-Werror=unused-function] Move it into the same #ifdef as the caller to avoid the warning. Fixes: e888d445ac33 ("nvmem: resolve cells from DT at registration time") Signed-off-by: Arnd Bergmann --- drivers/nvmem/core.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) -- 2.18.0 Acked-by: Srinivas Kandagatla diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index cc815bb2eebd..f99fb74a646e 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -492,22 +492,6 @@ static int nvmem_add_cells_from_table(struct nvmem_device *nvmem) return rval; } -static struct nvmem_cell * -nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) -{ - struct nvmem_cell *cell = NULL; - int i = 0; - - mutex_lock(&nvmem_mutex); - list_for_each_entry(cell, &nvmem->cells, node) { - if (index == i++) - break; - } - mutex_unlock(&nvmem_mutex); - - return cell; -} - static struct nvmem_cell * nvmem_find_cell_by_name(struct nvmem_device *nvmem, const char *cell_id) { @@ -972,6 +956,22 @@ nvmem_cell_get_from_lookup(struct device *dev, const char *con_id) } #if IS_ENABLED(CONFIG_OF) +static struct nvmem_cell * +nvmem_find_cell_by_index(struct nvmem_device *nvmem, int index) +{ + struct nvmem_cell *cell = NULL; + int i = 0; + + mutex_lock(&nvmem_mutex); + list_for_each_entry(cell, &nvmem->cells, node) { + if (index == i++) + break; + } + mutex_unlock(&nvmem_mutex); + + return cell; +} + /** * of_nvmem_cell_get() - Get a nvmem cell from given device node and cell id *