2.1.43 and drivers/char/rtc.c

Thomas Sailer (sailer@ife.ee.ethz.ch)
Wed, 18 Jun 1997 11:17:27 +0200


Someone hacked up rtc.c with a very hot needle, here's
the diff that makes it actually compile :-)

Tom

--- drivers/char/rtc.c.orig Wed Jun 18 10:52:15 1997
+++ drivers/char/rtc.c Wed Jun 18 10:55:47 1997
@@ -152,7 +152,7 @@
unsigned long count)
{
struct wait_queue wait = { current, NULL };
- int retval;
+ int retval = 0;

if (count < sizeof(unsigned long))
return -EINVAL;
@@ -180,7 +180,7 @@
data = rtc_irq_data;
rtc_irq_data = 0;
restore_flags(flags);
- retval = put_user(data, (unsigned long *)buf)) ?: sizeof(unsigned long);
+ retval = put_user(data, (unsigned long *)buf) ?: sizeof(unsigned long);
}

current->state = TASK_RUNNING;
@@ -262,7 +262,6 @@
* "don't care" or "match all". Only the tm_hour,
* tm_min and tm_sec are used.
*/
- int retval;
unsigned char hrs, min, sec;
struct rtc_time alm_tm;

@@ -305,7 +304,6 @@
}
case RTC_SET_TIME: /* Set the RTC */
{
- int retval;
struct rtc_time rtc_tm;
unsigned char mon, day, hrs, min, sec, leap_yr;
unsigned char save_control, save_freq_select;
@@ -418,7 +416,7 @@
default:
return -EINVAL;
}
- return copy_to_user(arg, &wtime, sizeof wtime) ? -EFAULT : 0;
+ return copy_to_user((struct rtc_time *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
}

/*