* [PATCH] more work_struct mess
@ 2006-12-08 9:16 Al Viro
2006-12-09 11:25 ` Olaf Hering
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Al Viro @ 2006-12-08 9:16 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-kernel
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c
index f227c9f..2f21a3c 100644
--- a/sound/oss/dmasound/tas3001c.c
+++ b/sound/oss/dmasound/tas3001c.c
@@ -50,6 +50,7 @@ struct tas3001c_data_t {
int output_id;
int speaker_id;
struct tas_drce_t drce_state;
+ struct work_struct change;
};
@@ -667,14 +668,13 @@ tas3001c_update_device_parameters(struct
}
static void
-tas3001c_device_change_handler(void *self)
+tas3001c_device_change_handler(struct work_struct *work)
{
- if (self)
- tas3001c_update_device_parameters(self);
+ struct tas3001c_data_t *self;
+ self = container_of(work, struct tas3001c_data_t, change);
+ tas3001c_update_device_parameters(self);
}
-static struct work_struct device_change;
-
static int
tas3001c_output_device_change( struct tas3001c_data_t *self,
int device_id,
@@ -685,7 +685,7 @@ tas3001c_output_device_change( struct ta
self->output_id=output_id;
self->speaker_id=speaker_id;
- schedule_work(&device_change);
+ schedule_work(&self->change);
return 0;
}
@@ -823,7 +823,7 @@ tas3001c_init(struct i2c_client *client)
tas3001c_write_biquad_shadow(self, i, j,
&tas3001c_eq_unity);
- INIT_WORK(&device_change, tas3001c_device_change_handler, self);
+ INIT_WORK(&self->change, tas3001c_device_change_handler);
return 0;
}
diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c
index 82eaaca..af34fb3 100644
--- a/sound/oss/dmasound/tas3004.c
+++ b/sound/oss/dmasound/tas3004.c
@@ -48,6 +48,7 @@ struct tas3004_data_t {
int output_id;
int speaker_id;
struct tas_drce_t drce_state;
+ struct work_struct change;
};
#define MAKE_TIME(sec,usec) (((sec)<<12) + (50000+(usec/10)*(1<<12))/100000)
@@ -914,15 +915,13 @@ tas3004_update_device_parameters(struct
}
static void
-tas3004_device_change_handler(void *self)
+tas3004_device_change_handler(struct work_struct *work)
{
- if (!self) return;
-
- tas3004_update_device_parameters((struct tas3004_data_t *)self);
+ struct tas3004_data_t *self;
+ self = container_of(work, struct tas3004_data_t, change);
+ tas3004_update_device_parameters(self);
}
-static struct work_struct device_change;
-
static int
tas3004_output_device_change( struct tas3004_data_t *self,
int device_id,
@@ -933,7 +932,7 @@ tas3004_output_device_change( struct tas
self->output_id=output_id;
self->speaker_id=speaker_id;
- schedule_work(&device_change);
+ schedule_work(&self->change);
return 0;
}
@@ -1112,7 +1111,7 @@ tas3004_init(struct i2c_client *client)
tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW);
tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW);
- INIT_WORK(&device_change, tas3004_device_change_handler, self);
+ INIT_WORK(&self->change, tas3004_device_change_handler);
return 0;
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] more work_struct mess
2006-12-08 9:16 [PATCH] more work_struct mess Al Viro
@ 2006-12-09 11:25 ` Olaf Hering
2006-12-09 18:04 ` Al Viro
2006-12-11 0:48 ` Benjamin Herrenschmidt
2006-12-18 0:35 ` Benjamin Herrenschmidt
2 siblings, 1 reply; 6+ messages in thread
From: Olaf Hering @ 2006-12-09 11:25 UTC (permalink / raw)
To: Al Viro; +Cc: Linus Torvalds, linux-kernel
On Fri, Dec 08, Al Viro wrote:
> +++ b/sound/oss/dmasound/tas3001c.c
> @@ -823,7 +823,7 @@ tas3001c_init(struct i2c_client *client)
> tas3001c_write_biquad_shadow(self, i, j,
> &tas3001c_eq_unity);
>
> - INIT_WORK(&device_change, tas3001c_device_change_handler, self);
> + INIT_WORK(&self->change, tas3001c_device_change_handler);
> +++ b/sound/oss/dmasound/tas3004.c
> @@ -1112,7 +1111,7 @@ tas3004_init(struct i2c_client *client)
> tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW);
> tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW);
>
> - INIT_WORK(&device_change, tas3004_device_change_handler, self);
> + INIT_WORK(&self->change, tas3004_device_change_handler);
This is not enough to get it going:
error: 'INIT_WORK' undeclared (first use in this function)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] more work_struct mess
2006-12-09 11:25 ` Olaf Hering
@ 2006-12-09 18:04 ` Al Viro
2006-12-09 20:26 ` Olaf Hering
0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2006-12-09 18:04 UTC (permalink / raw)
To: Olaf Hering; +Cc: Linus Torvalds, linux-kernel
On Sat, Dec 09, 2006 at 12:25:10PM +0100, Olaf Hering wrote:
> This is not enough to get it going:
>
> error: 'INIT_WORK' undeclared (first use in this function)
.config?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] more work_struct mess
2006-12-09 18:04 ` Al Viro
@ 2006-12-09 20:26 ` Olaf Hering
0 siblings, 0 replies; 6+ messages in thread
From: Olaf Hering @ 2006-12-09 20:26 UTC (permalink / raw)
To: Al Viro; +Cc: Linus Torvalds, linux-kernel
On Sat, Dec 09, Al Viro wrote:
> On Sat, Dec 09, 2006 at 12:25:10PM +0100, Olaf Hering wrote:
> > This is not enough to get it going:
> >
> > error: 'INIT_WORK' undeclared (first use in this function)
>
> .config?
Its a gcc bug. It doesnt like the number of arguments for INIT_WORK,
then it appearently tries to evaluate INIT_WORK again, or whatever.
sound/oss/dmasound/tas3001c.c:826:64: error: macro "INIT_WORK" passed 3 arguments, but takes just 2
sound/oss/dmasound/tas3001c.c: In function 'tas3001c_init':
sound/oss/dmasound/tas3001c.c:826: error: 'INIT_WORK' undeclared (first use in this function)
Your patch will fix it.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] more work_struct mess
2006-12-08 9:16 [PATCH] more work_struct mess Al Viro
2006-12-09 11:25 ` Olaf Hering
@ 2006-12-11 0:48 ` Benjamin Herrenschmidt
2006-12-18 0:35 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2006-12-11 0:48 UTC (permalink / raw)
To: Al Viro; +Cc: Linus Torvalds, linux-kernel
On Fri, 2006-12-08 at 09:16 +0000, Al Viro wrote:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Ben.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] more work_struct mess
2006-12-08 9:16 [PATCH] more work_struct mess Al Viro
2006-12-09 11:25 ` Olaf Hering
2006-12-11 0:48 ` Benjamin Herrenschmidt
@ 2006-12-18 0:35 ` Benjamin Herrenschmidt
2 siblings, 0 replies; 6+ messages in thread
From: Benjamin Herrenschmidt @ 2006-12-18 0:35 UTC (permalink / raw)
To: Al Viro; +Cc: Linus Torvalds, linux-kernel
On Fri, 2006-12-08 at 09:16 +0000, Al Viro wrote:
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
---
Please merge, right now, pmac32_defconfig is busted. I'm tempted to
mark dmasound_pmac for removal soon too ...
Ben.
> ---
> diff --git a/sound/oss/dmasound/tas3001c.c b/sound/oss/dmasound/tas3001c.c
> index f227c9f..2f21a3c 100644
> --- a/sound/oss/dmasound/tas3001c.c
> +++ b/sound/oss/dmasound/tas3001c.c
> @@ -50,6 +50,7 @@ struct tas3001c_data_t {
> int output_id;
> int speaker_id;
> struct tas_drce_t drce_state;
> + struct work_struct change;
> };
>
>
> @@ -667,14 +668,13 @@ tas3001c_update_device_parameters(struct
> }
>
> static void
> -tas3001c_device_change_handler(void *self)
> +tas3001c_device_change_handler(struct work_struct *work)
> {
> - if (self)
> - tas3001c_update_device_parameters(self);
> + struct tas3001c_data_t *self;
> + self = container_of(work, struct tas3001c_data_t, change);
> + tas3001c_update_device_parameters(self);
> }
>
> -static struct work_struct device_change;
> -
> static int
> tas3001c_output_device_change( struct tas3001c_data_t *self,
> int device_id,
> @@ -685,7 +685,7 @@ tas3001c_output_device_change( struct ta
> self->output_id=output_id;
> self->speaker_id=speaker_id;
>
> - schedule_work(&device_change);
> + schedule_work(&self->change);
> return 0;
> }
>
> @@ -823,7 +823,7 @@ tas3001c_init(struct i2c_client *client)
> tas3001c_write_biquad_shadow(self, i, j,
> &tas3001c_eq_unity);
>
> - INIT_WORK(&device_change, tas3001c_device_change_handler, self);
> + INIT_WORK(&self->change, tas3001c_device_change_handler);
> return 0;
> }
>
> diff --git a/sound/oss/dmasound/tas3004.c b/sound/oss/dmasound/tas3004.c
> index 82eaaca..af34fb3 100644
> --- a/sound/oss/dmasound/tas3004.c
> +++ b/sound/oss/dmasound/tas3004.c
> @@ -48,6 +48,7 @@ struct tas3004_data_t {
> int output_id;
> int speaker_id;
> struct tas_drce_t drce_state;
> + struct work_struct change;
> };
>
> #define MAKE_TIME(sec,usec) (((sec)<<12) + (50000+(usec/10)*(1<<12))/100000)
> @@ -914,15 +915,13 @@ tas3004_update_device_parameters(struct
> }
>
> static void
> -tas3004_device_change_handler(void *self)
> +tas3004_device_change_handler(struct work_struct *work)
> {
> - if (!self) return;
> -
> - tas3004_update_device_parameters((struct tas3004_data_t *)self);
> + struct tas3004_data_t *self;
> + self = container_of(work, struct tas3004_data_t, change);
> + tas3004_update_device_parameters(self);
> }
>
> -static struct work_struct device_change;
> -
> static int
> tas3004_output_device_change( struct tas3004_data_t *self,
> int device_id,
> @@ -933,7 +932,7 @@ tas3004_output_device_change( struct tas
> self->output_id=output_id;
> self->speaker_id=speaker_id;
>
> - schedule_work(&device_change);
> + schedule_work(&self->change);
>
> return 0;
> }
> @@ -1112,7 +1111,7 @@ tas3004_init(struct i2c_client *client)
> tas3004_write_register(self, TAS3004_REG_MCR2, &mcr2, WRITE_SHADOW);
> tas3004_write_register(self, TAS3004_REG_DRC, drce_init, WRITE_SHADOW);
>
> - INIT_WORK(&device_change, tas3004_device_change_handler, self);
> + INIT_WORK(&self->change, tas3004_device_change_handler);
> return 0;
> }
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2006-12-18 0:36 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-12-08 9:16 [PATCH] more work_struct mess Al Viro
2006-12-09 11:25 ` Olaf Hering
2006-12-09 18:04 ` Al Viro
2006-12-09 20:26 ` Olaf Hering
2006-12-11 0:48 ` Benjamin Herrenschmidt
2006-12-18 0:35 ` Benjamin Herrenschmidt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox