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 69DEE409B5 for ; Fri, 8 Nov 2002 20:05:09 -0500 (EST) Received: (from mail@localhost) by int-mx1.corp.redhat.com (8.11.6/8.11.6) id gA9159p09161 for axp-list@listman.redhat.com; Fri, 8 Nov 2002 20:05:09 -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 gA9159f09157; Fri, 8 Nov 2002 20:05:09 -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 gA90gIw07426; Fri, 8 Nov 2002 19:42:18 -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 gA9154VK018645; Sat, 9 Nov 2002 01:05:04 GMT Received: (from th@localhost) by dl8bcu.de (8.12.1/8.12.1/Submit) id gA91538h018644; Sat, 9 Nov 2002 01:05:03 GMT X-Authentication-Warning: Marvin.borg.net: th set sender to dl8bcu@dl8bcu.de using -f Date: Sat, 9 Nov 2002 01:05:03 +0000 From: Thorsten Kranzkowski To: Richard Henderson , axp-list mailing list Subject: [PATCH] [RESENT] compilation warnings 3/6 Message-ID: <20021109010502.F18411@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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <20021109010312.E18411@Marvin.DL8BCU.ampr.org>; from dl8bcu@dl8bcu.de on Sat, Nov 09, 2002 at 01:03:12AM +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 3: these need a little bit more thought. please see aech comment. ### all callers use unsigned values. length is supposed positive ### so use unsigned int throughout 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 Fri Nov 8 23:51:35 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]) 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 Fri Nov 8 23:29:27 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 *); ### i is again a loopcounter with supposedly only positive values. ### OTOH this funktion needs more thought. In its current form ### it may copy arbitrary amounts of memory when given a negative ### value for namelen. 'len' should be removes altogether. ### I suppose the 'int namelen' is architecturally defined? 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:06:04 2002 @@ -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) ### hose->index is unsigned int but pci_controller_num is defined ### int everywhere. who is right? 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 Fri Nov 8 23:29:27 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 ? (int) hose->index : -ENXIO); } ### bootmap_start is unsigned long. the -1 is used as a cookie not ### as a numerically negative value. 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:06:04 2002 @@ -327,7 +327,7 @@ } } - if (bootmap_start == -1) { + if (bootmap_start == ~0UL) { max_low_pfn >>= 1; goto try_again; } ### .device_irq is int, local_config[].irq is unsigned int. -1 is used ### as a special value for both. ) make them both signed and keep -1 or ### make them unsigned and go with ~0U ### drq the same. 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 Fri Nov 8 23:11:23 2002 @@ -970,8 +970,8 @@ static struct DEVICE_CONFIG { unsigned int port1; unsigned int port2; - unsigned int irq; - unsigned int drq; + int irq; + int drq; } local_config [NUM_FUNCS]; /* @@ -1097,11 +1097,11 @@ ); static int SMC37c669_xlate_irq( - unsigned int irq + int irq ); static int SMC37c669_xlate_drq( - unsigned int drq + int drq ); static spinlock_t smc_lock __cacheline_aligned = SPIN_LOCK_UNLOCKED; @@ -2260,7 +2260,7 @@ ** **-- */ -static int __init SMC37c669_xlate_irq ( unsigned int irq ) +static int __init SMC37c669_xlate_irq ( int irq ) { int i, translated_irq = -1; @@ -2312,7 +2312,7 @@ ** **-- */ -static int __init SMC37c669_xlate_drq ( unsigned int drq ) +static int __init SMC37c669_xlate_drq ( int drq ) { int i, translated_drq = -1; -- | 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] |