From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by listman.redhat.com (Postfix) with ESMTP id 0352442A7B for ; Fri, 8 Nov 2002 20:07:24 -0500 (EST) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id gA917NP09394 for axp-list@listman.redhat.com; Fri, 8 Nov 2002 20:07:23 -0500 Received: from mx1.redhat.com (mx1.redhat.com [172.16.48.31]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with SMTP id gA917Nf09388; Fri, 8 Nov 2002 20:07:23 -0500 Received: from Marvin.DL8BCU.ampr.org (root@p50829A93.dip.t-dialin.net [80.130.154.147]) by mx1.redhat.com (8.11.6/8.11.6) with SMTP id gA90iWw07659; Fri, 8 Nov 2002 19:44:32 -0500 Received: from dl8bcu.de (th@localhost [127.0.0.1]) by Marvin.DL8BCU.ampr.org (8.12.1/8.12.1) with ESMTP id gA917IVK018657; Sat, 9 Nov 2002 01:07:18 GMT Received: (from th@localhost) by dl8bcu.de (8.12.1/8.12.1/Submit) id gA917HvZ018656; Sat, 9 Nov 2002 01:07:17 GMT X-Authentication-Warning: Marvin.borg.net: th set sender to dl8bcu@dl8bcu.de using -f Date: Sat, 9 Nov 2002 01:07:17 +0000 From: Thorsten Kranzkowski To: Richard Henderson , axp-list mailing list Subject: [PATCH] [RESENT] compilation warnings 4/6 Message-ID: <20021109010716.G18411@Marvin.DL8BCU.ampr.org> Mail-Followup-To: Richard Henderson , axp-list mailing list References: <20021109010039.D18411@Marvin.DL8BCU.ampr.org> <20021109010312.E18411@Marvin.DL8BCU.ampr.org> <20021109010502.F18411@Marvin.DL8BCU.ampr.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20021109010502.F18411@Marvin.DL8BCU.ampr.org>; from dl8bcu@dl8bcu.de on Sat, Nov 09, 2002 at 01:05:03AM +0000 X-Loop: axp-list@redhat.com Sender: axp-list-admin@redhat.com Errors-To: axp-list-admin@redhat.com X-BeenThere: axp-list@redhat.com X-Mailman-Version: 2.0.1 Precedence: bulk Reply-To: axp-list@redhat.com X-Reply-To: dl8bcu@dl8bcu.de List-Help: List-Post: List-Subscribe: , List-Id: Linux and Red Hat on Alpha processors List-Unsubscribe: , List-Archive: Part 4: these are mostly casts. Hopefully I got the int<->long thing right this time. stupid me. ### yes, I agree this is unsigned long. Thanks for reminding me that ### (unsigned) is actually (unsigned int) 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 Sat Nov 9 00:25:18 2002 @@ -1416,14 +1419,14 @@ if (addr) { addr = arch_get_unmapped_area_1 (PAGE_ALIGN(addr), len, limit); - if (addr != -ENOMEM) + if (addr != (unsigned long) -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 long) -ENOMEM) return addr; /* Finally, try allocating in low memory. */ ### type is a long parameter. it is explicitely normaized to positive ### values. the only caller supplies an unsigned long from hwrpb_struct. ### But there is this comment suggesting there are 'negative' values: ### /* Restore real CABRIO and EB66+ family names, ie EB64+ and EB66 */ ### if (type < 0) ### type = -type; ### member can only be positive and is checked against positive constants. ### again the comment ### /* Restore real CABRIO and EB66+ family names, ie EB64+ and EB66 */ ### otherwise type could be unsigned. ### i is also a loop counter with only positive values 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 Sat Nov 9 00:25:18 2002 @@ -804,13 +804,13 @@ /* Search the system tables first... */ vec = NULL; - if (type < N(systype_vecs)) { + if ((unsigned long)type < N(systype_vecs)) { vec = systype_vecs[type]; } else if ((type > ST_API_BIAS) && - (type - ST_API_BIAS) < N(api_vecs)) { + ((unsigned long)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 long)type - ST_UNOFFICIAL_BIAS) < N(unofficial_vecs)) { vec = unofficial_vecs[type - ST_UNOFFICIAL_BIAS]; } @@ -930,7 +930,7 @@ get_sysnames(long type, long variation, long cpu, char **type_name, char **variation_name) { - long member; + unsigned long member; /* Restore real CABRIO and EB66+ family names, ie EB64+ and EB66 */ if (type < 0) @@ -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 long)type < N(systype_names)) { *type_name = systype_names[type]; } else if ((type > ST_API_BIAS) && - (type - ST_API_BIAS) < N(api_names)) { + ((unsigned long)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 long)type - ST_UNOFFICIAL_BIAS) < N(unofficial_names)) { *type_name = unofficial_names[type - ST_UNOFFICIAL_BIAS]; } else { *type_name = sys_unknown; @@ -1042,7 +1042,8 @@ get_nr_processors(struct percpu_struct *cpubase, unsigned long num) { struct percpu_struct *cpu; - int i, count = 0; + unsigned long i; + int count = 0; for (i = 0; i < num; i++) { cpu = (struct percpu_struct *) ### diff is normalized to positive values here, but needed signed during ### calculation. all the frequencies are unsigned long. ### so insert a cast here. 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 Fri Nov 8 23:29:27 2002 @@ -316,7 +316,7 @@ diff = cycle_freq - est_cycle_freq; if (diff < 0) diff = -diff; - if (diff > one_percent) { + if ((unsigned long)diff > one_percent) { cycle_freq = est_cycle_freq; printk("HWRPB cycle frequency bogus. " "Estimated %lu Hz\n", cycle_freq); ### assignment from pointer to integer without a cast. ### ok, cast it. 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 Fri Nov 8 23:29:27 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); } ### to is already casted and from is already unsigned long. since we're ### doing bitops here, use unsigned long for both. 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 Fri Nov 8 23:29:27 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); -- | Thorsten Kranzkowski Internet: dl8bcu@dl8bcu.de | | Mobile: ++49 170 1876134 Snail: Niemannsweg 30, 49201 Dissen, Germany | | Ampr: dl8bcu@db0lj.#rpl.deu.eu, dl8bcu@marvin.dl8bcu.ampr.org [44.130.8.19] |