Prev: perf trace: get rid of the hard-coded paths in the report scripts
Next: fs, block: propagate REQ_FLUSH/FUA interface to upper layers
From: Geert Uytterhoeven on 12 Aug 2010 17:30 On Wed, Aug 11, 2010 at 18:59, Linux Kernel Mailing List <linux-kernel(a)vger.kernel.org> wrote: > Gitweb: http://git.kernel.org/linus/b485fe5ea1008db02abff9ef15be4f31b52df4f7 > rtc/m41t80: use rtc_valid_tm() to check returned tm > > Use rtc_valid_tm() to check returned struct rtc_time *tm - it can avoid > returning wrong tm value. > diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c > index 6dc4e62..66377f3 100644 > --- a/drivers/rtc/rtc-m41t80.c > +++ b/drivers/rtc/rtc-m41t80.c > @@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) > t->time.tm_isdst = -1; > t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE); > t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF); > - return 0; > + return rtc_valid_tm(t); warning: passing argument 1 of 'rtc_valid_tm' from incompatible pointer type `t' is of type `struct rtc_wkalrm *', not `struct rtc_time *'. Probably the intention was: return rtc_valid_tm(&t->time); ?? > } Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert(a)linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Wan ZongShun on 12 Aug 2010 21:50
2010/8/13 Geert Uytterhoeven <geert(a)linux-m68k.org>: > On Wed, Aug 11, 2010 at 18:59, Linux Kernel Mailing List > <linux-kernel(a)vger.kernel.org> wrote: >> Gitweb: http://git.kernel.org/linus/b485fe5ea1008db02abff9ef15be4f31b52df4f7 > >> rtc/m41t80: use rtc_valid_tm() to check returned tm >> >> Use rtc_valid_tm() to check returned struct rtc_time *tm - it can avoid >> returning wrong tm value. > >> diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c >> index 6dc4e62..66377f3 100644 >> --- a/drivers/rtc/rtc-m41t80.c >> +++ b/drivers/rtc/rtc-m41t80.c > >> @@ -364,7 +364,7 @@ static int m41t80_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *t) >> t->time.tm_isdst = -1; >> t->enabled = !!(reg[M41T80_REG_ALARM_MON] & M41T80_ALMON_AFE); >> t->pending = !!(reg[M41T80_REG_FLAGS] & M41T80_FLAGS_AF); >> - return 0; >> + return rtc_valid_tm(t); > > warning: passing argument 1 of 'rtc_valid_tm' from incompatible pointer type > > `t' is of type `struct rtc_wkalrm *', not `struct rtc_time *'. > Probably the intention was: > > return rtc_valid_tm(&t->time); Okay, thank you point this warning. Andrew , Could you please fix this warning directly for me? 'return rtc_valid_tm(t)' should be insteaded by 'return rtc_valid_tm(&t->time);'. thanks! > > ?? > >> } > > Gr{oetje,eeting}s, > > Geert > > -- > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert(a)linux-m68k.org > > In personal conversations with technical people, I call myself a hacker. But > when I'm talking to journalists I just say "programmer" or something like that. > -- Linus Torvalds > -- *linux-arm-kernel mailing list mail addr:linux-arm-kernel(a)lists.infradead.org you can subscribe by: http://lists.infradead.org/mailman/listinfo/linux-arm-kernel * linux-arm-NUC900 mailing list mail addr:NUC900(a)googlegroups.com main web: https://groups.google.com/group/NUC900 you can subscribe it by sending me mail: mcuos.com(a)gmail.com -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |