Skip to contentSkip to conversation

- 2.6.2 - scripts/file2alias.c -

PATCH In review Ron Gage 2 participants 3 messages Feb 15, 2004 – Feb 16, 2004 Kernel janitors

lore
Share & tools
lore

Ron Gage

author
#0 lore raw

PATCH 1/1 - 2.6.2 - scripts/file2alias.c -

Ok, let's see if this patch is a touch less problematic.

Cleans up signed/unsigned comparison warnings.

Signature · 2 lines
Ron Gage - LPIC1, MCP, A+, Net+
Pontiac, Michigan
scripts/file2alias.c +4 -4
@@ -127,10 +127,10 @@
 	id->class_mask = TO_NATIVE(id->class_mask);
 
 	strcpy(alias, "pci:");
-	ADD(alias, "v", id->vendor != PCI_ANY_ID, id->vendor);
-	ADD(alias, "d", id->device != PCI_ANY_ID, id->device);
-	ADD(alias, "sv", id->subvendor != PCI_ANY_ID, id->subvendor);
-	ADD(alias, "sd", id->subdevice != PCI_ANY_ID, id->subdevice);
+	ADD(alias, "v", (unsigned)id->vendor != PCI_ANY_ID, id->vendor);
+	ADD(alias, "d", (unsigned)id->device != PCI_ANY_ID, id->device);
+	ADD(alias, "sv", (unsigned)id->subvendor != PCI_ANY_ID, id->subvendor);
+	ADD(alias, "sd", (unsigned)id->subdevice != PCI_ANY_ID, id->subdevice);
 
 	baseclass = (id->class) >> 16;
 	baseclass_mask = (id->class_mask) >> 16;

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

author
#1 lore raw

PATCH 1/1 - 2.6.2 - scripts/fixdep.c -

Fixes signed/unsigned comparison warnings.

Signature · 2 lines
Ron Gage - LPIC1, MCP, A+, Net+
Pontiac, Michigan
scripts/fixdep.c +2 -2
@@ -213,7 +213,7 @@
 {
 	int *end = (int *) (map + len);
 	/* start at +1, so that p can never be < map */
-	int *m   = (int *) map + 1;
+	unsigned int *m   = (int *) map + 1;
 	char *p, *q;
 
 	for (; m < end; m++) {
@@ -356,7 +356,7 @@
 {
 	static char test[] __attribute__((aligned(sizeof(int)))) = "CONF";
 
-	if (*(int *)test != INT_CONF) {
+	if (*(unsigned int *)test != INT_CONF) {
 		fprintf(stderr, "fixdep: sizeof(int) != 4 or wrong endianess? %#x\n",
 			*(int *)test);
 		exit(2);

_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors

#2 lore raw

Re: [Kernel-janitors] [PATCH] - 2.6.2 - scripts/fixdep.c -

In reply to Ron Gage

Hi Ron,

Em Dom, 2004-02-15 às 00:45, Ron Gage escreveu:

Quoted 1 line

Fixes signed/unsigned comparison warnings.

--- linux-2.6.2.orig/scripts/fixdep.c 2004-02-03 22:43:47.000000000
-0500
+++ linux-2.6.2/scripts/fixdep.c 2004-02-14 22:28:22.000000000
-0500
@@ -213,7 +213,7 @@

 {
        int *end = (int *) (map + len);
        /* start at +1, so that p can never be < map */
-       int *m   = (int *) map + 1;
+       unsigned int *m   = (int *) map + 1;
        char *p, *q;

What about:

unsigned int *m = (unsigned int *) map +1;

Or the compiler give you a warning ?

Signature · 9 lines
Luiz Fernando N. Capitulino
<[email protected]>
<http://www.telecentros.sp.gov.br>


_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors