aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc/rtc-at91sam9.c
diff options
context:
space:
mode:
authorJulia Lawall <julia@diku.dk>2010-03-05 16:44:23 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-03-06 14:26:47 -0500
commit870a2761a8df7dea7449b4225c9babcf22c6ead4 (patch)
tree6cec2579973aad15acfad14f48733585be7a85f2 /drivers/rtc/rtc-at91sam9.c
parentb51e8293182764ca7b1a1bdb28a5c5dc60152c76 (diff)
rtc-at91sam9: Correct size given to memset
Memset should be given the size of the structure, not the size of the pointer. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ type T; T *x; expression E; @@ memset(x, E, sizeof( + * x)) // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/rtc/rtc-at91sam9.c')
-rw-r--r--drivers/rtc/rtc-at91sam9.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-at91sam9.c b/drivers/rtc/rtc-at91sam9.c
index 86c61f143515..78a018b5c941 100644
--- a/drivers/rtc/rtc-at91sam9.c
+++ b/drivers/rtc/rtc-at91sam9.c
@@ -161,7 +161,7 @@ static int at91_rtc_readalarm(struct device *dev, struct rtc_wkalrm *alrm)
161 if (offset == 0) 161 if (offset == 0)
162 return -EILSEQ; 162 return -EILSEQ;
163 163
164 memset(alrm, 0, sizeof(alrm)); 164 memset(alrm, 0, sizeof(*alrm));
165 if (alarm != ALARM_DISABLED && offset != 0) { 165 if (alarm != ALARM_DISABLED && offset != 0) {
166 rtc_time_to_tm(offset + alarm, tm); 166 rtc_time_to_tm(offset + alarm, tm);
167 167