All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	David Dajun Chen <dchen@diasemi.com>,
	Ashish Jangam <ashish.jangam@kpitcummins.com>
Subject: Re: [PATCH] power_supply: Remove broken mark for da9052-battery
Date: Wed, 22 Aug 2012 19:36:15 -0700	[thread overview]
Message-ID: <20120823023612.GD24471@lizard> (raw)
In-Reply-To: <1344413298.17894.1.camel@phoenix>

On Wed, Aug 08, 2012 at 04:08:18PM +0800, Axel Lin wrote:
> The fix for MFD part is already merged so we can remove the broken mark
> for da9052-battery.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---
[...]
> -	depends on BROKEN

Applied, thanks a lot!

Though, I had to apply the following right after:

commit bc909f27f55ceb8f950ced5cf3a26d6b26e86ca6
Author: Anton Vorontsov <anton.vorontsov@linaro.org>
Date:   Wed Aug 22 19:29:44 2012 -0700

    da9052-battery: Fix da9052_determine_vc_tbl_index's return value
    
    The patch fixes the following warnings:
    
      CHECK   drivers/power/da9052-battery.c
    drivers/power/da9052-battery.c:330:15: warning: symbol 'da9052_determine_vc_tbl_index' was not declared. Should it be static?
      CC      drivers/power/da9052-battery.o
    drivers/power/da9052-battery.c: In function 'da9052_determine_vc_tbl_index':
    drivers/power/da9052-battery.c:348:1: warning: control reaches end of non-void function [-Wreturn-type]
    
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>

diff --git a/drivers/power/da9052-battery.c b/drivers/power/da9052-battery.c
index a5f6a0e..20b86ed 100644
--- a/drivers/power/da9052-battery.c
+++ b/drivers/power/da9052-battery.c
@@ -327,7 +327,7 @@ static int da9052_bat_interpolate(int vbat_lower, int  vbat_upper,
 	return tmp;
 }
 
-unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp)
+static unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp)
 {
 	int i;
 
@@ -345,6 +345,13 @@ unsigned char da9052_determine_vc_tbl_index(unsigned char adc_temp)
 		     && (adc_temp <= vc_tbl_ref[i]))
 				return i + 1;
 	}
+	/*
+	 * For some reason authors of the driver didn't presume that we can
+	 * end up here. It might be OK, but might be not, no one knows for
+	 * sure. Go check your battery, is it on fire?
+	 */
+	WARN_ON(1);
+	return 0;
 }
 
 static int da9052_bat_read_capacity(struct da9052_battery *bat, int *capacity)

      reply	other threads:[~2012-08-23  2:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-08  8:08 [PATCH] power_supply: Remove broken mark for da9052-battery Axel Lin
2012-08-23  2:36 ` Anton Vorontsov [this message]

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=20120823023612.GD24471@lizard \
    --to=cbouatmailru@gmail.com \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=axel.lin@gmail.com \
    --cc=dchen@diasemi.com \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.