From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754140AbbJPOrL (ORCPT ); Fri, 16 Oct 2015 10:47:11 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:36091 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751843AbbJPOrJ (ORCPT ); Fri, 16 Oct 2015 10:47:09 -0400 Date: Fri, 16 Oct 2015 16:47:05 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Sebastian Reichel Cc: "Andrew F . Davis" , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] power: bq27xxx_battery: fix defined but not used warnings Message-ID: <20151016144705.GG28216@pali> References: <1445003052-31373-1-git-send-email-sre@kernel.org> <1445003052-31373-4-git-send-email-sre@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1445003052-31373-4-git-send-email-sre@kernel.org> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 16 October 2015 15:44:12 Sebastian Reichel wrote: > If BQ27XXX is enabled, but neither I2C based initialization, nor > platform based initialization are activated, bq27xxx_powersupply_init > and bq27xxx_powersupply_unregister are defined but not used. > > This configuration doesn't make sense, but there is no easy way > to make it unavailable in the build system, so just mark the > functions as __maybe_unused instead. > What about? #if defined(CONFIG_1) || defined(CONFIG_2) #define NEED_POWER_SUPPLY #endif And then wrap power supply code into #ifdef NEED_POWER_SUPPLY? -- Pali Rohár pali.rohar@gmail.com