* [PATCH] allow vesafb to build when no CONFIG_MTRR
@ 2005-06-21 10:07 Jan Beulich
2005-06-21 11:14 ` Gerd Knorr
0 siblings, 1 reply; 3+ messages in thread
From: Jan Beulich @ 2005-06-21 10:07 UTC (permalink / raw)
To: Gerd Knorr; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1764 bytes --]
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
vesafb didn't build when CONFIG_MTRR wasn't set.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- /home/jbeulich/tmp/linux-2.6.12/drivers/video/vesafb.c 2005-06-17 21:48:29.000000000 +0200
+++ 2.6.12/drivers/video/vesafb.c 2005-06-21 09:56:14.572032960 +0200
@@ -45,7 +45,9 @@ static struct fb_fix_screeninfo vesafb_f
};
static int inverse = 0;
+#ifdef CONFIG_MTRR
static int mtrr = 1;
+#endif
static int vram_remap __initdata = 0; /* Set amount of memory to be used */
static int vram_total __initdata = 0; /* Set total amount of memory */
static int pmi_setpal = 0; /* pmi for palette changes ??? */
@@ -204,10 +206,12 @@ static int __init vesafb_setup(char *opt
pmi_setpal=0;
else if (! strcmp(this_opt, "pmipal"))
pmi_setpal=1;
+#ifdef CONFIG_MTRR
else if (! strcmp(this_opt, "mtrr"))
mtrr=1;
else if (! strcmp(this_opt, "nomtrr"))
mtrr=0;
+#endif
else if (! strncmp(this_opt, "vtotal:", 7))
vram_total = simple_strtoul(this_opt+7, NULL, 0);
else if (! strncmp(this_opt, "vremap:", 7))
@@ -385,8 +389,9 @@ static int __init vesafb_probe(struct de
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
+#ifdef CONFIG_MTRR
if (mtrr) {
- int temp_size = size_total;
+ unsigned int temp_size = size_total;
/* Find the largest power-of-two */
while (temp_size & (temp_size - 1))
temp_size &= (temp_size - 1);
@@ -396,6 +401,7 @@ static int __init vesafb_probe(struct de
temp_size >>= 1;
}
}
+#endif
info->fbops = &vesafb_ops;
info->var = vesafb_defined;
[-- Attachment #2: linux-2.6.12-vesafb-no-mtrr.patch --]
[-- Type: application/octet-stream, Size: 1709 bytes --]
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
vesafb didn't build when CONFIG_MTRR wasn't set.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- /home/jbeulich/tmp/linux-2.6.12/drivers/video/vesafb.c 2005-06-17 21:48:29.000000000 +0200
+++ 2.6.12/drivers/video/vesafb.c 2005-06-21 09:56:14.572032960 +0200
@@ -45,7 +45,9 @@ static struct fb_fix_screeninfo vesafb_f
};
static int inverse = 0;
+#ifdef CONFIG_MTRR
static int mtrr = 1;
+#endif
static int vram_remap __initdata = 0; /* Set amount of memory to be used */
static int vram_total __initdata = 0; /* Set total amount of memory */
static int pmi_setpal = 0; /* pmi for palette changes ??? */
@@ -204,10 +206,12 @@ static int __init vesafb_setup(char *opt
pmi_setpal=0;
else if (! strcmp(this_opt, "pmipal"))
pmi_setpal=1;
+#ifdef CONFIG_MTRR
else if (! strcmp(this_opt, "mtrr"))
mtrr=1;
else if (! strcmp(this_opt, "nomtrr"))
mtrr=0;
+#endif
else if (! strncmp(this_opt, "vtotal:", 7))
vram_total = simple_strtoul(this_opt+7, NULL, 0);
else if (! strncmp(this_opt, "vremap:", 7))
@@ -385,8 +389,9 @@ static int __init vesafb_probe(struct de
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
+#ifdef CONFIG_MTRR
if (mtrr) {
- int temp_size = size_total;
+ unsigned int temp_size = size_total;
/* Find the largest power-of-two */
while (temp_size & (temp_size - 1))
temp_size &= (temp_size - 1);
@@ -396,6 +401,7 @@ static int __init vesafb_probe(struct de
temp_size >>= 1;
}
}
+#endif
info->fbops = &vesafb_ops;
info->var = vesafb_defined;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] allow vesafb to build when no CONFIG_MTRR
2005-06-21 10:07 [PATCH] allow vesafb to build when no CONFIG_MTRR Jan Beulich
@ 2005-06-21 11:14 ` Gerd Knorr
0 siblings, 0 replies; 3+ messages in thread
From: Gerd Knorr @ 2005-06-21 11:14 UTC (permalink / raw)
To: Jan Beulich; +Cc: linux-kernel
> +#ifdef CONFIG_MTRR
> if (mtrr) {
> - int temp_size = size_total;
> + unsigned int temp_size = size_total;
> /* Find the largest power-of-two */
> while (temp_size & (temp_size - 1))
> temp_size &= (temp_size - 1);
> @@ -396,6 +401,7 @@ static int __init vesafb_probe(struct de
> temp_size >>= 1;
> }
> }
> +#endif
I'd just do that to avoid cluttering up the source with
#ifdef's, otherwise it looks ok to me ;)
Gerd
--
-mm seems unusually stable at present.
-- akpm about 2.6.12-rc3-mm3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] allow vesafb to build when no CONFIG_MTRR
@ 2005-06-21 12:25 Jan Beulich
0 siblings, 0 replies; 3+ messages in thread
From: Jan Beulich @ 2005-06-21 12:25 UTC (permalink / raw)
To: Gerd Knorr; +Cc: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1443 bytes --]
>>> Gerd Knorr <kraxel@suse.de> 21.06.05 13:14:05 >>>
>> +#ifdef CONFIG_MTRR
>> if (mtrr) {
>> - int temp_size = size_total;
>> + unsigned int temp_size = size_total;
>> /* Find the largest power-of-two */
>> while (temp_size & (temp_size - 1))
>> temp_size &= (temp_size - 1);
>> @@ -396,6 +401,7 @@ static int __init vesafb_probe(struct de
>> temp_size >>= 1;
>> }
>> }
>> +#endif
>
>I'd just do that to avoid cluttering up the source with
>#ifdef's, otherwise it looks ok to me ;)
Ok, then here is the minimalist alternative (also realized that the int *> unsigned int change doesn't belong here):
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
vesafb didn't build when CONFIG_MTRR wasn't set.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- /home/jbeulich/tmp/linux-2.6.12/drivers/video/vesafb.c 2005-06-17 21:48:29.000000000 +0200
+++ 2.6.12/drivers/video/vesafb.c 2005-06-21 13:56:14.572032960 +0200
@@ -385,6 +385,7 @@ static int __init vesafb_probe(struct de
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
+#ifdef CONFIG_MTRR
if (mtrr) {
int temp_size = size_total;
/* Find the largest power-of-two */
@@ -396,6 +397,7 @@ static int __init vesafb_probe(struct de
temp_size >>= 1;
}
}
+#endif
info->fbops = &vesafb_ops;
info->var = vesafb_defined;
[-- Attachment #2: linux-2.6.12-vesafb-no-mtrr.patch --]
[-- Type: application/octet-stream, Size: 751 bytes --]
(Note: Patch also attached because the inline version is certain to get
line wrapped.)
vesafb didn't build when CONFIG_MTRR wasn't set.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
--- /home/jbeulich/tmp/linux-2.6.12/drivers/video/vesafb.c 2005-06-17 21:48:29.000000000 +0200
+++ 2.6.12/drivers/video/vesafb.c 2005-06-21 13:56:14.572032960 +0200
@@ -385,6 +385,7 @@ static int __init vesafb_probe(struct de
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
+#ifdef CONFIG_MTRR
if (mtrr) {
int temp_size = size_total;
/* Find the largest power-of-two */
@@ -396,6 +397,7 @@ static int __init vesafb_probe(struct de
temp_size >>= 1;
}
}
+#endif
info->fbops = &vesafb_ops;
info->var = vesafb_defined;
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-06-21 12:35 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-21 10:07 [PATCH] allow vesafb to build when no CONFIG_MTRR Jan Beulich
2005-06-21 11:14 ` Gerd Knorr
-- strict thread matches above, loose matches on Subject: below --
2005-06-21 12:25 Jan Beulich
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox