2002-11-06 21:40:36

by Thorsten Kranzkowski

[permalink] [raw]
Subject: [PATCH] eliminate compile warnings

Hello!

My attempt to compile 2.5.46 with gcc 3.3 resulted in over 66% lines of the
form:

xyz.c: warning: comparison between signed and unsigned

This is a first step to eliminate those, covering arch/alpha. Most fixes
are obvious, but please check.

BTW who is the current maintainer for Alpha issues? MAINTAINERS has no
entry :-/

Thorsten





diff -ur linux-2.5.46/arch/alpha/kernel/err_common.c linux-2.5.46-ds20/arch/alpha/kernel/err_common.c
--- linux-2.5.46/arch/alpha/kernel/err_common.c Wed Nov 6 19:04:14 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/err_common.c Wed Nov 6 20:02:50 2002
@@ -34,10 +34,10 @@
* Generic
*/
void
-mchk_dump_mem(void *data, int length, char **annotation)
+mchk_dump_mem(void *data, unsigned int length, char **annotation)
{
unsigned long *ldata = data;
- int i;
+ unsigned int i;

for(i = 0; (i * sizeof(*ldata)) < length; i++) {
if (annotation && !annotation[i])
@@ -715,7 +715,7 @@
cdl_check_console_data_log(void)
{
struct percpu_struct *pcpu;
- int cpu;
+ unsigned long cpu;

for(cpu = 0; cpu < hwrpb->nr_processors; cpu++) {
pcpu = (struct percpu_struct *)
diff -ur linux-2.5.46/arch/alpha/kernel/err_impl.h linux-2.5.46-ds20/arch/alpha/kernel/err_impl.h
--- linux-2.5.46/arch/alpha/kernel/err_impl.h Wed Nov 6 19:04:14 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/err_impl.h Wed Nov 6 21:10:37 2002
@@ -133,7 +133,7 @@
*/
extern char *err_print_prefix;

-extern void mchk_dump_mem(void *, int, char **);
+extern void mchk_dump_mem(void *, unsigned int, char **);
extern void mchk_dump_logout_frame(struct el_common *);
extern void ev7_register_error_handlers(void);
extern void ev7_machine_check(u64, u64, struct pt_regs *);
diff -ur linux-2.5.46/arch/alpha/kernel/irq.c linux-2.5.46-ds20/arch/alpha/kernel/irq.c
--- linux-2.5.46/arch/alpha/kernel/irq.c Wed Nov 6 19:04:14 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/irq.c Wed Nov 6 20:03:53 2002
@@ -252,7 +252,7 @@
{
unsigned char hexnum [HEX_DIGITS];
unsigned long value;
- int i;
+ unsigned long i;

if (!count)
return -EINVAL;
diff -ur linux-2.5.46/arch/alpha/kernel/osf_sys.c linux-2.5.46-ds20/arch/alpha/kernel/osf_sys.c
--- linux-2.5.46/arch/alpha/kernel/osf_sys.c Wed Nov 6 19:04:14 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/osf_sys.c Wed Nov 6 20:34:13 2002
@@ -104,7 +104,7 @@
struct osf_dirent_callback {
struct osf_dirent *dirent;
long *basep;
- int count;
+ unsigned int count;
int error;
};

@@ -114,7 +114,7 @@
{
struct osf_dirent *dirent;
struct osf_dirent_callback *buf = (struct osf_dirent_callback *) __buf;
- int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
+ unsigned int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);

buf->error = -EINVAL; /* only used if we fail */
if (reclen > buf->count)
@@ -478,6 +478,9 @@
return error;
}

+
+asmlinkage long sys_swapon(const char * specialfile, int swap_flags); /* mm/swapfile.c */
+
asmlinkage int
osf_swapon(const char *path, int flags, int lowat, int hiwat)
{
@@ -521,8 +524,8 @@
asmlinkage int
osf_getdomainname(char *name, int namelen)
{
- unsigned len;
- int i, error;
+ unsigned len, i;
+ int error;

error = verify_area(VERIFY_WRITE, name, namelen);
if (error)
@@ -1416,14 +1419,14 @@

if (addr) {
addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
- if (addr != -ENOMEM)
+ if (addr != (unsigned) -ENOMEM)
return addr;
}

/* Next, try allocating at TASK_UNMAPPED_BASE. */
addr = arch_get_unmapped_area_1 (PAGE_ALIGN(TASK_UNMAPPED_BASE),
len, limit);
- if (addr != -ENOMEM)
+ if (addr != (unsigned) -ENOMEM)
return addr;

/* Finally, try allocating in low memory. */
diff -ur linux-2.5.46/arch/alpha/kernel/pci.c linux-2.5.46-ds20/arch/alpha/kernel/pci.c
--- linux-2.5.46/arch/alpha/kernel/pci.c Wed Nov 6 19:04:14 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/pci.c Wed Nov 6 20:37:11 2002
@@ -474,5 +474,5 @@
pci_controller_num(struct pci_dev *pdev)
{
struct pci_controller *hose = pdev->sysdata;
- return (hose ? hose->index : -ENXIO);
+ return (hose ? (signed) hose->index : -ENXIO);
}
diff -ur linux-2.5.46/arch/alpha/kernel/setup.c linux-2.5.46-ds20/arch/alpha/kernel/setup.c
--- linux-2.5.46/arch/alpha/kernel/setup.c Sat Oct 19 04:01:16 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/setup.c Wed Nov 6 20:46:35 2002
@@ -202,7 +202,7 @@
};

struct resource *io = &ioport_resource;
- long i;
+ unsigned long i;

if (hose_head) {
struct pci_controller *hose;
@@ -258,7 +258,7 @@
unsigned long start_kernel_pfn, end_kernel_pfn;
unsigned long bootmap_size, bootmap_pages, bootmap_start;
unsigned long start, end;
- int i;
+ unsigned int i;

/* Find free clusters, and init and free the bootmem accordingly. */
memdesc = (struct memdesc_struct *)
@@ -327,7 +327,7 @@
}
}

- if (bootmap_start == -1) {
+ if (bootmap_start == (unsigned long)-1L) {
max_low_pfn >>= 1;
goto try_again;
}
@@ -398,7 +398,7 @@
{
struct memclust_struct * cluster;
struct memdesc_struct * memdesc;
- int i;
+ unsigned int i;

memdesc = (struct memdesc_struct *)
(hwrpb->mddt_offset + (unsigned long) hwrpb);
@@ -804,13 +804,13 @@

/* Search the system tables first... */
vec = NULL;
- if (type < N(systype_vecs)) {
+ if ((unsigned)type < N(systype_vecs)) {
vec = systype_vecs[type];
} else if ((type > ST_API_BIAS) &&
- (type - ST_API_BIAS) < N(api_vecs)) {
+ ((unsigned)type - ST_API_BIAS) < N(api_vecs)) {
vec = api_vecs[type - ST_API_BIAS];
} else if ((type > ST_UNOFFICIAL_BIAS) &&
- (type - ST_UNOFFICIAL_BIAS) < N(unofficial_vecs)) {
+ ((unsigned)type - ST_UNOFFICIAL_BIAS) < N(unofficial_vecs)) {
vec = unofficial_vecs[type - ST_UNOFFICIAL_BIAS];
}

@@ -818,7 +818,7 @@

if (!vec) {
/* Member ID is a bit-field. */
- long member = (variation >> 10) & 0x3f;
+ unsigned long member = (variation >> 10) & 0x3f;

cpu &= 0xffffffff; /* make it usable */

@@ -938,13 +938,13 @@

/* If not in the tables, make it UNKNOWN,
else set type name to family */
- if (type < N(systype_names)) {
+ if ((unsigned)type < N(systype_names)) {
*type_name = systype_names[type];
} else if ((type > ST_API_BIAS) &&
- (type - ST_API_BIAS) < N(api_names)) {
+ ((unsigned)type - ST_API_BIAS) < N(api_names)) {
*type_name = api_names[type - ST_API_BIAS];
} else if ((type > ST_UNOFFICIAL_BIAS) &&
- (type - ST_UNOFFICIAL_BIAS) < N(unofficial_names)) {
+ ((unsigned)type - ST_UNOFFICIAL_BIAS) < N(unofficial_names)) {
*type_name = unofficial_names[type - ST_UNOFFICIAL_BIAS];
} else {
*type_name = sys_unknown;
@@ -966,7 +966,7 @@
default: /* default to variation "0" for now */
break;
case ST_DEC_EB164:
- if (member < N(eb164_indices))
+ if ((unsigned)member < N(eb164_indices))
*variation_name = eb164_names[eb164_indices[member]];
/* PC164 may show as EB164 variation, but with EV56 CPU,
so, since no true EB164 had anything but EV5... */
@@ -974,27 +974,27 @@
*variation_name = eb164_names[1]; /* make it PC164 */
break;
case ST_DEC_ALCOR:
- if (member < N(alcor_indices))
+ if ((unsigned)member < N(alcor_indices))
*variation_name = alcor_names[alcor_indices[member]];
break;
case ST_DEC_EB64P:
- if (member < N(eb64p_indices))
+ if ((unsigned)member < N(eb64p_indices))
*variation_name = eb64p_names[eb64p_indices[member]];
break;
case ST_DEC_EB66:
- if (member < N(eb66_indices))
+ if ((unsigned)member < N(eb66_indices))
*variation_name = eb66_names[eb66_indices[member]];
break;
case ST_DEC_RAWHIDE:
- if (member < N(rawhide_indices))
+ if ((unsigned)member < N(rawhide_indices))
*variation_name = rawhide_names[rawhide_indices[member]];
break;
case ST_DEC_TITAN:
- if (member < N(titan_indices))
+ if ((unsigned)member < N(titan_indices))
*variation_name = titan_names[titan_indices[member]];
break;
case ST_DEC_TSUNAMI:
- if (member < N(tsunami_indices))
+ if ((unsigned)member < N(tsunami_indices))
*variation_name = tsunami_names[tsunami_indices[member]];
break;
}
diff -ur linux-2.5.46/arch/alpha/kernel/smc37c669.c linux-2.5.46-ds20/arch/alpha/kernel/smc37c669.c
--- linux-2.5.46/arch/alpha/kernel/smc37c669.c Sat Oct 19 04:02:00 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/smc37c669.c Wed Nov 6 20:48:56 2002
@@ -2269,7 +2269,7 @@
** We are translating a device IRQ to an ISA IRQ
*/
for ( i = 0; ( SMC37c669_irq_table[i].device_irq != -1 ) || ( SMC37c669_irq_table[i].isa_irq != -1 ); i++ ) {
- if ( irq == SMC37c669_irq_table[i].device_irq ) {
+ if ( (signed)irq == SMC37c669_irq_table[i].device_irq ) {
translated_irq = SMC37c669_irq_table[i].isa_irq;
break;
}
@@ -2280,7 +2280,7 @@
** We are translating an ISA IRQ to a device IRQ
*/
for ( i = 0; ( SMC37c669_irq_table[i].isa_irq != -1 ) || ( SMC37c669_irq_table[i].device_irq != -1 ); i++ ) {
- if ( irq == SMC37c669_irq_table[i].isa_irq ) {
+ if ( (signed)irq == SMC37c669_irq_table[i].isa_irq ) {
translated_irq = SMC37c669_irq_table[i].device_irq;
break;
}
@@ -2321,7 +2321,7 @@
** We are translating a device DMA channel to an ISA DMA channel
*/
for ( i = 0; ( SMC37c669_drq_table[i].device_drq != -1 ) || ( SMC37c669_drq_table[i].isa_drq != -1 ); i++ ) {
- if ( drq == SMC37c669_drq_table[i].device_drq ) {
+ if ( (signed)drq == SMC37c669_drq_table[i].device_drq ) {
translated_drq = SMC37c669_drq_table[i].isa_drq;
break;
}
@@ -2332,7 +2332,7 @@
** We are translating an ISA DMA channel to a device DMA channel
*/
for ( i = 0; ( SMC37c669_drq_table[i].isa_drq != -1 ) || ( SMC37c669_drq_table[i].device_drq != -1 ); i++ ) {
- if ( drq == SMC37c669_drq_table[i].isa_drq ) {
+ if ( (signed)drq == SMC37c669_drq_table[i].isa_drq ) {
translated_drq = SMC37c669_drq_table[i].device_drq;
break;
}
diff -ur linux-2.5.46/arch/alpha/kernel/smp.c linux-2.5.46-ds20/arch/alpha/kernel/smp.c
--- linux-2.5.46/arch/alpha/kernel/smp.c Sat Oct 19 04:01:19 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/smp.c Wed Nov 6 20:49:26 2002
@@ -499,7 +499,7 @@
setup_smp(void)
{
struct percpu_struct *cpubase, *cpu;
- int i;
+ unsigned int i;

if (boot_cpuid != 0) {
printk(KERN_WARNING "SMP: Booting off cpu %d instead of 0?\n",
diff -ur linux-2.5.46/arch/alpha/kernel/time.c linux-2.5.46-ds20/arch/alpha/kernel/time.c
--- linux-2.5.46/arch/alpha/kernel/time.c Sat Oct 19 04:01:54 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/time.c Wed Nov 6 20:50:48 2002
@@ -316,7 +316,7 @@
diff = cycle_freq - est_cycle_freq;
if (diff < 0)
diff = -diff;
- if (diff > one_percent) {
+ if ((unsigned)diff > one_percent) {
cycle_freq = est_cycle_freq;
printk("HWRPB cycle frequency bogus. "
"Estimated %lu Hz\n", cycle_freq);
diff -ur linux-2.5.46/arch/alpha/kernel/traps.c linux-2.5.46-ds20/arch/alpha/kernel/traps.c
--- linux-2.5.46/arch/alpha/kernel/traps.c Wed Nov 6 19:04:14 2002
+++ linux-2.5.46-ds20/arch/alpha/kernel/traps.c Wed Nov 6 21:00:46 2002
@@ -406,7 +406,7 @@
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = ILL_ILLOPC;
- info.si_addr = regs.pc;
+ info.si_addr = (void *)regs.pc;
send_sig_info(SIGILL, &info, current);
}

@@ -429,7 +429,7 @@
info.si_signo = SIGILL;
info.si_errno = 0;
info.si_code = ILL_ILLOPC;
- info.si_addr = regs.pc;
+ info.si_addr = (void *)regs.pc;
force_sig_info(SIGILL, &info, current);
}

diff -ur linux-2.5.46/arch/alpha/lib/fpreg.c linux-2.5.46-ds20/arch/alpha/lib/fpreg.c
--- linux-2.5.46/arch/alpha/lib/fpreg.c Sat Oct 19 04:02:24 2002
+++ linux-2.5.46-ds20/arch/alpha/lib/fpreg.c Wed Nov 6 21:05:46 2002
@@ -48,6 +48,7 @@
case 29: STT(29, val); break;
case 30: STT(30, val); break;
case 31: STT(31, val); break;
+ default: return 0; /* silence gcc */
}
return val;
}
@@ -141,6 +142,7 @@
case 29: STS(29, val); break;
case 30: STS(30, val); break;
case 31: STS(31, val); break;
+ default: return 0; /* silence gcc */
}
return val;
}
diff -ur linux-2.5.46/arch/alpha/lib/io.c linux-2.5.46-ds20/arch/alpha/lib/io.c
--- linux-2.5.46/arch/alpha/lib/io.c Sat Oct 19 04:02:27 2002
+++ linux-2.5.46-ds20/arch/alpha/lib/io.c Wed Nov 6 21:07:48 2002
@@ -414,7 +414,7 @@
/* Optimize co-aligned transfers. Everything else gets handled
a byte at a time. */

- if (count >= 8 && ((long)to & 7) == (from & 7)) {
+ if (count >= 8 && ((unsigned long)to & 7) == (from & 7)) {
count -= 8;
do {
*(u64 *)to = __raw_readq(from);
@@ -425,7 +425,7 @@
count += 8;
}

- if (count >= 4 && ((long)to & 3) == (from & 3)) {
+ if (count >= 4 && ((unsigned long)to & 3) == (from & 3)) {
count -= 4;
do {
*(u32 *)to = __raw_readl(from);
@@ -436,7 +436,7 @@
count += 4;
}

- if (count >= 2 && ((long)to & 1) == (from & 1)) {
+ if (count >= 2 && ((unsigned long)to & 1) == (from & 1)) {
count -= 2;
do {
*(u16 *)to = __raw_readw(from);
@@ -465,7 +465,7 @@
a byte at a time. */
/* FIXME -- align FROM. */

- if (count >= 8 && (to & 7) == ((long)from & 7)) {
+ if (count >= 8 && (to & 7) == ((unsigned long)from & 7)) {
count -= 8;
do {
__raw_writeq(*(const u64 *)from, to);
@@ -476,7 +476,7 @@
count += 8;
}

- if (count >= 4 && (to & 3) == ((long)from & 3)) {
+ if (count >= 4 && (to & 3) == ((unsigned long)from & 3)) {
count -= 4;
do {
__raw_writel(*(const u32 *)from, to);
@@ -487,7 +487,7 @@
count += 4;
}

- if (count >= 2 && (to & 1) == ((long)from & 1)) {
+ if (count >= 2 && (to & 1) == ((unsigned long)from & 1)) {
count -= 2;
do {
__raw_writew(*(const u16 *)from, to);
diff -ur linux-2.5.46/arch/alpha/mm/init.c linux-2.5.46-ds20/arch/alpha/mm/init.c
--- linux-2.5.46/arch/alpha/mm/init.c Sat Oct 19 04:02:30 2002
+++ linux-2.5.46-ds20/arch/alpha/mm/init.c Wed Nov 6 21:08:53 2002
@@ -242,7 +242,7 @@
if (alpha_using_srm) {
static struct vm_struct console_remap_vm;
unsigned long vaddr = VMALLOC_START;
- long i, j;
+ unsigned long i, j;

/* Set up the third level PTEs and update the virtual
addresses of the CRB entries. */


--
| Thorsten Kranzkowski Internet: [email protected] |
| Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, [email protected] [44.130.8.19] |


2002-11-07 14:15:58

by George France

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Wednesday 06 November 2002 16:47, Thorsten Kranzkowski wrote:
> Hello!
>
> My attempt to compile 2.5.46 with gcc 3.3 resulted in over 66% lines of the
> form:

You are brave sole. The bleeding edge cuts both ways.

>
> xyz.c: warning: comparison between signed and unsigned
>
> This is a first step to eliminate those, covering arch/alpha. Most fixes
> are obvious, but please check.
>
> BTW who is the current maintainer for Alpha issues? MAINTAINERS has no
> entry :-/

If there is no entry in the MAINTAINERS file, then it is Linus. He did the Alpha port.
The first foray of Linux outside of the Intel architecture was to the Alpha processor.
The Alpha system came from the laboratories of the Digital Equipment Corp. An engineer
from Digital (now HP) arranged for a loan of an Alpha server to Linus Torvalds
for him to begin a port of Linux. This act of beneficence greatly accelerated the
migration of Linux to other platforms. Linus is still the MAINTAINER for Alpha to this day.
He still has his loaner box from Digital.

There are still a few of us that work for the Alpha Processor Group at HP that work on
maintaining the kernel. I have tossed your patch into the directory that holds all
kinds of miscellaneous alpha bits for the next time one of us looks at the kernel.
Since people that work on the Alpha Architecture are greatly outnumbered by the
people that work on other architectures, usually by the time we have a stable working
kernel for Alpha, the kernel.org kernels are usually many versions ahead.

I hope this helps.

Best Regards,


--George

2002-11-07 16:46:53

by Jeff Garzik

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

George France wrote:
> On Wednesday 06 November 2002 16:47, Thorsten Kranzkowski wrote:
>
>>Hello!
>>
>>My attempt to compile 2.5.46 with gcc 3.3 resulted in over 66% lines of the
>>form:
>
>
> You are brave sole. The bleeding edge cuts both ways.
>
>
>>xyz.c: warning: comparison between signed and unsigned
>>
>>This is a first step to eliminate those, covering arch/alpha. Most fixes
>>are obvious, but please check.
>>
>>BTW who is the current maintainer for Alpha issues? MAINTAINERS has no
>>entry :-/
>
>
> If there is no entry in the MAINTAINERS file, then it is Linus. He did the Alpha port.
> The first foray of Linux outside of the Intel architecture was to the Alpha processor.
> The Alpha system came from the laboratories of the Digital Equipment Corp. An engineer
> from Digital (now HP) arranged for a loan of an Alpha server to Linus Torvalds
> for him to begin a port of Linux. This act of beneficence greatly accelerated the
> migration of Linux to other platforms. Linus is still the MAINTAINER for Alpha to this day.
> He still has his loaner box from Digital.


Weeeellll.... If you want to go by the "if there is no listing in
MAINTAINERS" rule, sure :)

Richard Henderson can be considered the current alphalinux kernel
maintainer for 2.4.x and 2.5.x, though he gets help from Ivan Kokshaysky
and Jay Estabrook, and a tiny bit of help from me too.

So at the very least, please make sure alpha kernel patches get CC'd to
[email protected] and [email protected].

Jeff



2002-11-07 20:22:26

by Thorsten Kranzkowski

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Thu, Nov 07, 2002 at 09:22:26AM -0500, George France wrote:
> On Wednesday 06 November 2002 16:47, Thorsten Kranzkowski wrote:
>
> You are brave sole. The bleeding edge cuts both ways.

And sometimes covered with a sticky red fluid ... :)

> > BTW who is the current maintainer for Alpha issues? MAINTAINERS has no
> > entry :-/
>
> If there is no entry in the MAINTAINERS file, then it is Linus. He did the Alpha port.

yes, I know. If the patch won't show up soon I _will_ send it to Linus.
But it's usually easier to get it in when some Maintainer sticks an OK-label
on it :-)

> He still has his loaner box from Digital.

Well, I thought that box was already retired, but I may be wrong.

> There are still a few of us that work for the Alpha Processor Group at HP that work on
> maintaining the kernel. I have tossed your patch into the directory that holds all
> kinds of miscellaneous alpha bits for the next time one of us looks at the kernel.

Thanks! Hopefully it won't take long to find it's way into mainline (hint hint...)

> Since people that work on the Alpha Architecture are greatly outnumbered by the
> people that work on other architectures, usually by the time we have a stable working
> kernel for Alpha, the kernel.org kernels are usually many versions ahead.

I'd prefer if development is tightly coupled to mainline so that the version
skew is minimized. Yes, here will be kernels that won't work for various
reasons but that's why it's called development kernel :)

I strongly feel that _now_ is the time to sync up so we can start with a more
or less working 2.6.0 and don't have to wait until 2.6.2x ...

>
> I hope this helps.

Thorsten

--
| Thorsten Kranzkowski Internet: [email protected] |
| Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, [email protected] [44.130.8.19] |

2002-11-07 20:49:11

by George France

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Thursday 07 November 2002 15:28, Thorsten Kranzkowski wrote:
> On Thu, Nov 07, 2002 at 09:22:26AM -0500, George France wrote:
>
> > He still has his loaner box from Digital.
>
> Well, I thought that box was already retired, but I may be wrong.
>

The last I heard it was retired and that he was using it as a door stop.

>
> I'd prefer if development is tightly coupled to mainline so that the
> version skew is minimized. Yes, here will be kernels that won't work for
> various reasons but that's why it's called development kernel :)
>
> I strongly feel that _now_ is the time to sync up so we can start with a
> more or less working 2.6.0 and don't have to wait until 2.6.2x ...
>

I agree with you. If only there were thirty-six (36) hours in the day.

Best Regards,


--George

2002-11-07 21:36:57

by Thorsten Kranzkowski

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Thu, Nov 07, 2002 at 11:53:28AM -0500, Jeff Garzik wrote:
> George France wrote:
> > On Wednesday 06 November 2002 16:47, Thorsten Kranzkowski wrote:
> >
> >>Hello!
> >>
> >>My attempt to compile 2.5.46 with gcc 3.3 resulted in over 66% lines of the
> >>form:
[...]
> >>BTW who is the current maintainer for Alpha issues? MAINTAINERS has no
> >>entry :-/
> >
> >
> > If there is no entry in the MAINTAINERS file, then it is Linus. He did the Alpha port.
[...]
> > migration of Linux to other platforms. Linus is still the MAINTAINER for Alpha to this day.
> > He still has his loaner box from Digital.
>
>
> Weeeellll.... If you want to go by the "if there is no listing in
> MAINTAINERS" rule, sure :)
>
> Richard Henderson can be considered the current alphalinux kernel
> maintainer for 2.4.x and 2.5.x, though he gets help from Ivan Kokshaysky
> and Jay Estabrook, and a tiny bit of help from me too.

Richard or Ivan, would you mind being listed in MAINTAINERS ?

> So at the very least, please make sure alpha kernel patches get CC'd to
> [email protected] and [email protected].
>
> Jeff

Thorsten

--
| Thorsten Kranzkowski Internet: [email protected] |
| Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, [email protected] [44.130.8.19] |

2002-11-08 01:27:13

by Richard Henderson

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

As for the patch itself, it's not correct. At a glance,

> addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
> - if (addr != -ENOMEM)
> + if (addr != (unsigned) -ENOMEM)

addr is unsigned long. If you truncate -ENOMEM to 32-bits, it will
never match. There appears to be much more int/long confusion later.

You have to be /exceedingly/ careful to fix these warnings without
introducing new bugs. If you change the type of a variable, you
have to examine each and every use of the variable to determine if
the semantics are unchanged. If you add a cast, you have to be sure
that you cast to a type of the correct width. If you're adding lots
of casts, you should think about changing the type of one or more
variables.

It's enough to make me wish we had -Wno-sign-compare in CFLAGS by
default for the nonce. Which, incidentally, is what I've been doing
for my own builds.

There's absolutely no way I'm going to apply a jumbo patch that
changes hundreds of these at once. If you still want to fix these,
then you'll need to send them one at a time and include analysis of
why each change is correct.


r~

2002-11-08 02:48:00

by George France

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

Hello Richard,

As I said earlier, I did not have time to look at the patch today, but
I was going to save it with some other alpha kernel patches and
was going to look at it next week. From the snippet of code that
you included in this e-mail, I agree 100% with your analysis of this
patch and the correct way to proceed. I would not want you to
apply such a jumbo patch.

Today we were mostly absorbed in discussing where or too whom
should Thorsten send the patch instead of the patch itself, since
there is no maintainer in the MAINTAINERS file.

Thank you very much for taking the time to review and consider
this patch.

Best Regards,


--George


On Thursday 07 November 2002 20:33, Richard Henderson wrote:
> As for the patch itself, it's not correct. At a glance,
>
> > addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
> > - if (addr != -ENOMEM)
> > + if (addr != (unsigned) -ENOMEM)
>
> addr is unsigned long. If you truncate -ENOMEM to 32-bits, it will
> never match. There appears to be much more int/long confusion later.
>
> You have to be /exceedingly/ careful to fix these warnings without
> introducing new bugs. If you change the type of a variable, you
> have to examine each and every use of the variable to determine if
> the semantics are unchanged. If you add a cast, you have to be sure
> that you cast to a type of the correct width. If you're adding lots
> of casts, you should think about changing the type of one or more
> variables.
>
> It's enough to make me wish we had -Wno-sign-compare in CFLAGS by
> default for the nonce. Which, incidentally, is what I've been doing
> for my own builds.
>
> There's absolutely no way I'm going to apply a jumbo patch that
> changes hundreds of these at once. If you still want to fix these,
> then you'll need to send them one at a time and include analysis of
> why each change is correct.
>
>
> r~
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/

2002-11-08 03:19:17

by Richard Henderson

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Thu, Nov 07, 2002 at 09:54:29PM -0500, George France wrote:
> Today we were mostly absorbed in discussing where or too whom
> should Thorsten send the patch instead of the patch itself, since
> there is no maintainer in the MAINTAINERS file.

If, as with binutils, you want me to put my name in there, I will.
It didn't seem particularly important at the time...


r~

2002-11-08 03:58:05

by George France

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Thursday 07 November 2002 22:25, Richard Henderson wrote:
> On Thu, Nov 07, 2002 at 09:54:29PM -0500, George France wrote:
> > Today we were mostly absorbed in discussing where or too whom
> > should Thorsten send the patch instead of the patch itself, since
> > there is no maintainer in the MAINTAINERS file.
>
> If, as with binutils, you want me to put my name in there, I will.
> It didn't seem particularly important at the time...

I do not want to create any extra work for you by having your name
in the MAINTAINERS file. If this is something that you would like to
do, then I would be very please to see your name added as the
maintainer for the Alpha Architecture. You do excellent work and
there is nobody that I can think of that is more qualified.

If you do decide to become the maintainer, please keep me in
mind if you need any assistance. I would be happy to help.

If you decide not to become the 'maintainer', I would really
appreciate your input and recommendation for someone
to be named as the maintainer.

Best Regards,


--George

2002-11-08 07:32:17

by Thorsten Kranzkowski

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Thu, Nov 07, 2002 at 05:33:49PM -0800, Richard Henderson wrote:
> As for the patch itself, it's not correct. At a glance,
>
> > addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit);
> > - if (addr != -ENOMEM)
> > + if (addr != (unsigned) -ENOMEM)
>
> addr is unsigned long. If you truncate -ENOMEM to 32-bits, it will
> never match. There appears to be much more int/long confusion later.

I will give my patch another thought and I will feed it to you in smaller
pieces and with comments.

> You have to be /exceedingly/ careful to fix these warnings without
> introducing new bugs. If you change the type of a variable, you
> have to examine each and every use of the variable to determine if
> the semantics are unchanged. If you add a cast, you have to be sure
> that you cast to a type of the correct width. If you're adding lots
> of casts, you should think about changing the type of one or more
> variables.

Generally I'm aware of this - maybe a case of more coffee needed :)

> It's enough to make me wish we had -Wno-sign-compare in CFLAGS by
> default for the nonce. Which, incidentally, is what I've been doing
> for my own builds.
>
> There's absolutely no way I'm going to apply a jumbo patch that
> changes hundreds of these at once. If you still want to fix these,
> then you'll need to send them one at a time and include analysis of
> why each change is correct.

Will do.

Thanks for your time.

Thorsten

--
| Thorsten Kranzkowski Internet: [email protected] |
| Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany |
| Ampr: dl8bcu@db0lj.#rpl.deu.eu, [email protected] [44.130.8.19] |

2002-11-09 20:50:46

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

On Thu, 7 Nov 2002, George France wrote:
> If there is no entry in the MAINTAINERS file, then it is Linus. He did the Alpha port.
> The first foray of Linux outside of the Intel architecture was to the Alpha processor.

*beep* The m68k port is older, and IIRC the MIPS port is older as well. Those
weren't started by Linus, though.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds


2002-11-09 20:59:59

by Cort Dougan

[permalink] [raw]
Subject: Re: [PATCH] eliminate compile warnings

Some very long, and pointless, arguments can be had about which was
_first_. Lets talk about something more interesting - which ones are still
usable :) I do recall that Motorola Computer Group was very very unhappy
that an Alpha from DEC arrived for Linus before their PowerStack. Maybe
you can compare who shipped a machine to Linus first, then compare which
was powered on and so on.

I believe Linus only re-did the Alpha port. It was first done inside DEC.
They should get credit for getting on the Linux bandwagon early on.


} > If there is no entry in the MAINTAINERS file, then it is Linus. He did the Alpha port.
} > The first foray of Linux outside of the Intel architecture was to the Alpha processor.
}
} *beep* The m68k port is older, and IIRC the MIPS port is older as well. Those
} weren't started by Linus, though.