linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3/15] i810: fix module_param bool abuse.
@ 2011-12-15  3:03 Rusty Russell
  2011-12-19 23:16 ` Florian Tobias Schandinat
  0 siblings, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2011-12-15  3:03 UTC (permalink / raw)
  To: lkml - Kernel Mailing List
  Cc: Antonino Daplas, Florian Tobias Schandinat, linux-fbdev, Pawel Moll

The driver says "module_param(ddc3, bool, 0);".  But it's not a used
as a bool, it's used as a count.

Make it a bool.

Cc: Antonino Daplas <adaplas@gmail.com>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
---
 drivers/video/i810/i810_main.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -147,7 +147,7 @@ static int vyres      __devinitdata;
 static int sync       __devinitdata;
 static int extvga     __devinitdata;
 static int dcolor     __devinitdata;
-static int ddc3       __devinitdata = 2;
+static bool ddc3      __devinitdata;
 
 /*------------------------------------------------------------*/
 
@@ -1776,7 +1776,7 @@ static void __devinit i810_init_defaults
 	if (sync) 
 		par->dev_flags |= ALWAYS_SYNC;
 
-	par->ddc_num = ddc3;
+	par->ddc_num = (ddc3 ? 3 : 2);
 
 	if (bpp < 8)
 		bpp = 8;
@@ -1999,7 +1999,7 @@ static int __devinit i810fb_setup(char *
 		else if (!strncmp(this_opt, "dcolor", 6))
 			dcolor = 1;
 		else if (!strncmp(this_opt, "ddc3", 4))
-			ddc3 = 3;
+			ddc3 = true;
 		else
 			mode_option = this_opt;
 	}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/15] i810: fix module_param bool abuse.
  2011-12-15  3:03 [PATCH 3/15] i810: fix module_param bool abuse Rusty Russell
@ 2011-12-19 23:16 ` Florian Tobias Schandinat
  2012-01-12 22:57   ` Rusty Russell
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Tobias Schandinat @ 2011-12-19 23:16 UTC (permalink / raw)
  To: Rusty Russell
  Cc: lkml - Kernel Mailing List, Antonino Daplas, linux-fbdev, Pawel Moll

On 12/15/2011 03:03 AM, Rusty Russell wrote:
> The driver says "module_param(ddc3, bool, 0);".  But it's not a used
> as a bool, it's used as a count.
> 
> Make it a bool.
> 
> Cc: Antonino Daplas <adaplas@gmail.com>
> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> Cc: linux-fbdev@vger.kernel.org
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Applied.


Thanks,

Florian Tobias Schandinat

> ---
>  drivers/video/i810/i810_main.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
> --- a/drivers/video/i810/i810_main.c
> +++ b/drivers/video/i810/i810_main.c
> @@ -147,7 +147,7 @@ static int vyres      __devinitdata;
>  static int sync       __devinitdata;
>  static int extvga     __devinitdata;
>  static int dcolor     __devinitdata;
> -static int ddc3       __devinitdata = 2;
> +static bool ddc3      __devinitdata;
>  
>  /*------------------------------------------------------------*/
>  
> @@ -1776,7 +1776,7 @@ static void __devinit i810_init_defaults
>  	if (sync) 
>  		par->dev_flags |= ALWAYS_SYNC;
>  
> -	par->ddc_num = ddc3;
> +	par->ddc_num = (ddc3 ? 3 : 2);
>  
>  	if (bpp < 8)
>  		bpp = 8;
> @@ -1999,7 +1999,7 @@ static int __devinit i810fb_setup(char *
>  		else if (!strncmp(this_opt, "dcolor", 6))
>  			dcolor = 1;
>  		else if (!strncmp(this_opt, "ddc3", 4))
> -			ddc3 = 3;
> +			ddc3 = true;
>  		else
>  			mode_option = this_opt;
>  	}
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/15] i810: fix module_param bool abuse.
  2011-12-19 23:16 ` Florian Tobias Schandinat
@ 2012-01-12 22:57   ` Rusty Russell
  2012-01-12 23:36     ` Florian Tobias Schandinat
  0 siblings, 1 reply; 4+ messages in thread
From: Rusty Russell @ 2012-01-12 22:57 UTC (permalink / raw)
  To: Florian Tobias Schandinat
  Cc: lkml - Kernel Mailing List, Antonino Daplas, linux-fbdev, Pawel Moll

On Mon, 19 Dec 2011 23:16:04 +0000, Florian Tobias Schandinat <FlorianSchandinat@gmx.de> wrote:
> On 12/15/2011 03:03 AM, Rusty Russell wrote:
> > The driver says "module_param(ddc3, bool, 0);".  But it's not a used
> > as a bool, it's used as a count.
> > 
> > Make it a bool.
> > 
> > Cc: Antonino Daplas <adaplas@gmail.com>
> > Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
> > Cc: linux-fbdev@vger.kernel.org
> > Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> 
> Applied.

Hmm, I don't see this in Linus' tree yet, and it's a context-clash
pre-requisite for part of the general driver bool conversion.  I want to
push today since I have linux.conf.au next week, so I've split the i810
conversion into a separate patch, below.

It's been over a week in linux-next, can you push this please?

From: Rusty Russell <rusty@rustcorp.com.au>
Subject: module_param: make bool parameters really bool (drivers/vidio/i810)

module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -135,8 +135,8 @@ static struct pci_driver i810fb_driver =
 static char *mode_option __devinitdata = NULL;
 static int vram       __devinitdata = 4;
 static int bpp        __devinitdata = 8;
-static int mtrr       __devinitdata;
-static int accel      __devinitdata;
+static bool mtrr      __devinitdata;
+static bool accel     __devinitdata;
 static int hsync1     __devinitdata;
 static int hsync2     __devinitdata;
 static int vsync1     __devinitdata;
@@ -144,9 +144,9 @@ static int vsync2     __devinitdata;
 static int xres       __devinitdata;
 static int yres;
 static int vyres      __devinitdata;
-static int sync       __devinitdata;
-static int extvga     __devinitdata;
-static int dcolor     __devinitdata;
+static bool sync      __devinitdata;
+static bool extvga    __devinitdata;
+static bool dcolor    __devinitdata;
 static bool ddc3      __devinitdata;
 
 /*------------------------------------------------------------*/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 3/15] i810: fix module_param bool abuse.
  2012-01-12 22:57   ` Rusty Russell
@ 2012-01-12 23:36     ` Florian Tobias Schandinat
  0 siblings, 0 replies; 4+ messages in thread
From: Florian Tobias Schandinat @ 2012-01-12 23:36 UTC (permalink / raw)
  To: Rusty Russell
  Cc: lkml - Kernel Mailing List, Antonino Daplas, linux-fbdev, Pawel Moll

Hi Rusty,

On 01/12/2012 10:57 PM, Rusty Russell wrote:
> On Mon, 19 Dec 2011 23:16:04 +0000, Florian Tobias Schandinat <FlorianSchandinat@gmx.de> wrote:
>> On 12/15/2011 03:03 AM, Rusty Russell wrote:
>>> The driver says "module_param(ddc3, bool, 0);".  But it's not a used
>>> as a bool, it's used as a count.
>>>
>>> Make it a bool.
>>>
>>> Cc: Antonino Daplas <adaplas@gmail.com>
>>> Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
>>> Cc: linux-fbdev@vger.kernel.org
>>> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
>>
>> Applied.
> 
> Hmm, I don't see this in Linus' tree yet, and it's a context-clash
> pre-requisite for part of the general driver bool conversion.  I want to
> push today since I have linux.conf.au next week, so I've split the i810
> conversion into a separate patch, below.

Sorry for the delay, but with an OMAP pull and a revert this merge window is not
as quiet as I wished.

> It's been over a week in linux-next, can you push this please?

Sure, I've taken it and also fixed the subject.


Best regards,

Florian Tobias Schandinat

> 
> From: Rusty Russell <rusty@rustcorp.com.au>
> Subject: module_param: make bool parameters really bool (drivers/vidio/i810)
> 
> module_param(bool) used to counter-intuitively take an int.  In
> fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
> trick.
> 
> It's time to remove the int/unsigned int option.  For this version
> it'll simply give a warning, but it'll break next kernel version.
> 
> Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
> 
> diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
> --- a/drivers/video/i810/i810_main.c
> +++ b/drivers/video/i810/i810_main.c
> @@ -135,8 +135,8 @@ static struct pci_driver i810fb_driver =
>  static char *mode_option __devinitdata = NULL;
>  static int vram       __devinitdata = 4;
>  static int bpp        __devinitdata = 8;
> -static int mtrr       __devinitdata;
> -static int accel      __devinitdata;
> +static bool mtrr      __devinitdata;
> +static bool accel     __devinitdata;
>  static int hsync1     __devinitdata;
>  static int hsync2     __devinitdata;
>  static int vsync1     __devinitdata;
> @@ -144,9 +144,9 @@ static int vsync2     __devinitdata;
>  static int xres       __devinitdata;
>  static int yres;
>  static int vyres      __devinitdata;
> -static int sync       __devinitdata;
> -static int extvga     __devinitdata;
> -static int dcolor     __devinitdata;
> +static bool sync      __devinitdata;
> +static bool extvga    __devinitdata;
> +static bool dcolor    __devinitdata;
>  static bool ddc3      __devinitdata;
>  
>  /*------------------------------------------------------------*/
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" 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] 4+ messages in thread

end of thread, other threads:[~2012-01-12 23:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-15  3:03 [PATCH 3/15] i810: fix module_param bool abuse Rusty Russell
2011-12-19 23:16 ` Florian Tobias Schandinat
2012-01-12 22:57   ` Rusty Russell
2012-01-12 23:36     ` Florian Tobias Schandinat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).