mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Axel Lin <axel.lin@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Donggeun Kim <dg77.kim@samsung.com>
Subject: Re: [PATCH] power_supply: charger-manager: Clean up for better readability
Date: Thu, 15 Mar 2012 21:03:50 +0400	[thread overview]
Message-ID: <20120315170350.GB11441@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <1326344195.7311.1.camel@phoenix>

On Thu, Jan 12, 2012 at 12:56:35PM +0800, Axel Lin wrote:
> This patch includes below changes:
> 
> * Some code change for better readability.
> * Current code in probe already ensures desc->charger_regulators is not NULL.
>   No need to check if it is NULL or not before calling regulator_bulk_free().
> * Use dev_get_drvdata() in cm_suspend_prepare() and cm_suspend_complete()
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> ---

Applied, thanks a lot!


FWIW, I also applied the following patch:

commit f304f0a31442f4c8b98208acedc3da2f6c60a771
Author: Anton Vorontsov <anton.vorontsov@linaro.org>
Date:   Thu Mar 15 21:01:28 2012 +0400

    charger-manager: Simplify charger_get_property(), get rid of a warning
    
    This patch fixes the following warning and makes the code a little
    bit more simpler:
    
      CC      drivers/power/charger-manager.o
    charger-manager.c: In function 'charger_get_property':
    charger-manager.c:429:15: warning: 'i' may be used uninitialized in this function [-Wuninitialized]
    
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>

diff --git a/drivers/power/charger-manager.c b/drivers/power/charger-manager.c
index e610e6b..9eca9f1 100644
--- a/drivers/power/charger-manager.c
+++ b/drivers/power/charger-manager.c
@@ -399,7 +399,8 @@ static int charger_get_property(struct power_supply *psy,
 	struct charger_manager *cm = container_of(psy,
 			struct charger_manager, charger_psy);
 	struct charger_desc *desc = cm->desc;
-	int i, ret = 0, uV;
+	int ret = 0;
+	int uV;
 
 	switch (psp) {
 	case POWER_SUPPLY_PROP_STATUS:
@@ -425,8 +426,7 @@ static int charger_get_property(struct power_supply *psy,
 			val->intval = 0;
 		break;
 	case POWER_SUPPLY_PROP_VOLTAGE_NOW:
-		ret = get_batt_uV(cm, &i);
-		val->intval = i;
+		ret = get_batt_uV(cm, &val->intval);
 		break;
 	case POWER_SUPPLY_PROP_CURRENT_NOW:
 		ret = cm->fuel_gauge->get_property(cm->fuel_gauge,

      reply	other threads:[~2012-03-15 17:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-12  4:56 Axel Lin
2012-03-15 17:03 ` 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=20120315170350.GB11441@oksana.dev.rtsoft.ru \
    --to=cbouatmailru@gmail.com \
    --cc=axel.lin@gmail.com \
    --cc=dg77.kim@samsung.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.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

all inboxes | Powered by JetHome®