* [PATCH v2 02/16] max2165: trival fix for some -Wuninitialized warning
[not found] <1327960820-11867-1-git-send-email-danny.kukawka@bisect.de>
@ 2012-01-30 22:00 ` Danny Kukawka
2012-01-30 22:00 ` [PATCH 05/16] cx18: fix handling of 'radio' module parameter Danny Kukawka
[not found] ` <1327960820-11867-9-git-send-email-danny.kukawka@bisect.de>
2 siblings, 0 replies; 9+ messages in thread
From: Danny Kukawka @ 2012-01-30 22:00 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media, linux-kernel
Fix for some -Wuninitialized compiler warnings.
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/media/common/tuners/max2165.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/media/common/tuners/max2165.c b/drivers/media/common/tuners/max2165.c
index cb2c98f..ba84936 100644
--- a/drivers/media/common/tuners/max2165.c
+++ b/drivers/media/common/tuners/max2165.c
@@ -168,7 +168,7 @@ int fixpt_div32(u32 dividend, u32 divisor, u32 *quotient, u32 *fraction)
int i;
if (0 == divisor)
- return -1;
+ return -EINVAL;
q = dividend / divisor;
remainder = dividend - q * divisor;
@@ -194,10 +194,13 @@ static int max2165_set_rf(struct max2165_priv *priv, u32 freq)
u8 tf_ntch;
u32 t;
u32 quotient, fraction;
+ int ret;
/* Set PLL divider according to RF frequency */
- fixpt_div32(freq / 1000, priv->config->osc_clk * 1000,
- "ient, &fraction);
+ ret = fixpt_div32(freq / 1000, priv->config->osc_clk * 1000,
+ "ient, &fraction);
+ if (ret != 0)
+ return ret;
/* 20-bit fraction */
fraction >>= 12;
--
1.7.7.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 05/16] cx18: fix handling of 'radio' module parameter
[not found] <1327960820-11867-1-git-send-email-danny.kukawka@bisect.de>
2012-01-30 22:00 ` [PATCH v2 02/16] max2165: trival fix for some -Wuninitialized warning Danny Kukawka
@ 2012-01-30 22:00 ` Danny Kukawka
2012-01-31 13:45 ` Danny Kukawka
[not found] ` <1327960820-11867-9-git-send-email-danny.kukawka@bisect.de>
2 siblings, 1 reply; 9+ messages in thread
From: Danny Kukawka @ 2012-01-30 22:00 UTC (permalink / raw)
To: Andy Walls; +Cc: Mauro Carvalho Chehab, ivtv-devel, linux-media, linux-kernel
Fixed handling of 'radio' module parameter from module_param_array
to module_param_named to fix these compiler warnings in cx18-driver.c:
In function ‘__check_radio’:
113:1: warning: return from incompatible pointer type [enabled by default]
At top level:
113:1: warning: initialization from incompatible pointer type [enabled by default]
113:1: warning: (near initialization for ‘__param_arr_radio.num’) [enabled by default]
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/media/video/cx18/cx18-driver.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
index 349bd9c..27b5330 100644
--- a/drivers/media/video/cx18/cx18-driver.c
+++ b/drivers/media/video/cx18/cx18-driver.c
@@ -110,7 +110,7 @@ static int retry_mmio = 1;
int cx18_debug;
module_param_array(tuner, int, &tuner_c, 0644);
-module_param_array(radio, bool, &radio_c, 0644);
+module_param_named(radio, radio_c, bool, 0644);
module_param_array(cardtype, int, &cardtype_c, 0644);
module_param_string(pal, pal, sizeof(pal), 0644);
module_param_string(secam, secam, sizeof(secam), 0644);
--
1.7.7.3
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 05/16] cx18: fix handling of 'radio' module parameter
[not found] ` <1327952458-7424-6-git-send-email-danny.kukawka@bisect.de>
@ 2012-01-31 10:01 ` Andy Walls
2012-01-31 10:13 ` Andy Walls
0 siblings, 1 reply; 9+ messages in thread
From: Andy Walls @ 2012-01-31 10:01 UTC (permalink / raw)
To: Danny Kukawka, Rusty Russell, mchehab
Cc: Mauro Carvalho Chehab, ivtv-devel, linux-media, linux-kernel
On Mon, 2012-01-30 at 20:40 +0100, Danny Kukawka wrote:
> Fixed handling of 'radio' module parameter from module_param_array
> to module_param_named to fix these compiler warnings in cx18-driver.c:
NACK.
"radio" is an array of tristate values (-1, 0, 1) per installed card:
static int radio[CX18_MAX_CARDS] = { -1, -1,
and must remain an array or you will break the driver.
Calling "radio_c" a module parameter named "radio" is wrong.
The correct fix is to reverse Rusty Russel's patch to the driver in
commit 90ab5ee94171b3e28de6bb42ee30b527014e0be7
to change the "bool" back to an "int" as it should be in
"module_param_array(radio, ...)"
Regards,
Andy
> In function ‘__check_radio’:
> 113:1: warning: return from incompatible pointer type [enabled by default]
> At top level:
> 113:1: warning: initialization from incompatible pointer type [enabled by default]
> 113:1: warning: (near initialization for ‘__param_arr_radio.num’) [enabled by default]
>
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
> ---
> drivers/media/video/cx18/cx18-driver.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
> index 349bd9c..27b5330 100644
> --- a/drivers/media/video/cx18/cx18-driver.c
> +++ b/drivers/media/video/cx18/cx18-driver.c
> @@ -110,7 +110,7 @@ static int retry_mmio = 1;
> int cx18_debug;
>
> module_param_array(tuner, int, &tuner_c, 0644);
> -module_param_array(radio, bool, &radio_c, 0644);
> +module_param_named(radio, radio_c, bool, 0644);
> module_param_array(cardtype, int, &cardtype_c, 0644);
> module_param_string(pal, pal, sizeof(pal), 0644);
> module_param_string(secam, secam, sizeof(secam), 0644);
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 05/16] cx18: fix handling of 'radio' module parameter
2012-01-31 10:01 ` [PATCH 05/16] cx18: " Andy Walls
@ 2012-01-31 10:13 ` Andy Walls
0 siblings, 0 replies; 9+ messages in thread
From: Andy Walls @ 2012-01-31 10:13 UTC (permalink / raw)
To: Danny Kukawka
Cc: Rusty Russell, mchehab, Mauro Carvalho Chehab, ivtv-devel,
linux-media, linux-kernel
On Tue, 2012-01-31 at 05:01 -0500, Andy Walls wrote:
> On Mon, 2012-01-30 at 20:40 +0100, Danny Kukawka wrote:
> > Fixed handling of 'radio' module parameter from module_param_array
> > to module_param_named to fix these compiler warnings in cx18-driver.c:
>
> NACK.
>
> "radio" is an array of tristate values (-1, 0, 1) per installed card:
>
> static int radio[CX18_MAX_CARDS] = { -1, -1,
>
> and must remain an array or you will break the driver.
>
> Calling "radio_c" a module parameter named "radio" is wrong.
>
> The correct fix is to reverse Rusty Russel's patch to the driver in
> commit 90ab5ee94171b3e28de6bb42ee30b527014e0be7
> to change the "bool" back to an "int" as it should be in
^^^^
Sorry, a typo here. Disregard the word "back".
Regards,
Andy
> "module_param_array(radio, ...)"
>
> Regards,
> Andy
>
> > In function ‘__check_radio’:
> > 113:1: warning: return from incompatible pointer type [enabled by default]
> > At top level:
> > 113:1: warning: initialization from incompatible pointer type [enabled by default]
> > 113:1: warning: (near initialization for ‘__param_arr_radio.num’) [enabled by default]
> >
> > Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
> > ---
> > drivers/media/video/cx18/cx18-driver.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/media/video/cx18/cx18-driver.c b/drivers/media/video/cx18/cx18-driver.c
> > index 349bd9c..27b5330 100644
> > --- a/drivers/media/video/cx18/cx18-driver.c
> > +++ b/drivers/media/video/cx18/cx18-driver.c
> > @@ -110,7 +110,7 @@ static int retry_mmio = 1;
> > int cx18_debug;
> >
> > module_param_array(tuner, int, &tuner_c, 0644);
> > -module_param_array(radio, bool, &radio_c, 0644);
> > +module_param_named(radio, radio_c, bool, 0644);
> > module_param_array(cardtype, int, &cardtype_c, 0644);
> > module_param_string(pal, pal, sizeof(pal), 0644);
> > module_param_string(secam, secam, sizeof(secam), 0644);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 05/16] cx18: fix handling of 'radio' module parameter
2012-01-30 22:00 ` [PATCH 05/16] cx18: fix handling of 'radio' module parameter Danny Kukawka
@ 2012-01-31 13:45 ` Danny Kukawka
2012-01-31 14:59 ` Andy Walls
2012-02-01 2:29 ` Rusty Russell
0 siblings, 2 replies; 9+ messages in thread
From: Danny Kukawka @ 2012-01-31 13:45 UTC (permalink / raw)
To: Andy Walls
Cc: Mauro Carvalho Chehab, ivtv-devel, linux-media, linux-kernel,
Rusty Russell, mchehab
On Dienstag, 31. Januar 2012, Andy Walls wrote:
> On Tue, 2012-01-31 at 05:01 -0500, Andy Walls wrote:
> > On Mon, 2012-01-30 at 20:40 +0100, Danny Kukawka wrote:
> > > Fixed handling of 'radio' module parameter from module_param_array
> > > to module_param_named to fix these compiler warnings in cx18-driver.c:
> >
> > NACK.
> >
> > "radio" is an array of tristate values (-1, 0, 1) per installed card:
> >
> > static int radio[CX18_MAX_CARDS] = { -1, -1,
> >
> > and must remain an array or you will break the driver.
> >
> > Calling "radio_c" a module parameter named "radio" is wrong.
> >
> > The correct fix is to reverse Rusty Russel's patch to the driver in
> > commit 90ab5ee94171b3e28de6bb42ee30b527014e0be7
> > to change the "bool" back to an "int" as it should be in
>
> ^^^^
> Sorry, a typo here. Disregard the word "back".
Overseen this. But wouldn't be the correct fix in this case to:
a) reverse the part of 90ab5ee94171b3e28de6bb42ee30b527014e0be7 to:
get:
static unsigned radio_c = 1;
b) change the following line:
module_param_array(radio, bool, &radio_c, 0644);
to:
module_param_array(radio, int, &radio_c, 0644);
Without b) you would get a warning from the compiler again.
Danny
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 08/16] ivtv-driver: fix handling of 'radio' module parameter
[not found] ` <1327960820-11867-9-git-send-email-danny.kukawka@bisect.de>
@ 2012-01-31 13:45 ` Danny Kukawka
2012-01-31 15:00 ` Andy Walls
0 siblings, 1 reply; 9+ messages in thread
From: Danny Kukawka @ 2012-01-31 13:45 UTC (permalink / raw)
To: Andy Walls
Cc: ivtv-devel, linux-media, linux-kernel, mchehab, Rusty Russell,
Mauro Carvalho Chehab
On Dienstag, 31. Januar 2012, Andy Walls wrote:
> On Mon, 2012-01-30 at 20:40 +0100, Danny Kukawka wrote:
> > Fixed handling of 'radio' module parameter from module_param_array
> > to module_param_named to fix these compiler warnings in ivtv-driver.c:
> >
> > In function ‘__check_radio’:
> > 113:1: warning: return from incompatible pointer type [enabled by
> > default] At top level:
> > 113:1: warning: initialization from incompatible pointer type [enabled by
> > default] 113:1: warning: (near initialization for
> > ‘__param_arr_radio.num’) [enabled by default]
> >
> > Set initial state of radio_c to true instead of 1.
>
> NACK.
>
> "radio" is an array of tristate values (-1, 0, 1) per installed card:
>
> static int radio[IVTV_MAX_CARDS] = { -1, -1,
>
> and must remain an array or you will break the driver.
>
> Calling "radio_c" a module parameter named "radio" is wrong.
>
> The correct fix is to reverse Rusty Russel's patch to the driver in
> commit 90ab5ee94171b3e28de6bb42ee30b527014e0be7
> to change the "bool" to an "int" as it should be in
> "module_param_array(radio, ...)"
Overseen this. But wouldn't be the correct fix in this case to:
a) reverse the part of 90ab5ee94171b3e28de6bb42ee30b527014e0be7 to get:
static unsigned int radio_c = 1;
b) change the following line:
module_param_array(radio, bool, &radio_c, 0644);
to:
module_param_array(radio, int, &radio_c, 0644);
Without b) you would get a warning from the compiler again.
Danny
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 05/16] cx18: fix handling of 'radio' module parameter
2012-01-31 13:45 ` Danny Kukawka
@ 2012-01-31 14:59 ` Andy Walls
2012-02-01 2:29 ` Rusty Russell
1 sibling, 0 replies; 9+ messages in thread
From: Andy Walls @ 2012-01-31 14:59 UTC (permalink / raw)
To: Danny Kukawka
Cc: Mauro Carvalho Chehab, ivtv-devel, linux-media, linux-kernel,
Rusty Russell, mchehab
Danny Kukawka <danny.kukawka@bisect.de> wrote:
>On Dienstag, 31. Januar 2012, Andy Walls wrote:
>> On Tue, 2012-01-31 at 05:01 -0500, Andy Walls wrote:
>> > On Mon, 2012-01-30 at 20:40 +0100, Danny Kukawka wrote:
>> > > Fixed handling of 'radio' module parameter from
>module_param_array
>> > > to module_param_named to fix these compiler warnings in
>cx18-driver.c:
>> >
>> > NACK.
>> >
>> > "radio" is an array of tristate values (-1, 0, 1) per installed
>card:
>> >
>> > static int radio[CX18_MAX_CARDS] = { -1, -1,
>> >
>> > and must remain an array or you will break the driver.
>> >
>> > Calling "radio_c" a module parameter named "radio" is wrong.
>> >
>> > The correct fix is to reverse Rusty Russel's patch to the driver in
>> > commit 90ab5ee94171b3e28de6bb42ee30b527014e0be7
>> > to change the "bool" back to an "int" as it should be in
>>
>> ^^^^
>> Sorry, a typo here. Disregard the word "back".
>
>Overseen this. But wouldn't be the correct fix in this case to:
>a) reverse the part of 90ab5ee94171b3e28de6bb42ee30b527014e0be7 to:
> get:
> static unsigned radio_c = 1;
>
>b) change the following line:
> module_param_array(radio, bool, &radio_c, 0644);
> to:
> module_param_array(radio, int, &radio_c, 0644);
>
>Without b) you would get a warning from the compiler again.
>
>Danny
Yes, both need to happen.
I mentioned b) at the end of my original email.
Regards,
Andy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH v2 08/16] ivtv-driver: fix handling of 'radio' module parameter
2012-01-31 13:45 ` [PATCH v2 08/16] ivtv-driver: " Danny Kukawka
@ 2012-01-31 15:00 ` Andy Walls
0 siblings, 0 replies; 9+ messages in thread
From: Andy Walls @ 2012-01-31 15:00 UTC (permalink / raw)
To: Danny Kukawka
Cc: ivtv-devel, linux-media, linux-kernel, mchehab, Rusty Russell,
Mauro Carvalho Chehab
Danny Kukawka <danny.kukawka@bisect.de> wrote:
>On Dienstag, 31. Januar 2012, Andy Walls wrote:
>> On Mon, 2012-01-30 at 20:40 +0100, Danny Kukawka wrote:
>> > Fixed handling of 'radio' module parameter from module_param_array
>> > to module_param_named to fix these compiler warnings in
>ivtv-driver.c:
>> >
>> > In function ‘__check_radio’:
>> > 113:1: warning: return from incompatible pointer type [enabled by
>> > default] At top level:
>> > 113:1: warning: initialization from incompatible pointer type
>[enabled by
>> > default] 113:1: warning: (near initialization for
>> > ‘__param_arr_radio.num’) [enabled by default]
>> >
>> > Set initial state of radio_c to true instead of 1.
>>
>> NACK.
>>
>> "radio" is an array of tristate values (-1, 0, 1) per installed card:
>>
>> static int radio[IVTV_MAX_CARDS] = { -1, -1,
>>
>> and must remain an array or you will break the driver.
>>
>> Calling "radio_c" a module parameter named "radio" is wrong.
>>
>> The correct fix is to reverse Rusty Russel's patch to the driver in
>> commit 90ab5ee94171b3e28de6bb42ee30b527014e0be7
>> to change the "bool" to an "int" as it should be in
>> "module_param_array(radio, ...)"
>
>Overseen this. But wouldn't be the correct fix in this case to:
>a) reverse the part of 90ab5ee94171b3e28de6bb42ee30b527014e0be7 to get:
> static unsigned int radio_c = 1;
>
>b) change the following line:
> module_param_array(radio, bool, &radio_c, 0644);
> to:
> module_param_array(radio, int, &radio_c, 0644);
>
>Without b) you would get a warning from the compiler again.
>
>Danny
Yes both need to happen.
I mentioned b) in my original email.
Regards,
Andy
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 05/16] cx18: fix handling of 'radio' module parameter
2012-01-31 13:45 ` Danny Kukawka
2012-01-31 14:59 ` Andy Walls
@ 2012-02-01 2:29 ` Rusty Russell
1 sibling, 0 replies; 9+ messages in thread
From: Rusty Russell @ 2012-02-01 2:29 UTC (permalink / raw)
To: Danny Kukawka, Andy Walls
Cc: Mauro Carvalho Chehab, ivtv-devel, linux-media, linux-kernel,
mchehab
On Tue, 31 Jan 2012 14:45:18 +0100, Danny Kukawka <danny.kukawka@bisect.de> wrote:
> On Dienstag, 31. Januar 2012, Andy Walls wrote:
> Overseen this. But wouldn't be the correct fix in this case to:
> a) reverse the part of 90ab5ee94171b3e28de6bb42ee30b527014e0be7 to:
> get:
> static unsigned radio_c = 1;
>
> b) change the following line:
> module_param_array(radio, bool, &radio_c, 0644);
> to:
> module_param_array(radio, int, &radio_c, 0644);
Yes, sorry, my patch was complete crap here :(
If you want people to set it only to 1 or 0, you probably want "bint".
Thanks,
Rusty.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2012-02-01 3:44 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1327960820-11867-1-git-send-email-danny.kukawka@bisect.de>
2012-01-30 22:00 ` [PATCH v2 02/16] max2165: trival fix for some -Wuninitialized warning Danny Kukawka
2012-01-30 22:00 ` [PATCH 05/16] cx18: fix handling of 'radio' module parameter Danny Kukawka
2012-01-31 13:45 ` Danny Kukawka
2012-01-31 14:59 ` Andy Walls
2012-02-01 2:29 ` Rusty Russell
[not found] ` <1327960820-11867-9-git-send-email-danny.kukawka@bisect.de>
2012-01-31 13:45 ` [PATCH v2 08/16] ivtv-driver: " Danny Kukawka
2012-01-31 15:00 ` Andy Walls
[not found] <1327952458-7424-1-git-send-email-danny.kukawka@bisect.de>
[not found] ` <1327952458-7424-6-git-send-email-danny.kukawka@bisect.de>
2012-01-31 10:01 ` [PATCH 05/16] cx18: " Andy Walls
2012-01-31 10:13 ` Andy Walls
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox