* small IDE cleanup: void * should not be used unless neccessary
@ 2002-02-11 22:09 Pavel Machek
2002-02-12 22:50 ` Rob Landley
2002-02-12 23:02 ` Rob Radez
0 siblings, 2 replies; 11+ messages in thread
From: Pavel Machek @ 2002-02-11 22:09 UTC (permalink / raw)
To: Jens Axboe, kernel list
Hi!
This is really easy, please apply. (It will allow me to kill few casts
in future).
Pavel
--- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
+++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
@@ -529,7 +531,7 @@
typedef struct hwif_s {
struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
- void *hwgroup; /* actually (ide_hwgroup_t *) */
+ struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
hw_regs_t hw; /* Hardware info */
ide_drive_t drives[MAX_DRIVES]; /* drive info */
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-11 22:09 small IDE cleanup: void * should not be used unless neccessary Pavel Machek
@ 2002-02-12 22:50 ` Rob Landley
2002-02-12 22:57 ` Rob Radez
2002-02-13 10:47 ` Pavel Machek
2002-02-12 23:02 ` Rob Radez
1 sibling, 2 replies; 11+ messages in thread
From: Rob Landley @ 2002-02-12 22:50 UTC (permalink / raw)
To: Pavel Machek, kernel list
On Monday 11 February 2002 05:09 pm, Pavel Machek wrote:
> Hi!
>
> This is really easy, please apply. (It will allow me to kill few casts
> in future).
> Pavel
>
> --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> @@ -529,7 +531,7 @@
>
> typedef struct hwif_s {
> struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> - void *hwgroup; /* actually (ide_hwgroup_t *) */
> + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> hw_regs_t hw; /* Hardware info */
> ide_drive_t drives[MAX_DRIVES]; /* drive info */
Now I'm confused about the comment on the end of the line.
Should the comment be changed, or should the type be ide_hwgroup_t instead of
struct hwgroup_s?
Rob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-12 22:50 ` Rob Landley
@ 2002-02-12 22:57 ` Rob Radez
2002-02-13 10:47 ` Pavel Machek
1 sibling, 0 replies; 11+ messages in thread
From: Rob Radez @ 2002-02-12 22:57 UTC (permalink / raw)
To: Rob Landley; +Cc: kernel list
On Tue, 12 Feb 2002, Rob Landley wrote:
> Now I'm confused about the comment on the end of the line.
>
> Should the comment be changed, or should the type be ide_hwgroup_t instead of
> struct hwgroup_s?
>
> Rob
the ide_hwgroup_t typedef is not declared until later in ide.h
Regards,
Rob Radez
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-11 22:09 small IDE cleanup: void * should not be used unless neccessary Pavel Machek
2002-02-12 22:50 ` Rob Landley
@ 2002-02-12 23:02 ` Rob Radez
2002-02-13 7:29 ` Vojtech Pavlik
2002-02-13 10:46 ` Pavel Machek
1 sibling, 2 replies; 11+ messages in thread
From: Rob Radez @ 2002-02-12 23:02 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list
On Mon, 11 Feb 2002, Pavel Machek wrote:
> Hi!
>
> This is really easy, please apply. (It will allow me to kill few casts
> in future).
> Pavel
>
> --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> @@ -529,7 +531,7 @@
>
> typedef struct hwif_s {
> struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> - void *hwgroup; /* actually (ide_hwgroup_t *) */
> + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> hw_regs_t hw; /* Hardware info */
> ide_drive_t drives[MAX_DRIVES]; /* drive info */
If you're doing this, would it make sense to get rid of the useless casting
of the hwgroup member?
Regards,
Rob Radez
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-12 23:02 ` Rob Radez
@ 2002-02-13 7:29 ` Vojtech Pavlik
2002-02-13 10:46 ` Pavel Machek
1 sibling, 0 replies; 11+ messages in thread
From: Vojtech Pavlik @ 2002-02-13 7:29 UTC (permalink / raw)
To: Rob Radez; +Cc: Pavel Machek, kernel list
On Tue, Feb 12, 2002 at 06:02:16PM -0500, Rob Radez wrote:
>
> On Mon, 11 Feb 2002, Pavel Machek wrote:
>
> > Hi!
> >
> > This is really easy, please apply. (It will allow me to kill few casts
> > in future).
> > Pavel
> >
> > --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> > +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> > @@ -529,7 +531,7 @@
> >
> > typedef struct hwif_s {
> > struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> > - void *hwgroup; /* actually (ide_hwgroup_t *) */
> > + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> > ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> > hw_regs_t hw; /* Hardware info */
> > ide_drive_t drives[MAX_DRIVES]; /* drive info */
>
> If you're doing this, would it make sense to get rid of the useless casting
> of the hwgroup member?
Yes, that's also planned.
--
Vojtech Pavlik
SuSE Labs
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-12 23:02 ` Rob Radez
2002-02-13 7:29 ` Vojtech Pavlik
@ 2002-02-13 10:46 ` Pavel Machek
1 sibling, 0 replies; 11+ messages in thread
From: Pavel Machek @ 2002-02-13 10:46 UTC (permalink / raw)
To: Rob Radez; +Cc: kernel list
Hi!
> > This is really easy, please apply. (It will allow me to kill few casts
> > in future).
> > Pavel
> >
> > --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> > +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> > @@ -529,7 +531,7 @@
> >
> > typedef struct hwif_s {
> > struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> > - void *hwgroup; /* actually (ide_hwgroup_t *) */
> > + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> > ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> > hw_regs_t hw; /* Hardware info */
> > ide_drive_t drives[MAX_DRIVES]; /* drive info */
>
> If you're doing this, would it make sense to get rid of the useless casting
> of the hwgroup member?
You just guessed why I did it ;-).
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-12 22:50 ` Rob Landley
2002-02-12 22:57 ` Rob Radez
@ 2002-02-13 10:47 ` Pavel Machek
2002-02-13 19:39 ` Rob Landley
1 sibling, 1 reply; 11+ messages in thread
From: Pavel Machek @ 2002-02-13 10:47 UTC (permalink / raw)
To: Rob Landley; +Cc: kernel list
Hi!
> > This is really easy, please apply. (It will allow me to kill few casts
> > in future).
> > Pavel
> >
> > --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> > +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> > @@ -529,7 +531,7 @@
> >
> > typedef struct hwif_s {
> > struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> > - void *hwgroup; /* actually (ide_hwgroup_t *) */
> > + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> > ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> > hw_regs_t hw; /* Hardware info */
> > ide_drive_t drives[MAX_DRIVES]; /* drive info */
>
> Now I'm confused about the comment on the end of the line.
>
> Should the comment be changed, or should the type be ide_hwgroup_t instead of
> struct hwgroup_s?
struct hwgroup_s == ide_hwgroup_t. That's infection by hungarian
notation, and yes it would be nice to clean it up. For now, I'm
killing worst stuff.
Pavel
--
Casualities in World Trade Center: ~3k dead inside the building,
cryptography in U.S.A. and free speech in Czech Republic.
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-13 10:47 ` Pavel Machek
@ 2002-02-13 19:39 ` Rob Landley
2002-02-13 22:50 ` Pavel Machek
0 siblings, 1 reply; 11+ messages in thread
From: Rob Landley @ 2002-02-13 19:39 UTC (permalink / raw)
To: Pavel Machek; +Cc: kernel list
On Wednesday 13 February 2002 05:47 am, Pavel Machek wrote:
> Hi!
>
> > > This is really easy, please apply. (It will allow me to kill few casts
> > > in future).
> > > Pavel
> > >
> > > --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> > > +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> > > @@ -529,7 +531,7 @@
> > >
> > > typedef struct hwif_s {
> > > struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> > > - void *hwgroup; /* actually (ide_hwgroup_t *) */
> > > + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> > > ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> > > hw_regs_t hw; /* Hardware info */
> > > ide_drive_t drives[MAX_DRIVES]; /* drive info */
> >
> > Now I'm confused about the comment on the end of the line.
> >
> > Should the comment be changed, or should the type be ide_hwgroup_t
> > instead of struct hwgroup_s?
>
> struct hwgroup_s == ide_hwgroup_t. That's infection by hungarian
> notation, and yes it would be nice to clean it up. For now, I'm
> killing worst stuff.
> Pavel
I know they're functionally equivalent, but so was the original void *. :)
Just an "as long as you're touching this line anyway, why leave the old
comment?" thing. A minor, in-passing nit at best...
Rob
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-13 19:39 ` Rob Landley
@ 2002-02-13 22:50 ` Pavel Machek
2002-02-16 1:08 ` Andre Hedrick
0 siblings, 1 reply; 11+ messages in thread
From: Pavel Machek @ 2002-02-13 22:50 UTC (permalink / raw)
To: Rob Landley; +Cc: kernel list
Hi!
> > > > This is really easy, please apply. (It will allow me to kill few casts
> > > > in future).
> > > > Pavel
> > > >
> > > > --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> > > > +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> > > > @@ -529,7 +531,7 @@
> > > >
> > > > typedef struct hwif_s {
> > > > struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> > > > - void *hwgroup; /* actually (ide_hwgroup_t *) */
> > > > + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> > > > ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> > > > hw_regs_t hw; /* Hardware info */
> > > > ide_drive_t drives[MAX_DRIVES]; /* drive info */
> > >
> > > Now I'm confused about the comment on the end of the line.
> > >
> > > Should the comment be changed, or should the type be ide_hwgroup_t
> > > instead of struct hwgroup_s?
> >
> > struct hwgroup_s == ide_hwgroup_t. That's infection by hungarian
> > notation, and yes it would be nice to clean it up. For now, I'm
> > killing worst stuff.
> > Pavel
>
> I know they're functionally equivalent, but so was the original void
> *. :)
Well, void * hides real errors.
> Just an "as long as you're touching this line anyway, why leave the old
> comment?" thing. A minor, in-passing nit at best...
ide_hwgroup_t is used in 90% of rest of code, so I thought I better
leave it there.
Pavel
--
(about SSSCA) "I don't say this lightly. However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-13 22:50 ` Pavel Machek
@ 2002-02-16 1:08 ` Andre Hedrick
2002-02-16 8:07 ` Vojtech Pavlik
0 siblings, 1 reply; 11+ messages in thread
From: Andre Hedrick @ 2002-02-16 1:08 UTC (permalink / raw)
To: Pavel Machek; +Cc: Rob Landley, kernel list
On Wed, 13 Feb 2002, Pavel Machek wrote:
> Hi!
>
> > > > > This is really easy, please apply. (It will allow me to kill few casts
> > > > > in future).
> > > > > Pavel
> > > > >
> > > > > --- linux/include/linux/ide.h Mon Feb 11 21:15:04 2002
> > > > > +++ linux-dm/include/linux/ide.h Mon Feb 11 22:36:12 2002
> > > > > @@ -529,7 +531,7 @@
> > > > >
> > > > > typedef struct hwif_s {
> > > > > struct hwif_s *next; /* for linked-list in ide_hwgroup_t */
> > > > > - void *hwgroup; /* actually (ide_hwgroup_t *) */
> > > > > + struct hwgroup_s *hwgroup; /* actually (ide_hwgroup_t *) */
> > > > > ide_ioreg_t io_ports[IDE_NR_PORTS]; /* task file registers */
> > > > > hw_regs_t hw; /* Hardware info */
> > > > > ide_drive_t drives[MAX_DRIVES]; /* drive info */
> > > >
> > > > Now I'm confused about the comment on the end of the line.
> > > >
> > > > Should the comment be changed, or should the type be ide_hwgroup_t
> > > > instead of struct hwgroup_s?
> > >
> > > struct hwgroup_s == ide_hwgroup_t. That's infection by hungarian
> > > notation, and yes it would be nice to clean it up. For now, I'm
> > > killing worst stuff.
> > > Pavel
> >
> > I know they're functionally equivalent, but so was the original void
> > *. :)
>
> Well, void * hides real errors.
>
> > Just an "as long as you're touching this line anyway, why leave the old
> > comment?" thing. A minor, in-passing nit at best...
>
> ide_hwgroup_t is used in 90% of rest of code, so I thought I better
> leave it there.
So what do we do with the other 10% break it? Sheesh :-/
Andre Hedrick
Linux Disk Certification Project Linux ATA Development
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: small IDE cleanup: void * should not be used unless neccessary
2002-02-16 1:08 ` Andre Hedrick
@ 2002-02-16 8:07 ` Vojtech Pavlik
0 siblings, 0 replies; 11+ messages in thread
From: Vojtech Pavlik @ 2002-02-16 8:07 UTC (permalink / raw)
To: Andre Hedrick; +Cc: Pavel Machek, Rob Landley, kernel list
On Fri, Feb 15, 2002 at 05:08:20PM -0800, Andre Hedrick wrote:
> > > I know they're functionally equivalent, but so was the original void
> > > *. :)
> >
> > Well, void * hides real errors.
> >
> > > Just an "as long as you're touching this line anyway, why leave the old
> > > comment?" thing. A minor, in-passing nit at best...
> >
> > ide_hwgroup_t is used in 90% of rest of code, so I thought I better
> > leave it there.
>
> So what do we do with the other 10% break it? Sheesh :-/
The other 10% won't break by the change, of course.
--
Vojtech Pavlik
SuSE Labs
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2002-02-16 8:07 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-11 22:09 small IDE cleanup: void * should not be used unless neccessary Pavel Machek
2002-02-12 22:50 ` Rob Landley
2002-02-12 22:57 ` Rob Radez
2002-02-13 10:47 ` Pavel Machek
2002-02-13 19:39 ` Rob Landley
2002-02-13 22:50 ` Pavel Machek
2002-02-16 1:08 ` Andre Hedrick
2002-02-16 8:07 ` Vojtech Pavlik
2002-02-12 23:02 ` Rob Radez
2002-02-13 7:29 ` Vojtech Pavlik
2002-02-13 10:46 ` Pavel Machek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox