]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] sparse: bits and pieces
authorAlexander Viro <viro@parcelfarce.linux.theplanet.co.uk>
Sat, 29 May 2004 09:18:12 +0000 (02:18 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Sat, 29 May 2004 09:18:12 +0000 (02:18 -0700)
Independent minor bits caught by sparse:

 - paride.h mixing void and int in ? :, used always in a void context
   ide-iops.c return insw() - insw is void()
 - scsi/constants.c uses undefined macros in #if; added #define to 0 in
   case that used to leave it undefined
 - usb/host/hcd.h: fixed-point arithmetics in constant
 - fs/exec.c: missing UL on a large constant
 - fs/locks.c: #if where #ifdef should've been
 - fs.h: missing UL on MAX_LFS_FILESIZE in 64bit case

drivers/block/paride/paride.h
drivers/ide/ide-iops.c
drivers/scsi/constants.c
drivers/usb/core/hcd.h
fs/exec.c
fs/locks.c
include/linux/fs.h

index 46bd0a47ff7a7b7aefdd08da691f76b05b35f8ec..e8e2a934b522df880f258baad037d6664ab1089a 100644 (file)
@@ -99,7 +99,7 @@ extern int pi_schedule_claimed(PIA *pi, void (*cont)(void));
 
 /* macros and functions exported to the protocol modules */
 
-#define delay_p                        (pi->delay?udelay(pi->delay):0)
+#define delay_p                        (pi->delay?udelay(pi->delay):(void)0)
 #define out_p(offs,byte)       outb(byte,pi->port+offs); delay_p;
 #define in_p(offs)             (delay_p,inb(pi->port+offs))
 
index ed9fd9ab9c9d3ef1e52e11e36463a3d53a91eefb..b7c47d235e91bdecf5fb50538c23c93329e2321d 100644 (file)
@@ -46,7 +46,7 @@ static u16 ide_inw (unsigned long port)
 
 static void ide_insw (unsigned long port, void *addr, u32 count)
 {
-       return insw(port, addr, count);
+       insw(port, addr, count);
 }
 
 static u32 ide_inl (unsigned long port)
index b0179426fc98d3dc5dfdff1533bfadada59beb03..e777bb0781c4cc2fac109baf5589bb88c4d9daee 100644 (file)
@@ -31,6 +31,8 @@ static const char unknown[] = "UNKNOWN";
 #endif
 #define CONSTANTS (CONST_COMMAND | CONST_STATUS | CONST_SENSE | CONST_XSENSE \
                   | CONST_CMND | CONST_MSG | CONST_HOST | CONST_DRIVER)
+#else
+#define CONSTANTS 0
 #endif
 
 #if (CONSTANTS & CONST_COMMAND)
index e8f90bcd31352e529486bf1fc925b88c038debe1..f56fa80269ea7e3104341d084f0900172ba29805 100644 (file)
@@ -329,7 +329,7 @@ extern int usb_check_bandwidth (struct usb_device *dev, struct urb *urb);
 #define HS_USECS(bytes) NS_TO_US ( ((55 * 8 * 2083)/1000) \
        + ((2083UL * (3167 + BitTime (bytes)))/1000) \
        + USB2_HOST_DELAY)
-#define HS_USECS_ISO(bytes) NS_TO_US ( ((long)(38 * 8 * 2.083)) \
+#define HS_USECS_ISO(bytes) NS_TO_US ( ((38 * 8 * 2083)/1000) \
        + ((2083UL * (3167 + BitTime (bytes)))/1000) \
        + USB2_HOST_DELAY)
 
index d1aba2427fd2199e29fa8368d11141db90e90d36..4b7f44fb49efb051217e6c0abd331bc1fc4bf19b 100644 (file)
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -994,7 +994,7 @@ int search_binary_handler(struct linux_binprm *bprm,struct pt_regs *regs)
                        return retval;
 
                /* Remember if the application is TASO.  */
-               bprm->sh_bang = eh->ah.entry < 0x100000000;
+               bprm->sh_bang = eh->ah.entry < 0x100000000UL;
 
                bprm->file = file;
                bprm->loader = loader;
index 14f5f66d9d3225ba56bf9a2b1ed71f0c0f424002..fbd048304e4ea9799a9ef802f02fbf7252b747ea 100644 (file)
@@ -1816,7 +1816,7 @@ static void lock_get_status(char* out, struct file_lock *fl, int id, char *pfx)
                               : (fl->fl_type & F_WRLCK) ? "WRITE" : "READ ");
        }
        if (inode) {
-#if WE_CAN_BREAK_LSLK_NOW
+#ifdef WE_CAN_BREAK_LSLK_NOW
                out += sprintf(out, "%d %s:%ld ", fl->fl_pid,
                                inode->i_sb->s_id, inode->i_ino);
 #else
index a766ca3c4a8350fe799ebc2aed0251f0c658dbbe..10a69a5440452553f7a711cac200a6c3db344852 100644 (file)
@@ -599,7 +599,7 @@ extern void close_private_file(struct file *file);
 #if BITS_PER_LONG==32
 #define MAX_LFS_FILESIZE       (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG-1))-1) 
 #elif BITS_PER_LONG==64
-#define MAX_LFS_FILESIZE       0x7fffffffffffffff
+#define MAX_LFS_FILESIZE       0x7fffffffffffffffUL
 #endif
 
 #define FL_POSIX       1