Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1214129imm; Tue, 2 Oct 2018 04:50:22 -0700 (PDT) X-Google-Smtp-Source: ACcGV62gXnL2NsFY1G5jhVnFb8OUgQDDz6pBI4XUAGXCGg5RHosh4l7ryP6WLjjg3utnJ+YSsZC9 X-Received: by 2002:a63:5660:: with SMTP id g32-v6mr13608199pgm.227.1538481022001; Tue, 02 Oct 2018 04:50:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538481021; cv=none; d=google.com; s=arc-20160816; b=IFqF/1rTXD+npeDwl7YHo96PRHOORlQLwPOlkn0rnneN86A2ZSsqV/XfHuoDv/9pr2 ux2VouPwdlaKruANPDQnAYqnhhcnDhHMp7W4c/Gld68QVnjzA/3Q4FOJE0POX8568oID mwz5154SZf97ZP4SFzfJ6vCIcB7IPAGxGG2+rbtVWX+ohpfCUmnlAZy4aRhmKAKr0mr9 pQLE1qc24qXwQK1wEKjXqTmic1xJhTtifoL4mro472Gep7JdGw5cXAmIK3FtVyhvrqKQ M2Wi2h2lL8MB6NGJW9XFr6zs2o2jhL/50LnszACLOkNG7GV1RCmqQLqeGkPhA0N59XaI 1kqw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=ZRxoGk/zzzakiuKWp4Swahuw6nOMVqfdxhCmRPFoGNA=; b=cM8kyvhjex30ploDnmnSIzMdLJziDqnAyLWqCbnJMwXZM1DKEYHv4BKRv35Z/6KKT2 fxqIwGpX3DCsu9dUg4bbR5Q+NXftJw8/gf7mP1Pmorg0IpwLs0c5wtZXzL4JThkjraew sGqZOzQXQvpbVSKQTzsXxrc2JqLCQKFzQEzJwCum2gE3e6MXP9khZcI3QBu1hg4ZjmEe 1AtQaqAlEL1+gfKvfZH5n7GgnphfXQAzBAbfhh2ELHgEjotkzP1DN9WMrB+pgUyVMnfz iHvC7I7aiapp5NuDMUiCtqerQFxbCzfxQ2ER9Kjj4NedmR32yCvILJihG6ggglTXWAjP eYHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XbMqm8N9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k65-v6si5104408pfj.115.2018.10.02.04.50.06; Tue, 02 Oct 2018 04:50: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=@linaro.org header.s=google header.b=XbMqm8N9; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727589AbeJBScx (ORCPT + 99 others); Tue, 2 Oct 2018 14:32:53 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:44916 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727434AbeJBScx (ORCPT ); Tue, 2 Oct 2018 14:32:53 -0400 Received: by mail-wr1-f68.google.com with SMTP id 63-v6so1841173wra.11 for ; Tue, 02 Oct 2018 04:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ZRxoGk/zzzakiuKWp4Swahuw6nOMVqfdxhCmRPFoGNA=; b=XbMqm8N9Lclna5BDRdBEB6fvlU0/kYgq3TNhO7ytTz7JqB0fiZ/hIWFnv13pMUMeMI bzSVJprXbXBqHXIWLP2i1B1BK7TGupDly17T/eUaOX88gphIbUMPMBCb81A25rw9Id4y nAjLAqEZ1k/VzHx+VWIBBXVsL60l/PVQ7GhRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ZRxoGk/zzzakiuKWp4Swahuw6nOMVqfdxhCmRPFoGNA=; b=mJgD/b+xQI+KOeghLaJsHiX7Wx2oZJ9eHZUm5NSlUBLfs1uYDybL2kIDgXz9tFFcMR MMWD3auLvCINlBFDrlvZz+EGECnaT4N5AVsNjgX3xmWJ6ZGdtBCV9L5z0EJPoIJ8uIsP YulTdcmVjtaXsva+LO+pIQwjJh8YtIAnRocZT3HJym4f5ilH5P1DZ3T80s19IE7UAoAf 7s3cnuXat4p6yjYPfy8IRe3jHD3MCBAIeIAN7sbUqhJ0KEOZv6S/fE+dSLgtpIi3fc/G zqe8ArzdeKOXco7u+LYyQupZXHoUHH7od7H6Nxwi6MrQKx55t6smq81DUOwqWt/sgAZS QPTQ== X-Gm-Message-State: ABuFfojRHXwRYBf0XLhiWRQnz/btwK9Hu+Nt818ILNAAJOHhjfFfP2LE WkK99xqEt1UldXN4BXFcqlPzog== X-Received: by 2002:a05:6000:108c:: with SMTP id y12mr10201285wrw.226.1538480997227; Tue, 02 Oct 2018 04:49:57 -0700 (PDT) Received: from [192.168.0.19] (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.googlemail.com with ESMTPSA id a18sm18057641wrx.55.2018.10.02.04.49.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Oct 2018 04:49:56 -0700 (PDT) Subject: Re: [PATCH] nvmem: only build nvmem_find_cell_by_index() if OF is enabled To: Bartosz Golaszewski , Arnd Bergmann , Greg KH , Stephen Rothwell Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski References: <20181002110246.3175-1-brgl@bgdev.pl> From: Srinivas Kandagatla Message-ID: <13b4b871-8f81-d007-ef37-eb697f984f01@linaro.org> Date: Tue, 2 Oct 2018 12:49:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20181002110246.3175-1-brgl@bgdev.pl> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. --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) >