All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ashish Jangam <ashish.jangam@kpitcummins.com>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>,
	<linux-kernel@vger.kernel.org>,
	David Dajun Chen <dchen@diasemi.com>, <sameo@linux.intel.com>
Subject: Re: [PATCH 06/07] RTC: RTC driver for DA9052/53 PMIC v1
Date: Mon, 6 Feb 2012 14:38:20 -0800	[thread overview]
Message-ID: <20120206143820.9808fba7.akpm@linux-foundation.org> (raw)
In-Reply-To: <1328532545.30549.83.camel@dhruva>

On Mon, 6 Feb 2012 18:19:05 +0530
Ashish Jangam <ashish.jangam@kpitcummins.com> wrote:

> RTC Driver for Dialog Semiconductor DA9052/53 PMICs.
> 
> This patch is functionally tested on Samsung SMDKV6410.
> 
> ...
>
>  drivers/rtc/Kconfig      |    7 +
>  drivers/rtc/Makefile     |    1 +
>  drivers/rtc/rtc-da9052.c |  293 ++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 301 insertions(+), 0 deletions(-)

I assume that this patch is mergeable without any of the other six
patches in this series.  It compiles OK...

>
> ...
>
> +static int da9052_read_alarm(struct da9052 *da9052, struct rtc_time *rtc_tm)
> +{
> +	int ret;
> +	uint8_t v[5] = {0, 0, 0, 0, 0};

These initalised local arrays are expensive.  The below patch reduces
the module's text size by over 100 bytes.

The arrays whcih are passed to da9052_group_write() surely didn't need
initalisation, and I trust that's also the case with the arrays which
are passed to da9052_group_read()?

>
> ...
>

From: Andrew Morton <akpm@linux-foundation.org>
Subject: rtc-rtc-driver-for-da9052-53-pmic-v1-fix

- clean up file header layout
- remove unneeded initialisation of local arrays

Cc: Ashish Jangam <ashish.jangam@kpitcummins.com>
Cc: David Dajun Chen <dchen@diasemi.com>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: David Dajun Chen <dchen@diasemi.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 drivers/rtc/rtc-da9052.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff -puN drivers/rtc/rtc-da9052.c~rtc-rtc-driver-for-da9052-53-pmic-v1-fix drivers/rtc/rtc-da9052.c
--- a/drivers/rtc/rtc-da9052.c~rtc-rtc-driver-for-da9052-53-pmic-v1-fix
+++ a/drivers/rtc/rtc-da9052.c
@@ -1,9 +1,9 @@
 /*
  * Real time clock driver for DA9052
  *
- *Copyright(c) 2012 Dialog Semiconductor Ltd.
+ * Copyright(c) 2012 Dialog Semiconductor Ltd.
  *
- *Author: Dajun Dajun Chen <dajun.chen@diasemi.com>
+ * Author: Dajun Dajun Chen <dajun.chen@diasemi.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -69,7 +69,7 @@ static irqreturn_t da9052_rtc_irq(int ir
 static int da9052_read_alarm(struct da9052 *da9052, struct rtc_time *rtc_tm)
 {
 	int ret;
-	uint8_t v[5] = {0, 0, 0, 0, 0};
+	uint8_t v[5];
 
 	ret = da9052_group_read(da9052, DA9052_ALARM_MI_REG, 5, v);
 	if (ret != 0) {
@@ -92,7 +92,7 @@ static int da9052_read_alarm(struct da90
 static int da9052_set_alarm(struct da9052 *da9052, struct rtc_time *rtc_tm)
 {
 	int ret;
-	uint8_t v[3] = {0, 0, 0};
+	uint8_t v[3];
 
 	rtc_tm->tm_year -= 100;
 	rtc_tm->tm_mon += 1;
@@ -136,7 +136,7 @@ static int da9052_rtc_get_alarm_status(s
 static int da9052_rtc_read_time(struct device *dev, struct rtc_time *rtc_tm)
 {
 	struct da9052_rtc *rtc = dev_get_drvdata(dev);
-	uint8_t v[6] = {0, 0, 0, 0, 0, 0};
+	uint8_t v[6];
 	int ret;
 
 	ret = da9052_group_read(rtc->da9052, DA9052_COUNT_S_REG, 6, v);
@@ -164,7 +164,7 @@ static int da9052_rtc_read_time(struct d
 static int da9052_rtc_set_time(struct device *dev, struct rtc_time *tm)
 {
 	struct da9052_rtc *rtc;
-	uint8_t v[6] = {0, 0, 0, 0, 0, 0};
+	uint8_t v[6];
 
 	rtc = dev_get_drvdata(dev);
 
_


  reply	other threads:[~2012-02-06 22:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-06 12:49 [PATCH 06/07] RTC: RTC driver for DA9052/53 PMIC v1 Ashish Jangam
2012-02-06 22:38 ` Andrew Morton [this message]
     [not found] <C3AE124F08223B42BC95AEB82F0F6CED1FDDA892@KCHJEXMB02.kpit.com>
2012-02-07 12:25 ` Ashish Jangam

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=20120206143820.9808fba7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ashish.jangam@kpitcummins.com \
    --cc=dchen@diasemi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=p_gortmaker@yahoo.com \
    --cc=sameo@linux.intel.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 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.