patch-2.1.45 linux/drivers/char/rtc.c

Next file: linux/drivers/char/tty_io.c
Previous file: linux/drivers/char/random.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.44/linux/drivers/char/rtc.c linux/drivers/char/rtc.c
@@ -180,7 +180,9 @@
 		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); 
+		if (!retval)
+			retval = sizeof(unsigned long); 
 	}
 
 	current->state = TASK_RUNNING;
@@ -262,7 +264,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 +306,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 +418,7 @@
 		default:
 			return -EINVAL;
 	}
-	return copy_to_user(arg, &wtime, sizeof wtime) ? -EFAULT : 0;
+	return copy_to_user((void *)arg, &wtime, sizeof wtime) ? -EFAULT : 0;
 }
 
 /*

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov