linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Sebastian Reichel <sre@kernel.org>
Cc: "Pali Rohár" <pali.rohar@gmail.com>,
	"Andrew F . Davis" <afd@ti.com>,
	linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] power: bq27xxx_battery: fix defined but not used warnings
Date: Fri, 16 Oct 2015 15:44:12 +0200	[thread overview]
Message-ID: <1445003052-31373-4-git-send-email-sre@kernel.org> (raw)
In-Reply-To: <1445003052-31373-1-git-send-email-sre@kernel.org>

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.

Signed-off-by: Sebastian Reichel <sre@kernel.org>
---
 drivers/power/bq27xxx_battery.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/power/bq27xxx_battery.c b/drivers/power/bq27xxx_battery.c
index 880233ce9343..452c9f079e0d 100644
--- a/drivers/power/bq27xxx_battery.c
+++ b/drivers/power/bq27xxx_battery.c
@@ -991,7 +991,7 @@ static void bq27xxx_external_power_changed(struct power_supply *psy)
 	schedule_delayed_work(&di->work, 0);
 }
 
-static int bq27xxx_powersupply_init(struct bq27xxx_device_info *di,
+static int __maybe_unused bq27xxx_powersupply_init(struct bq27xxx_device_info *di,
 				    const char *name)
 {
 	int ret;
@@ -1026,7 +1026,7 @@ static int bq27xxx_powersupply_init(struct bq27xxx_device_info *di,
 	return 0;
 }
 
-static void bq27xxx_powersupply_unregister(struct bq27xxx_device_info *di)
+static void __maybe_unused bq27xxx_powersupply_unregister(struct bq27xxx_device_info *di)
 {
 	/*
 	 * power_supply_unregister call bq27xxx_battery_get_property which
-- 
2.6.1


  parent reply	other threads:[~2015-10-16 13:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-16 13:44 [PATCH 0/3] power: bq27xxx: Fix multiple defined but not used warnings Sebastian Reichel
2015-10-16 13:44 ` [PATCH 1/3] power: bq27xxx_battery: fix platform probe Sebastian Reichel
2015-10-16 14:47   ` Pali Rohár
2015-10-16 14:53   ` Andrew F. Davis
2015-10-16 13:44 ` [PATCH 2/3] power: bq27xxx_battery: move irq handler to i2c section Sebastian Reichel
2015-10-16 14:48   ` Pali Rohár
2015-10-16 15:06   ` Andrew F. Davis
2015-10-16 13:44 ` Sebastian Reichel [this message]
2015-10-16 14:47   ` [PATCH 3/3] power: bq27xxx_battery: fix defined but not used warnings Pali Rohár
2015-10-16 15:01     ` Andrew F. Davis
2015-10-19  9:37       ` Sebastian Reichel
2015-10-19 16:33         ` Andrew F. Davis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445003052-31373-4-git-send-email-sre@kernel.org \
    --to=sre@kernel.org \
    --cc=afd@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pali.rohar@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).