Re: [PATCH] allow vesafb to build when no CONFIG_MTRR

From: Jan Beulich
Date: Tue Jun 21 2005 - 07:38:30 EST


>>> Gerd Knorr <kraxel@xxxxxxx> 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@xxxxxxxxxx>

--- /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: linux-2.6.12-vesafb-no-mtrr.patch
Description: Binary data