All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rtc/hctosys: only claim the RTC provided the system time if it did
@ 2010-02-08 21:10 Uwe Kleine-König
  2010-02-08 21:21 ` Uwe Kleine-König
  2010-02-11 10:52 ` [PATCH RESEND] " Uwe Kleine-König
  0 siblings, 2 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2010-02-08 21:10 UTC (permalink / raw)
  To: rtc-linux
  Cc: Paul Gortmaker, Alessandro Zummo, Uwe Kleine-König,
	Andrew Morton, linux-kernel

Moreover change error handling in rtc_hctosys() to use goto and so
reduce the indention level.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/rtc/hctosys.c |   59 ++++++++++++++++++++++++++++--------------------
 include/linux/rtc.h   |    6 +++++
 2 files changed, 40 insertions(+), 25 deletions(-)

diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
index 33c0e98..bc90b09 100644
--- a/drivers/rtc/hctosys.c
+++ b/drivers/rtc/hctosys.c
@@ -22,48 +22,57 @@
  * the best guess is to add 0.5s.
  */
 
+int rtc_hctosys_ret = -ENODEV;
+
 static int __init rtc_hctosys(void)
 {
-	int err;
+	int err = -ENODEV;
 	struct rtc_time tm;
+	struct timespec tv = {
+		.tv_nsec = NSEC_PER_SEC >> 1,
+	};
 	struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
 
 	if (rtc == NULL) {
-		printk("%s: unable to open rtc device (%s)\n",
+		pr_err("%s: unable to open rtc device (%s)\n",
 			__FILE__, CONFIG_RTC_HCTOSYS_DEVICE);
-		return -ENODEV;
+		goto err_open;
 	}
 
 	err = rtc_read_time(rtc, &tm);
-	if (err == 0) {
-		err = rtc_valid_tm(&tm);
-		if (err == 0) {
-			struct timespec tv;
+	if (err) {
+		dev_err(rtc->dev.parent,
+			"hctosys: unable to read the hardware clock\n");
+		goto err_read;
 
-			tv.tv_nsec = NSEC_PER_SEC >> 1;
+	}
 
-			rtc_tm_to_time(&tm, &tv.tv_sec);
+	err = rtc_valid_tm(&tm);
+	if (err) {
+		dev_err(rtc->dev.parent,
+			"hctosys: invalid date/time\n");
+		goto err_invalid;
+	}
 
-			do_settimeofday(&tv);
+	rtc_tm_to_time(&tm, &tv.tv_sec);
 
-			dev_info(rtc->dev.parent,
-				"setting system clock to "
-				"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
-				tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
-				tm.tm_hour, tm.tm_min, tm.tm_sec,
-				(unsigned int) tv.tv_sec);
-		}
-		else
-			dev_err(rtc->dev.parent,
-				"hctosys: invalid date/time\n");
-	}
-	else
-		dev_err(rtc->dev.parent,
-			"hctosys: unable to read the hardware clock\n");
+	do_settimeofday(&tv);
 
+	dev_info(rtc->dev.parent,
+		"setting system clock to "
+		"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
+		tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+		tm.tm_hour, tm.tm_min, tm.tm_sec,
+		(unsigned int) tv.tv_sec);
+
+err_invalid:
+err_read:
 	rtc_class_close(rtc);
 
-	return 0;
+err_open:
+	rtc_hctosys_ret = err;
+
+	return err;
 }
 
 late_initcall(rtc_hctosys);
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 60f88a7..14dbc83 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year)
 	return (!(year % 4) && (year % 100)) || !(year % 400);
 }
 
+#ifdef CONFIG_RTC_HCTOSYS
+extern int rtc_hctosys_ret;
+#else
+#define rtc_hctosys_ret -ENODEV
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_RTC_H_ */
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] rtc/hctosys: only claim the RTC provided the system time if it did
  2010-02-08 21:10 [PATCH] rtc/hctosys: only claim the RTC provided the system time if it did Uwe Kleine-König
@ 2010-02-08 21:21 ` Uwe Kleine-König
  2010-02-11 10:52 ` [PATCH RESEND] " Uwe Kleine-König
  1 sibling, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2010-02-08 21:21 UTC (permalink / raw)
  To: rtc-linux; +Cc: Paul Gortmaker, Alessandro Zummo, Andrew Morton, linux-kernel

Hello,

On Mon, Feb 08, 2010 at 10:10:18PM +0100, Uwe Kleine-König wrote:
> Moreover change error handling in rtc_hctosys() to use goto and so
> reduce the indention level.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
>  drivers/rtc/hctosys.c |   59 ++++++++++++++++++++++++++++--------------------
>  include/linux/rtc.h   |    6 +++++
>  2 files changed, 40 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
> index 33c0e98..bc90b09 100644
> --- a/drivers/rtc/hctosys.c
> +++ b/drivers/rtc/hctosys.c
> @@ -22,48 +22,57 @@
>   * the best guess is to add 0.5s.
>   */
>  
> +int rtc_hctosys_ret = -ENODEV;
> +
>  static int __init rtc_hctosys(void)
>  {
> -	int err;
> +	int err = -ENODEV;
>  	struct rtc_time tm;
> +	struct timespec tv = {
> +		.tv_nsec = NSEC_PER_SEC >> 1,
> +	};
>  	struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
>  
>  	if (rtc == NULL) {
> -		printk("%s: unable to open rtc device (%s)\n",
> +		pr_err("%s: unable to open rtc device (%s)\n",
>  			__FILE__, CONFIG_RTC_HCTOSYS_DEVICE);
> -		return -ENODEV;
> +		goto err_open;
>  	}
>  
>  	err = rtc_read_time(rtc, &tm);
> -	if (err == 0) {
> -		err = rtc_valid_tm(&tm);
> -		if (err == 0) {
> -			struct timespec tv;
> +	if (err) {
> +		dev_err(rtc->dev.parent,
> +			"hctosys: unable to read the hardware clock\n");
> +		goto err_read;
>  
> -			tv.tv_nsec = NSEC_PER_SEC >> 1;
> +	}
>  
> -			rtc_tm_to_time(&tm, &tv.tv_sec);
> +	err = rtc_valid_tm(&tm);
> +	if (err) {
> +		dev_err(rtc->dev.parent,
> +			"hctosys: invalid date/time\n");
> +		goto err_invalid;
> +	}
>  
> -			do_settimeofday(&tv);
> +	rtc_tm_to_time(&tm, &tv.tv_sec);
>  
> -			dev_info(rtc->dev.parent,
> -				"setting system clock to "
> -				"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
> -				tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
> -				tm.tm_hour, tm.tm_min, tm.tm_sec,
> -				(unsigned int) tv.tv_sec);
> -		}
> -		else
> -			dev_err(rtc->dev.parent,
> -				"hctosys: invalid date/time\n");
> -	}
> -	else
> -		dev_err(rtc->dev.parent,
> -			"hctosys: unable to read the hardware clock\n");
> +	do_settimeofday(&tv);
>  
> +	dev_info(rtc->dev.parent,
> +		"setting system clock to "
> +		"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
> +		tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
> +		tm.tm_hour, tm.tm_min, tm.tm_sec,
> +		(unsigned int) tv.tv_sec);
> +
> +err_invalid:
> +err_read:
>  	rtc_class_close(rtc);
>  
> -	return 0;
> +err_open:
> +	rtc_hctosys_ret = err;
> +
> +	return err;
>  }
>  
>  late_initcall(rtc_hctosys);
> diff --git a/include/linux/rtc.h b/include/linux/rtc.h
> index 60f88a7..14dbc83 100644
> --- a/include/linux/rtc.h
> +++ b/include/linux/rtc.h
> @@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year)
>  	return (!(year % 4) && (year % 100)) || !(year % 400);
>  }
>  
> +#ifdef CONFIG_RTC_HCTOSYS
> +extern int rtc_hctosys_ret;
> +#else
> +#define rtc_hctosys_ret -ENODEV
> +#endif
> +
>  #endif /* __KERNEL__ */
>  
>  #endif /* _LINUX_RTC_H_ */
oops, I missed a hunk here, namely:

diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 7dd23a6..380083c 100644
--- a/drivers/rtc/rtc-sysfs.c
+++ b/drivers/rtc/rtc-sysfs.c
@@ -107,8 +107,9 @@ rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
 		char *buf)
 {
 #ifdef CONFIG_RTC_HCTOSYS_DEVICE
-	if (strcmp(dev_name(&to_rtc_device(dev)->dev),
-		   CONFIG_RTC_HCTOSYS_DEVICE) == 0)
+	if (rtc_hctosys_ret == 0 &&
+			strcmp(dev_name(&to_rtc_device(dev)->dev),
+				CONFIG_RTC_HCTOSYS_DEVICE) == 0)
 		return sprintf(buf, "1\n");
 	else
 #endif

-- 
Pengutronix e.K.                              | Uwe Kleine-König            |
Industrial Linux Solutions                    | http://www.pengutronix.de/  |

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH RESEND] rtc/hctosys: only claim the RTC provided the system time if it did
  2010-02-08 21:10 [PATCH] rtc/hctosys: only claim the RTC provided the system time if it did Uwe Kleine-König
  2010-02-08 21:21 ` Uwe Kleine-König
@ 2010-02-11 10:52 ` Uwe Kleine-König
  2010-02-11 10:57   ` [rtc-linux] " Alessandro Zummo
  1 sibling, 1 reply; 6+ messages in thread
From: Uwe Kleine-König @ 2010-02-11 10:52 UTC (permalink / raw)
  To: rtc-linux; +Cc: Paul Gortmaker, Alessandro Zummo, Andrew Morton, linux-kernel

Moreover change error handling in rtc_hctosys() to use goto and so
reduce the indention level.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this time the patch is complete.

What do you think about it?

Best regards
Uwe

 drivers/rtc/hctosys.c   |   59 +++++++++++++++++++++++++++--------------------
 drivers/rtc/rtc-sysfs.c |    5 ++-
 include/linux/rtc.h     |    6 ++++
 3 files changed, 43 insertions(+), 27 deletions(-)

diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
index 33c0e98..bc90b09 100644
--- a/drivers/rtc/hctosys.c
+++ b/drivers/rtc/hctosys.c
@@ -22,48 +22,57 @@
  * the best guess is to add 0.5s.
  */
 
+int rtc_hctosys_ret = -ENODEV;
+
 static int __init rtc_hctosys(void)
 {
-	int err;
+	int err = -ENODEV;
 	struct rtc_time tm;
+	struct timespec tv = {
+		.tv_nsec = NSEC_PER_SEC >> 1,
+	};
 	struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
 
 	if (rtc == NULL) {
-		printk("%s: unable to open rtc device (%s)\n",
+		pr_err("%s: unable to open rtc device (%s)\n",
 			__FILE__, CONFIG_RTC_HCTOSYS_DEVICE);
-		return -ENODEV;
+		goto err_open;
 	}
 
 	err = rtc_read_time(rtc, &tm);
-	if (err == 0) {
-		err = rtc_valid_tm(&tm);
-		if (err == 0) {
-			struct timespec tv;
+	if (err) {
+		dev_err(rtc->dev.parent,
+			"hctosys: unable to read the hardware clock\n");
+		goto err_read;
 
-			tv.tv_nsec = NSEC_PER_SEC >> 1;
+	}
 
-			rtc_tm_to_time(&tm, &tv.tv_sec);
+	err = rtc_valid_tm(&tm);
+	if (err) {
+		dev_err(rtc->dev.parent,
+			"hctosys: invalid date/time\n");
+		goto err_invalid;
+	}
 
-			do_settimeofday(&tv);
+	rtc_tm_to_time(&tm, &tv.tv_sec);
 
-			dev_info(rtc->dev.parent,
-				"setting system clock to "
-				"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
-				tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
-				tm.tm_hour, tm.tm_min, tm.tm_sec,
-				(unsigned int) tv.tv_sec);
-		}
-		else
-			dev_err(rtc->dev.parent,
-				"hctosys: invalid date/time\n");
-	}
-	else
-		dev_err(rtc->dev.parent,
-			"hctosys: unable to read the hardware clock\n");
+	do_settimeofday(&tv);
 
+	dev_info(rtc->dev.parent,
+		"setting system clock to "
+		"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
+		tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
+		tm.tm_hour, tm.tm_min, tm.tm_sec,
+		(unsigned int) tv.tv_sec);
+
+err_invalid:
+err_read:
 	rtc_class_close(rtc);
 
-	return 0;
+err_open:
+	rtc_hctosys_ret = err;
+
+	return err;
 }
 
 late_initcall(rtc_hctosys);
diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
index 7dd23a6..380083c 100644
--- a/drivers/rtc/rtc-sysfs.c
+++ b/drivers/rtc/rtc-sysfs.c
@@ -107,8 +107,9 @@ rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
 		char *buf)
 {
 #ifdef CONFIG_RTC_HCTOSYS_DEVICE
-	if (strcmp(dev_name(&to_rtc_device(dev)->dev),
-		   CONFIG_RTC_HCTOSYS_DEVICE) == 0)
+	if (rtc_hctosys_ret == 0 &&
+			strcmp(dev_name(&to_rtc_device(dev)->dev),
+				CONFIG_RTC_HCTOSYS_DEVICE) == 0)
 		return sprintf(buf, "1\n");
 	else
 #endif
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index 60f88a7..14dbc83 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year)
 	return (!(year % 4) && (year % 100)) || !(year % 400);
 }
 
+#ifdef CONFIG_RTC_HCTOSYS
+extern int rtc_hctosys_ret;
+#else
+#define rtc_hctosys_ret -ENODEV
+#endif
+
 #endif /* __KERNEL__ */
 
 #endif /* _LINUX_RTC_H_ */
-- 
1.6.6


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [rtc-linux] [PATCH RESEND] rtc/hctosys: only claim the RTC provided  the system time if it did
  2010-02-11 10:52 ` [PATCH RESEND] " Uwe Kleine-König
@ 2010-02-11 10:57   ` Alessandro Zummo
  2010-02-11 22:42     ` Andrew Morton
  0 siblings, 1 reply; 6+ messages in thread
From: Alessandro Zummo @ 2010-02-11 10:57 UTC (permalink / raw)
  To: rtc-linux; +Cc: u.kleine-koenig, Paul Gortmaker, Andrew Morton, linux-kernel

On Thu, 11 Feb 2010 11:52:29 +0100
Uwe Kleine-König <u.kleine-koenig@pengutronix.de> wrote:


> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> this time the patch is complete.
> 
> What do you think about it?

 looks nice but I'll have to give a deeper look.
 will probably queue for the next merge window
 

> 
> Best regards
> Uwe
> 
>  drivers/rtc/hctosys.c   |   59 +++++++++++++++++++++++++++--------------------
>  drivers/rtc/rtc-sysfs.c |    5 ++-
>  include/linux/rtc.h     |    6 ++++
>  3 files changed, 43 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/rtc/hctosys.c b/drivers/rtc/hctosys.c
> index 33c0e98..bc90b09 100644
> --- a/drivers/rtc/hctosys.c
> +++ b/drivers/rtc/hctosys.c
> @@ -22,48 +22,57 @@
>   * the best guess is to add 0.5s.
>   */
>  
> +int rtc_hctosys_ret = -ENODEV;
> +
>  static int __init rtc_hctosys(void)
>  {
> -	int err;
> +	int err = -ENODEV;
>  	struct rtc_time tm;
> +	struct timespec tv = {
> +		.tv_nsec = NSEC_PER_SEC >> 1,
> +	};
>  	struct rtc_device *rtc = rtc_class_open(CONFIG_RTC_HCTOSYS_DEVICE);
>  
>  	if (rtc == NULL) {
> -		printk("%s: unable to open rtc device (%s)\n",
> +		pr_err("%s: unable to open rtc device (%s)\n",
>  			__FILE__, CONFIG_RTC_HCTOSYS_DEVICE);
> -		return -ENODEV;
> +		goto err_open;
>  	}
>  
>  	err = rtc_read_time(rtc, &tm);
> -	if (err == 0) {
> -		err = rtc_valid_tm(&tm);
> -		if (err == 0) {
> -			struct timespec tv;
> +	if (err) {
> +		dev_err(rtc->dev.parent,
> +			"hctosys: unable to read the hardware clock\n");
> +		goto err_read;
>  
> -			tv.tv_nsec = NSEC_PER_SEC >> 1;
> +	}
>  
> -			rtc_tm_to_time(&tm, &tv.tv_sec);
> +	err = rtc_valid_tm(&tm);
> +	if (err) {
> +		dev_err(rtc->dev.parent,
> +			"hctosys: invalid date/time\n");
> +		goto err_invalid;
> +	}
>  
> -			do_settimeofday(&tv);
> +	rtc_tm_to_time(&tm, &tv.tv_sec);
>  
> -			dev_info(rtc->dev.parent,
> -				"setting system clock to "
> -				"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
> -				tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
> -				tm.tm_hour, tm.tm_min, tm.tm_sec,
> -				(unsigned int) tv.tv_sec);
> -		}
> -		else
> -			dev_err(rtc->dev.parent,
> -				"hctosys: invalid date/time\n");
> -	}
> -	else
> -		dev_err(rtc->dev.parent,
> -			"hctosys: unable to read the hardware clock\n");
> +	do_settimeofday(&tv);
>  
> +	dev_info(rtc->dev.parent,
> +		"setting system clock to "
> +		"%d-%02d-%02d %02d:%02d:%02d UTC (%u)\n",
> +		tm.tm_year + 1900, tm.tm_mon + 1, tm.tm_mday,
> +		tm.tm_hour, tm.tm_min, tm.tm_sec,
> +		(unsigned int) tv.tv_sec);
> +
> +err_invalid:
> +err_read:
>  	rtc_class_close(rtc);
>  
> -	return 0;
> +err_open:
> +	rtc_hctosys_ret = err;
> +
> +	return err;
>  }
>  
>  late_initcall(rtc_hctosys);
> diff --git a/drivers/rtc/rtc-sysfs.c b/drivers/rtc/rtc-sysfs.c
> index 7dd23a6..380083c 100644
> --- a/drivers/rtc/rtc-sysfs.c
> +++ b/drivers/rtc/rtc-sysfs.c
> @@ -107,8 +107,9 @@ rtc_sysfs_show_hctosys(struct device *dev, struct device_attribute *attr,
>  		char *buf)
>  {
>  #ifdef CONFIG_RTC_HCTOSYS_DEVICE
> -	if (strcmp(dev_name(&to_rtc_device(dev)->dev),
> -		   CONFIG_RTC_HCTOSYS_DEVICE) == 0)
> +	if (rtc_hctosys_ret == 0 &&
> +			strcmp(dev_name(&to_rtc_device(dev)->dev),
> +				CONFIG_RTC_HCTOSYS_DEVICE) == 0)
>  		return sprintf(buf, "1\n");
>  	else
>  #endif
> diff --git a/include/linux/rtc.h b/include/linux/rtc.h
> index 60f88a7..14dbc83 100644
> --- a/include/linux/rtc.h
> +++ b/include/linux/rtc.h
> @@ -238,6 +238,12 @@ static inline bool is_leap_year(unsigned int year)
>  	return (!(year % 4) && (year % 100)) || !(year % 400);
>  }
>  
> +#ifdef CONFIG_RTC_HCTOSYS
> +extern int rtc_hctosys_ret;
> +#else
> +#define rtc_hctosys_ret -ENODEV
> +#endif
> +
>  #endif /* __KERNEL__ */
>  
>  #endif /* _LINUX_RTC_H_ */
> -- 
> 1.6.6
> 
> -- 
> You received this message because you are subscribed to "rtc-linux".
> Membership options at http://groups.google.com/group/rtc-linux .
> Please read http://groups.google.com/group/rtc-linux/web/checklist
> before submitting a driver.


-- 

 Best regards,

 Alessandro Zummo,
  Tower Technologies - Torino, Italy

  http://www.towertech.it


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rtc-linux] [PATCH RESEND] rtc/hctosys: only claim the RTC provided  the system time if it did
  2010-02-11 10:57   ` [rtc-linux] " Alessandro Zummo
@ 2010-02-11 22:42     ` Andrew Morton
  2010-02-12  8:52       ` Uwe Kleine-König
  0 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2010-02-11 22:42 UTC (permalink / raw)
  To: Alessandro Zummo; +Cc: rtc-linux, u.kleine-koenig, Paul Gortmaker, linux-kernel

On Thu, 11 Feb 2010 11:57:00 +0100
Alessandro Zummo <a.zummo@towertech.it> wrote:

> On Thu, 11 Feb 2010 11:52:29 +0100
> Uwe Kleine-K__nig <u.kleine-koenig@pengutronix.de> wrote:
> 
> 
> > Signed-off-by: Uwe Kleine-K__nig <u.kleine-koenig@pengutronix.de>
> > ---
> > Hello,
> > 
> > this time the patch is complete.
> > 
> > What do you think about it?

I do dislike having to trawl through the patch trying to work out what
the changelog forgot to tell me.

What problem is being fixed here?

What is the user-observable manifestation of that problem?

How does the patch fix it?

Stuff like that!

>  looks nice but I'll have to give a deeper look.
>  will probably queue for the next merge window

I merged it with a "needs Alessandro ack" note-to-self.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [rtc-linux] [PATCH RESEND] rtc/hctosys: only claim the RTC provided  the system time if it did
  2010-02-11 22:42     ` Andrew Morton
@ 2010-02-12  8:52       ` Uwe Kleine-König
  0 siblings, 0 replies; 6+ messages in thread
From: Uwe Kleine-König @ 2010-02-12  8:52 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Alessandro Zummo, rtc-linux, Paul Gortmaker, linux-kernel

Hello Andrew,

On Thu, Feb 11, 2010 at 02:42:40PM -0800, Andrew Morton wrote:
> On Thu, 11 Feb 2010 11:57:00 +0100
> Alessandro Zummo <a.zummo@towertech.it> wrote:
> 
> > On Thu, 11 Feb 2010 11:52:29 +0100
> > Uwe Kleine-K__nig <u.kleine-koenig@pengutronix.de> wrote:
> > 
> > 
> > > Signed-off-by: Uwe Kleine-K__nig <u.kleine-koenig@pengutronix.de>
> > > ---
> > > Hello,
> > > 
> > > this time the patch is complete.
> > > 
> > > What do you think about it?
> 
> I do dislike having to trawl through the patch trying to work out what
> the changelog forgot to tell me.
> 
> What problem is being fixed here?
> 
> What is the user-observable manifestation of that problem?
> 
> How does the patch fix it?
> 
> Stuff like that!
What do you think about:

---->8----
rtc/hctosys: only claim the RTC provided the system time if it did

Without this patch /sys/class/rtc/$CONFIG_RTC_HCTOSYS_DEVICE/hctosys
contains a 1 (meaning "This rtc was used to initialize the system
clock") even if reading the time at bootup failed.

Moreover change error handling in rtc_hctosys() to use goto and so
reduce the indention level.
---->8----

> >  looks nice but I'll have to give a deeper look.
> >  will probably queue for the next merge window
> 
> I merged it with a "needs Alessandro ack" note-to-self.
fine, thanks
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-12  8:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-08 21:10 [PATCH] rtc/hctosys: only claim the RTC provided the system time if it did Uwe Kleine-König
2010-02-08 21:21 ` Uwe Kleine-König
2010-02-11 10:52 ` [PATCH RESEND] " Uwe Kleine-König
2010-02-11 10:57   ` [rtc-linux] " Alessandro Zummo
2010-02-11 22:42     ` Andrew Morton
2010-02-12  8:52       ` Uwe Kleine-König

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.