From: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
To: Joe Perches <joe@perches.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Andrew Morton <akpm@linux-foundation.org>,
Stephen Rothwell <sfr@canb.auug.org.au>,
linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [git pull] IDE fixes
Date: Wed, 22 Apr 2009 21:43:46 +0200 [thread overview]
Message-ID: <200904222143.47220.bzolnier@gmail.com> (raw)
In-Reply-To: <1240427207.21848.81.camel@localhost>
On Wednesday 22 April 2009 21:06:47 Joe Perches wrote:
> On Wed, 2009-04-22 at 20:48 +0200, Bartlomiej Zolnierkiewicz wrote:
> > diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
> > index 3aec19d..3d4e099 100644
> > --- a/drivers/ide/ide-cd.c
> > +++ b/drivers/ide/ide-cd.c
> > @@ -609,7 +609,7 @@ static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
> > struct request *rq = hwif->rq;
> > ide_expiry_t *expiry = NULL;
> > int dma_error = 0, dma, thislen, uptodate = 0;
> > - int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc, nsectors;
> > + int write = (rq_data_dir(rq) == WRITE) ? 1 : 0, rc = 0, nsectors;
> > int sense = blk_sense_request(rq);
> > unsigned int timeout;
> > u16 len;
>
> I think ide is the only subsystem to use the
> initialization style of "?:," with additional
> declarations.
Well, nothing wrong with it per se.
> Would it be better to use a more standard style?
>
> maybe:
> int dma_error = 0, dma, thislen, uptodate = 0, rc = 0, nsectors;
> int write = ((rq_data_dir(rq) == WRITE) ? 1 : 0;
Personally I would prefer:
int write = !!(rq_data_dir(rq) == WRITE);
However the old code is also fine with me.
> > diff --git a/drivers/ide/palm_bk3710.c b/drivers/ide/palm_bk3710.c
> > index c7acca0..d1513b4 100644
> > --- a/drivers/ide/palm_bk3710.c
> > +++ b/drivers/ide/palm_bk3710.c
> []
> > @@ -75,13 +67,19 @@ struct palm_bk3710_udmatiming {
> >
> > static unsigned ideclk_period; /* in nanoseconds */
> >
> > +struct palm_bk3710_udmatiming {
> > + unsigned int rptime; /* tRP -- Ready to pause time (nsec) */
> > + unsigned int cycletime; /* tCYCTYP2/2 -- avg Cycle Time (nsec) */
> > + /* tENV is always a minimum of 20 nsec */
> > +};
> > +
> > static const struct palm_bk3710_udmatiming palm_bk3710_udmatimings[6] = {
> > - {160, 240}, /* UDMA Mode 0 */
> > - {125, 160}, /* UDMA Mode 1 */
> > - {100, 120}, /* UDMA Mode 2 */
> > - {100, 90}, /* UDMA Mode 3 */
> > - {100, 60}, /* UDMA Mode 4 */
> > - {85, 40}, /* UDMA Mode 5 */
> > + {160, 240 / 2,}, /* UDMA Mode 0 */
> > + {125, 160 / 2,}, /* UDMA Mode 1 */
> > + {100, 120 / 2,}, /* UDMA Mode 2 */
> > + {100, 90 / 2,}, /* UDMA Mode 3 */
> > + {100, 60 / 2,}, /* UDMA Mode 4 */
> > + {85, 40 / 2,}, /* UDMA Mode 5 */
> > };
> >
> > static void palm_bk3710_setudmamode(void __iomem *base, unsigned int dev,
>
> Odd looking commas.
>
> Maybe:
>
> {.rptime = 160, .cycletime = 240 / 2 }, /* UDMA Mode 0 */
> etc.
I really don't consider this an improvement from readability perspective
and I also don't like the added code duplication...
IMO we should just remove extra commas and add some whitespaces.
I have also more general (process oriented) comment:
All patches have been posted to linux-kernel or linux-ide for review before
and it is _much_ more efficient to raise issues (including CodingStyle ones)
during "review phase" instead of during "push to Linus" phase.
Thanks,
Bart
next prev parent reply other threads:[~2009-04-22 19:40 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-22 18:48 [git pull] IDE fixes Bartlomiej Zolnierkiewicz
2009-04-22 19:06 ` Joe Perches
2009-04-22 19:22 ` Sam Ravnborg
2009-04-22 19:43 ` Bartlomiej Zolnierkiewicz [this message]
2009-04-22 19:55 ` Joe Perches
2009-04-22 21:41 ` Bartlomiej Zolnierkiewicz
2009-04-22 22:02 ` Ray Lee
2009-04-22 22:51 ` Bartlomiej Zolnierkiewicz
2009-04-22 22:58 ` Bartlomiej Zolnierkiewicz
-- strict thread matches above, loose matches on Subject: below --
2009-06-07 12:44 Bartlomiej Zolnierkiewicz
2009-06-07 14:21 ` Alan Cox
2009-06-07 14:32 ` Bartlomiej Zolnierkiewicz
2009-06-07 14:40 ` Alan Cox
2009-06-07 15:03 ` Bartlomiej Zolnierkiewicz
2009-06-07 15:11 ` Alan Cox
2009-06-07 14:38 ` James Bottomley
2009-06-07 14:57 ` Bartlomiej Zolnierkiewicz
2009-06-07 15:18 ` James Bottomley
2009-06-07 15:44 ` Bartlomiej Zolnierkiewicz
2009-06-07 16:08 ` James Bottomley
2009-06-07 17:47 ` Bartlomiej Zolnierkiewicz
2009-06-07 19:08 ` James Bottomley
2009-06-07 19:23 ` Bartlomiej Zolnierkiewicz
2009-06-07 20:07 ` Alan Cox
2009-06-07 20:39 ` James Bottomley
2009-06-07 21:08 ` Bartlomiej Zolnierkiewicz
2009-06-07 20:42 ` Bartlomiej Zolnierkiewicz
2009-06-07 16:54 ` Pekka Enberg
2009-06-07 17:55 ` Bartlomiej Zolnierkiewicz
2009-06-07 18:21 ` Pekka Enberg
2009-06-07 19:00 ` Bartlomiej Zolnierkiewicz
2009-06-07 19:09 ` Pekka Enberg
2009-06-07 19:25 ` Bartlomiej Zolnierkiewicz
2009-06-07 23:15 ` Linus Torvalds
2009-06-07 23:47 ` Bartlomiej Zolnierkiewicz
2009-06-07 23:57 ` Linus Torvalds
2009-06-08 0:54 ` Bartlomiej Zolnierkiewicz
2009-06-07 23:14 ` Linus Torvalds
2009-06-07 23:12 ` Linus Torvalds
2009-05-22 15:17 Bartlomiej Zolnierkiewicz
2009-05-16 19:16 Bartlomiej Zolnierkiewicz
2009-05-16 19:22 ` Borislav Petkov
2009-05-16 19:33 ` Bartlomiej Zolnierkiewicz
2009-04-18 16:09 Bartlomiej Zolnierkiewicz
2009-03-13 20:49 Bartlomiej Zolnierkiewicz
2009-03-05 15:30 Bartlomiej Zolnierkiewicz
2009-03-05 16:27 ` Bartlomiej Zolnierkiewicz
2009-02-25 19:54 Bartlomiej Zolnierkiewicz
2009-02-02 19:48 Bartlomiej Zolnierkiewicz
2009-01-19 12:50 Bartlomiej Zolnierkiewicz
2008-12-22 22:08 Bartlomiej Zolnierkiewicz
2008-12-08 16:55 Bartlomiej Zolnierkiewicz
2008-10-05 16:38 Bartlomiej Zolnierkiewicz
2008-09-27 17:47 Bartlomiej Zolnierkiewicz
2008-09-10 20:47 Bartlomiej Zolnierkiewicz
2008-09-02 18:24 Bartlomiej Zolnierkiewicz
2008-08-18 20:22 Bartlomiej Zolnierkiewicz
2008-07-08 17:38 Bartlomiej Zolnierkiewicz
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=200904222143.47220.bzolnier@gmail.com \
--to=bzolnier@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-ide@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
--cc=torvalds@linux-foundation.org \
/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;
as well as URLs for NNTP newsgroup(s).