Re: [PATCH] PCAP RTC driver (for 2.6.32).

From: Joe Perches
Date: Fri Jun 26 2009 - 16:34:06 EST


On Fri, 2009-06-26 at 13:23 -0700, Andrew Morton wrote:
> > diff -puN /dev/null drivers/rtc/rtc-pcap.c
> > --- /dev/null
> > +++ a/drivers/rtc/rtc-pcap.c
[]
> > +static irqreturn_t pcap_rtc_irq(int irq, void *_pcap_rtc)
> > +{
> > + struct pcap_rtc *pcap_rtc = _pcap_rtc;
> > + unsigned long rtc_events = 0;
> > +
> > + if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ))
> > + rtc_events |= RTC_IRQF | RTC_UF;
> > + else if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA))
> > + rtc_events |= RTC_IRQF | RTC_AF;
> > +
> > + rtc_update_irq(pcap_rtc->rtc, 1, rtc_events);
> > + return IRQ_HANDLED;
> > +}
>
> This could be coded more simply:
>
> unsigned long rtc_events;
>
> if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_1HZ))
> rtc_events = RTC_IRQF | RTC_UF;
> else if (irq == pcap_to_irq(pcap_rtc->pcap, PCAP_IRQ_TODA))
> rtc_events = RTC_IRQF | RTC_AF;

else
rec_events = 0;

> > + rtc_update_irq(pcap_rtc->rtc, 1, rtc_events);
> > + return IRQ_HANDLED;

Does that buy any clarity?


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/