public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Ribeiro <drwyrm@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com,
	linux-kernel@vger.kernel.org, openezx-devel@lists.openezx.org,
	sameo@linux.intel.com
Subject: Re: [PATCH] PCAP RTC driver (for 2.6.32).
Date: Fri, 26 Jun 2009 20:57:38 -0300	[thread overview]
Message-ID: <1246060658.10360.336.camel@brutus> (raw)
In-Reply-To: <20090626132310.60665a98.akpm@linux-foundation.org>

[-- Attachment #1: Type: text/plain, Size: 2258 bytes --]

Hi Andrew,

Em Sex, 2009-06-26 às 13:23 -0700, Andrew Morton escreveu:
> 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;

This would make gcc complain about rtc_events being used uninitialized.

> SEC_PER_DAY is defined in include/linux/mfd/ezx-pcap.h.  It should not
> be, because it is not specific to that driver and can be used elsewhere
> in the kernel.
> 
> I'd suggest that we
> 
> - define SECS_PER_DAY in include/linux/time.h
> 
> - remove the private definitions of SECS_PER_DAY from
>   arch/m68k/mac/misc, arch/parisc/include/asm/rtc.h,
>   arch/ia64/hp/sim/boot/fw-emu.c, fs/udf/udftime.c, fs/fat/misc.c and
>   wherever else it appears, make those files use the common definition
> 
> - migrate rtc-pcap.c from SEC_PER_DAY over to the common SECS_PER_DAY.
> 
> - Then do it all again for SECS_PER_MIN and SECS_PER_HOUR.
> 
> 
> What a mess.

I can't work on this right now, but i will be happy to reserve some
hours for this next month if nobody else does it before.

> "tmp" is a poor identifier.  We had an opportunity here to use an
> identifier which would communicate useful information to the reader. 
> But we blew it and used the information-free "tmp" instead.
> 
> Something like
> 
> 	u32 time_of_day;	/* In seconds since midnight */
> 
> would be nice.  If that is indeed what the variable contains.  How
> would I know?  It's called 'tmp" and is undescribed!

Hum.. I used tmp because the variable is reused and it may be "days
since 1/1/1970" or "seconds since today's 00:00:00". I will add some
comments to make this clear.

> > +static inline int pcap_rtc_irq_enable(struct device *dev, int pirq,
> > +							unsigned int en)
> > +{
> Inlining this function probably made the code larger and slower.

Right, i will amend this.


I see that you have already added it to the -mm tree. Do you prefer an
incremental patch to address your comments or should I send a patch to
replace the current version?

Thanks for the review! :)

-- 
Daniel Ribeiro

[-- Attachment #2: Esta é uma parte de mensagem assinada digitalmente --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

  parent reply	other threads:[~2009-06-26 23:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-25 20:45 [PATCH] PCAP RTC driver (for 2.6.32) Daniel Ribeiro
2009-06-25 20:53 ` [rtc-linux] " Alessandro Zummo
2009-06-25 21:16   ` Daniel Ribeiro
2009-06-25 21:21     ` [rtc-linux] " Alessandro Zummo
2009-06-26 20:23 ` Andrew Morton
2009-06-26 20:33   ` Joe Perches
2009-06-26 23:57   ` Daniel Ribeiro [this message]
2009-06-27  0:12     ` Andrew Morton
2009-06-27  3:50       ` [PATCHv2] " Daniel Ribeiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1246060658.10360.336.camel@brutus \
    --to=drwyrm@gmail.com \
    --cc=a.zummo@towertech.it \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openezx-devel@lists.openezx.org \
    --cc=rtc-linux@googlegroups.com \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox