Mailing List Archive

[PATCH v2 08/16] ivtv-driver: fix handling of 'radio' module parameter
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.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/media/video/ivtv/ivtv-driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 3949b7d..dbd78d5 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -99,7 +99,7 @@ static int i2c_clock_period[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,

static unsigned int cardtype_c = 1;
static unsigned int tuner_c = 1;
-static bool radio_c = 1;
+static bool radio_c = true;
static unsigned int i2c_clock_period_c = 1;
static char pal[] = "---";
static char secam[] = "--";
@@ -139,7 +139,7 @@ static int tunertype = -1;
static int newi2c = -1;

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


_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel
[PATCH v2 08/16] ivtv-driver: fix handling of 'radio' module parameter [ In reply to ]
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.

Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/media/video/ivtv/ivtv-driver.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
index 3949b7d..dbd78d5 100644
--- a/drivers/media/video/ivtv/ivtv-driver.c
+++ b/drivers/media/video/ivtv/ivtv-driver.c
@@ -99,7 +99,7 @@ static int i2c_clock_period[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,

static unsigned int cardtype_c = 1;
static unsigned int tuner_c = 1;
-static bool radio_c = 1;
+static bool radio_c = true;
static unsigned int i2c_clock_period_c = 1;
static char pal[] = "---";
static char secam[] = "--";
@@ -139,7 +139,7 @@ static int tunertype = -1;
static int newi2c = -1;

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


_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel
Re: [PATCH v2 08/16] ivtv-driver: fix handling of 'radio' module parameter [ In reply to ]
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, ...)"

Regards,
Andy


> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
> ---
> drivers/media/video/ivtv/ivtv-driver.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c
> index 3949b7d..dbd78d5 100644
> --- a/drivers/media/video/ivtv/ivtv-driver.c
> +++ b/drivers/media/video/ivtv/ivtv-driver.c
> @@ -99,7 +99,7 @@ static int i2c_clock_period[IVTV_MAX_CARDS] = { -1, -1, -1, -1, -1, -1, -1, -1,
>
> static unsigned int cardtype_c = 1;
> static unsigned int tuner_c = 1;
> -static bool radio_c = 1;
> +static bool radio_c = true;
> static unsigned int i2c_clock_period_c = 1;
> static char pal[] = "---";
> static char secam[] = "--";
> @@ -139,7 +139,7 @@ static int tunertype = -1;
> static int newi2c = -1;
>
> 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);



_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel
Re: [PATCH v2 08/16] ivtv-driver: fix handling of 'radio' module parameter [ In reply to ]
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

_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel
Re: [PATCH v2 08/16] ivtv-driver: fix handling of 'radio' module parameter [ In reply to ]
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

_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel