[U-Boot] [PATCH] common/cmd_ide.c: Coding style cleanup (Lindent)

Wolfgang Denk wd at denx.de
Wed May 13 16:23:57 CEST 2009


Dear Stefan Roese,

In message <200905131620.39726.sr at denx.de> you wrote:
> 
> > > -static void  ide_ident (block_dev_desc_t *dev_desc);
> > > -static uchar ide_wait  (int dev, ulong t);
> > > +static void ide_ident(block_dev_desc_t * dev_desc);
> >
> > And I really hate the space after the '*' in lines like these,
> 
> I don't like then too. I'm wondering why indent didn't do this consistent.
> 
> > especially as it's done more or lessa randomly:
> > > -static void	atapi_inquiry(block_dev_desc_t *dev_desc);
> > > -ulong atapi_read (int device, lbaint_t blknr, ulong blkcnt, void
> > > *buffer); +static void atapi_inquiry(block_dev_desc_t * dev_desc);
> > > +ulong atapi_read(int device, lbaint_t blknr, ulong blkcnt, void
> > > *buffer);
> >
> > We have "* dev_desc", but "*buffer" ? That's just bogus.
> >
> > > -	printf ("\nLoading from IDE device %d, partition %d: "
> > > -		"Name: %.32s  Type: %.32s\n",
> > > -		dev, part, info.name, info.type);
> > > +	printf("\nLoading from IDE device %d, partition %d: "
> > > +	       "Name: %.32s  Type: %.32s\n", dev, part, info.name, info.type);
> >
> > Also, reordering the lines here makes the code more difficult to read.
> >
> > > -	if (ide_dev_desc[dev].block_read (dev, info.start, 1, (ulong *)addr) !=
> > > 1) { -		printf ("** Read error on %d:%d\n", dev, part);
> > > -		show_boot_progress (-48);
> > > +	if (ide_dev_desc[dev].block_read(dev, info.start, 1, (ulong *) addr) !=
> > > 1) {
> >
> > Why is there a space after the cast?
> 
> No idea. I'll try to remove all those spaces.

I can only speculate that Lindent understands about basic data types
(void *, int *, etc.), and inserts NO space there, but it does not
understand things like "ulong" or "block_dev_desc_t" and does insert a
space there.

Why this would make any sense to anybody I cannot tell.

> OK, I'll try to fix all those issues and resubmit a new version.

Thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Computers are not intelligent.  They only think they are.


More information about the U-Boot mailing list