From: Thorsten Kranzkowski <dl8bcu@dl8bcu.de>
To: Richard Henderson <rth@redhat.com>,
axp-list mailing list <axp-list@redhat.com>
Subject: [PATCH] [RESENT] compilation warnings 3/6
Date: Sat, 9 Nov 2002 01:05:03 +0000 [thread overview]
Message-ID: <20021109010502.F18411@Marvin.DL8BCU.ampr.org> (raw)
In-Reply-To: <20021109010312.E18411@Marvin.DL8BCU.ampr.org>; from dl8bcu@dl8bcu.de on Sat, Nov 09, 2002 at 01:03:12AM +0000
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] |
next prev parent reply other threads:[~2002-11-09 1:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-09 1:00 [PATCH] [RESENT] compilation warnings 1/6 Thorsten Kranzkowski
2002-11-09 1:03 ` [PATCH] [RESENT] compilation warnings 2/6 Thorsten Kranzkowski
2002-11-09 1:05 ` Thorsten Kranzkowski [this message]
2002-11-09 1:07 ` [PATCH] [RESENT] compilation warnings 4/6 Thorsten Kranzkowski
2002-11-09 1:08 ` [PATCH] [RESENT] compilation warnings 5/6 Thorsten Kranzkowski
2002-11-09 1:13 ` [PATCH] [RESENT] compilation warnings 6/6 Thorsten Kranzkowski
2002-11-09 1:47 ` [PATCH] [RESENT] compilation warnings 4/6 Michal Jaegermann
2002-11-09 5:51 ` Richard Henderson
2002-11-09 4:50 ` [PATCH] [RESENT] compilation warnings 3/6 Richard Henderson
2002-11-09 19:14 ` Peter Rival
2002-11-09 21:29 ` Michal Jaegermann
2002-11-14 6:44 ` Richard Henderson
2002-11-09 4:32 ` [PATCH] [RESENT] compilation warnings 1/6 Richard Henderson
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox