Commit edadc05f authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sparse: fixes for "assignment expression in conditional" in fs/*

From: Mika Kukkonen <mika@osdl.org>

Fix various sparse "assignment expression in conditional" warnings in fs/
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 11e4e1e8
...@@ -201,7 +201,7 @@ affs_remove_link(struct dentry *dentry) ...@@ -201,7 +201,7 @@ affs_remove_link(struct dentry *dentry)
goto done; goto done;
} }
while ((ino = be32_to_cpu(AFFS_TAIL(sb, bh)->link_chain))) { while ((ino = be32_to_cpu(AFFS_TAIL(sb, bh)->link_chain)) != 0) {
if (ino == link_ino) { if (ino == link_ino) {
ino = AFFS_TAIL(sb, link_bh)->link_chain; ino = AFFS_TAIL(sb, link_bh)->link_chain;
AFFS_TAIL(sb, bh)->link_chain = ino; AFFS_TAIL(sb, bh)->link_chain = ino;
......
...@@ -172,7 +172,7 @@ static int afs_super_parse_options(struct afs_mount_params *params, ...@@ -172,7 +172,7 @@ static int afs_super_parse_options(struct afs_mount_params *params,
options[PAGE_SIZE - 1] = 0; options[PAGE_SIZE - 1] = 0;
ret = 0; ret = 0;
while ((key = strsep(&options, ","))) while ((key = strsep(&options, ",")) != 0)
{ {
value = strchr(key, '='); value = strchr(key, '=');
if (value) if (value)
......
...@@ -183,7 +183,7 @@ int autofs_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_toke ...@@ -183,7 +183,7 @@ int autofs_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_toke
{ {
struct autofs_wait_queue *wq, **wql; struct autofs_wait_queue *wq, **wql;
for ( wql = &sbi->queues ; (wq = *wql) ; wql = &wq->next ) { for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) {
if ( wq->wait_queue_token == wait_queue_token ) if ( wq->wait_queue_token == wait_queue_token )
break; break;
} }
......
...@@ -275,7 +275,7 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok ...@@ -275,7 +275,7 @@ int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_tok
struct autofs_wait_queue *wq, **wql; struct autofs_wait_queue *wq, **wql;
down(&sbi->wq_sem); down(&sbi->wq_sem);
for ( wql = &sbi->queues ; (wq = *wql) ; wql = &wq->next ) { for ( wql = &sbi->queues ; (wq = *wql) != 0 ; wql = &wq->next ) {
if ( wq->wait_queue_token == wait_queue_token ) if ( wq->wait_queue_token == wait_queue_token )
break; break;
} }
......
...@@ -802,7 +802,7 @@ static void ep_free(struct eventpoll *ep) ...@@ -802,7 +802,7 @@ static void ep_free(struct eventpoll *ep)
* write-holding "sem" we can be sure that no file cleanup code will hit * write-holding "sem" we can be sure that no file cleanup code will hit
* us during this operation. So we can avoid the lock on "ep->lock". * us during this operation. So we can avoid the lock on "ep->lock".
*/ */
while ((rbp = rb_first(&ep->rbr))) { while ((rbp = rb_first(&ep->rbr)) != 0) {
epi = rb_entry(rbp, struct epitem, rbn); epi = rb_entry(rbp, struct epitem, rbn);
ep_remove(ep, epi); ep_remove(ep, epi);
} }
......
...@@ -161,7 +161,7 @@ static int parse_options(char *options, struct hfs_sb_info *hsb) ...@@ -161,7 +161,7 @@ static int parse_options(char *options, struct hfs_sb_info *hsb)
if (!options) if (!options)
return 1; return 1;
while ((this_char = strsep(&options, ","))) { while ((this_char = strsep(&options, ",")) != 0) {
if (!*this_char) if (!*this_char)
continue; continue;
value = strchr(this_char, '='); value = strchr(this_char, '=');
......
...@@ -34,7 +34,7 @@ void hfs_bnode_read(struct hfs_bnode *node, void *buf, int off, int len) ...@@ -34,7 +34,7 @@ void hfs_bnode_read(struct hfs_bnode *node, void *buf, int off, int len)
memcpy(buf, kmap(*pagep) + off, l); memcpy(buf, kmap(*pagep) + off, l);
kunmap(*pagep); kunmap(*pagep);
while ((len -= l)) { while ((len -= l) != 0) {
buf += l; buf += l;
l = min(len, (int)PAGE_CACHE_SIZE); l = min(len, (int)PAGE_CACHE_SIZE);
memcpy(buf, kmap(*++pagep), l); memcpy(buf, kmap(*++pagep), l);
...@@ -87,7 +87,7 @@ void hfs_bnode_write(struct hfs_bnode *node, void *buf, int off, int len) ...@@ -87,7 +87,7 @@ void hfs_bnode_write(struct hfs_bnode *node, void *buf, int off, int len)
set_page_dirty(*pagep); set_page_dirty(*pagep);
kunmap(*pagep); kunmap(*pagep);
while ((len -= l)) { while ((len -= l) != 0) {
buf += l; buf += l;
l = min(len, (int)PAGE_CACHE_SIZE); l = min(len, (int)PAGE_CACHE_SIZE);
memcpy(kmap(*++pagep), buf, l); memcpy(kmap(*++pagep), buf, l);
...@@ -117,7 +117,7 @@ void hfs_bnode_clear(struct hfs_bnode *node, int off, int len) ...@@ -117,7 +117,7 @@ void hfs_bnode_clear(struct hfs_bnode *node, int off, int len)
set_page_dirty(*pagep); set_page_dirty(*pagep);
kunmap(*pagep); kunmap(*pagep);
while ((len -= l)) { while ((len -= l) != 0) {
l = min(len, (int)PAGE_CACHE_SIZE); l = min(len, (int)PAGE_CACHE_SIZE);
memset(kmap(*++pagep), 0, l); memset(kmap(*++pagep), 0, l);
set_page_dirty(*pagep); set_page_dirty(*pagep);
...@@ -150,7 +150,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst, ...@@ -150,7 +150,7 @@ void hfs_bnode_copy(struct hfs_bnode *dst_node, int dst,
set_page_dirty(*dst_page); set_page_dirty(*dst_page);
kunmap(*dst_page); kunmap(*dst_page);
while ((len -= l)) { while ((len -= l) != 0) {
l = min(len, (int)PAGE_CACHE_SIZE); l = min(len, (int)PAGE_CACHE_SIZE);
memcpy(kmap(*++dst_page), kmap(*++src_page), l); memcpy(kmap(*++dst_page), kmap(*++src_page), l);
kunmap(*src_page); kunmap(*src_page);
...@@ -258,7 +258,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len) ...@@ -258,7 +258,7 @@ void hfs_bnode_move(struct hfs_bnode *node, int dst, int src, int len)
set_page_dirty(*dst_page); set_page_dirty(*dst_page);
kunmap(*dst_page); kunmap(*dst_page);
while ((len -= l)) { while ((len -= l) != 0) {
l = min(len, (int)PAGE_CACHE_SIZE); l = min(len, (int)PAGE_CACHE_SIZE);
memmove(kmap(*++dst_page), kmap(*++src_page), l); memmove(kmap(*++dst_page), kmap(*++src_page), l);
kunmap(*src_page); kunmap(*src_page);
......
...@@ -135,7 +135,7 @@ int hfsplus_read_wrapper(struct super_block *sb) ...@@ -135,7 +135,7 @@ int hfsplus_read_wrapper(struct super_block *sb)
return -EINVAL; return -EINVAL;
HFSPLUS_SB(sb).alloc_blksz = blocksize; HFSPLUS_SB(sb).alloc_blksz = blocksize;
HFSPLUS_SB(sb).alloc_blksz_shift = 0; HFSPLUS_SB(sb).alloc_blksz_shift = 0;
while (blocksize >>= 1) while ((blocksize >>= 1) != 0)
HFSPLUS_SB(sb).alloc_blksz_shift++; HFSPLUS_SB(sb).alloc_blksz_shift++;
blocksize = min(HFSPLUS_SB(sb).alloc_blksz, (u32)PAGE_SIZE); blocksize = min(HFSPLUS_SB(sb).alloc_blksz, (u32)PAGE_SIZE);
......
...@@ -88,7 +88,7 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne ...@@ -88,7 +88,7 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne
goto rt; goto rt;
}*/ }*/
q = nr + n; b = 0; q = nr + n; b = 0;
while ((a = tstbits(bmp, q, n + forward))) { while ((a = tstbits(bmp, q, n + forward)) != 0) {
q += a; q += a;
if (n != 1) q = ((q-1)&~(n-1))+n; if (n != 1) q = ((q-1)&~(n-1))+n;
if (!b) { if (!b) {
...@@ -116,7 +116,7 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne ...@@ -116,7 +116,7 @@ static secno alloc_in_bmp(struct super_block *s, secno near, unsigned n, unsigne
} }
} }
if (n != 1) q = ((q-1)&~(n-1))+n; if (n != 1) q = ((q-1)&~(n-1))+n;
while ((a = tstbits(bmp, q, n + forward))) { while ((a = tstbits(bmp, q, n + forward)) != 0) {
q += a; q += a;
if (n != 1) q = ((q-1)&~(n-1))+n; if (n != 1) q = ((q-1)&~(n-1))+n;
if (q>>5 > i) break; if (q>>5 > i) break;
......
...@@ -533,7 +533,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno) ...@@ -533,7 +533,7 @@ extBalloc(struct inode *ip, s64 hint, s64 * nblocks, s64 * blkno)
nb = nblks = *nblocks; nb = nblks = *nblocks;
/* try to allocate blocks */ /* try to allocate blocks */
while ((rc = dbAlloc(ip, hint, nb, &daddr))) { while ((rc = dbAlloc(ip, hint, nb, &daddr)) != 0) {
/* if something other than an out of space error, /* if something other than an out of space error,
* stop and return this error. * stop and return this error.
*/ */
......
...@@ -2321,7 +2321,7 @@ int jfsIOWait(void *arg) ...@@ -2321,7 +2321,7 @@ int jfsIOWait(void *arg)
DECLARE_WAITQUEUE(wq, current); DECLARE_WAITQUEUE(wq, current);
spin_lock_irq(&log_redrive_lock); spin_lock_irq(&log_redrive_lock);
while ((bp = log_redrive_list)) { while ((bp = log_redrive_list) != 0) {
log_redrive_list = bp->l_redrive_next; log_redrive_list = bp->l_redrive_next;
bp->l_redrive_next = NULL; bp->l_redrive_next = NULL;
spin_unlock_irq(&log_redrive_lock); spin_unlock_irq(&log_redrive_lock);
......
...@@ -2580,7 +2580,7 @@ void txFreelock(struct inode *ip) ...@@ -2580,7 +2580,7 @@ void txFreelock(struct inode *ip)
TXN_LOCK(); TXN_LOCK();
xtlck = (struct tlock *) &jfs_ip->atlhead; xtlck = (struct tlock *) &jfs_ip->atlhead;
while ((lid = xtlck->next)) { while ((lid = xtlck->next) != 0) {
tlck = lid_to_tlock(lid); tlck = lid_to_tlock(lid);
if (tlck->flag & tlckFREELOCK) { if (tlck->flag & tlckFREELOCK) {
xtlck->next = tlck->next; xtlck->next = tlck->next;
......
...@@ -76,7 +76,7 @@ nlm_lookup_host(int server, struct sockaddr_in *sin, ...@@ -76,7 +76,7 @@ nlm_lookup_host(int server, struct sockaddr_in *sin,
if (time_after_eq(jiffies, next_gc)) if (time_after_eq(jiffies, next_gc))
nlm_gc_hosts(); nlm_gc_hosts();
for (hp = &nlm_hosts[hash]; (host = *hp); hp = &host->h_next) { for (hp = &nlm_hosts[hash]; (host = *hp) != 0; hp = &host->h_next) {
if (host->h_proto != proto) if (host->h_proto != proto)
continue; continue;
if (host->h_version != version) if (host->h_version != version)
...@@ -145,7 +145,7 @@ nlm_find_client(void) ...@@ -145,7 +145,7 @@ nlm_find_client(void)
down(&nlm_host_sema); down(&nlm_host_sema);
for (hash = 0 ; hash < NLM_HOST_NRHASH; hash++) { for (hash = 0 ; hash < NLM_HOST_NRHASH; hash++) {
struct nlm_host *host, **hp; struct nlm_host *host, **hp;
for (hp = &nlm_hosts[hash]; (host = *hp) ; hp = &host->h_next) { for (hp = &nlm_hosts[hash]; (host = *hp) != 0; hp = &host->h_next) {
if (host->h_server && if (host->h_server &&
host->h_killed == 0) { host->h_killed == 0) {
nlm_get_host(host); nlm_get_host(host);
......
...@@ -67,7 +67,7 @@ nlmsvc_insert_block(struct nlm_block *block, unsigned long when) ...@@ -67,7 +67,7 @@ nlmsvc_insert_block(struct nlm_block *block, unsigned long when)
while ((b = *bp) && time_before_eq(b->b_when,when) && b->b_when != NLM_NEVER) while ((b = *bp) && time_before_eq(b->b_when,when) && b->b_when != NLM_NEVER)
bp = &b->b_next; bp = &b->b_next;
} else } else
while ((b = *bp)) while ((b = *bp) != 0)
bp = &b->b_next; bp = &b->b_next;
block->b_queued = 1; block->b_queued = 1;
...@@ -86,7 +86,7 @@ nlmsvc_remove_block(struct nlm_block *block) ...@@ -86,7 +86,7 @@ nlmsvc_remove_block(struct nlm_block *block)
if (!block->b_queued) if (!block->b_queued)
return 1; return 1;
for (bp = &nlm_blocked; (b = *bp); bp = &b->b_next) { for (bp = &nlm_blocked; (b = *bp) != 0; bp = &b->b_next) {
if (b == block) { if (b == block) {
*bp = block->b_next; *bp = block->b_next;
block->b_queued = 0; block->b_queued = 0;
...@@ -111,7 +111,7 @@ nlmsvc_lookup_block(struct nlm_file *file, struct nlm_lock *lock, int remove) ...@@ -111,7 +111,7 @@ nlmsvc_lookup_block(struct nlm_file *file, struct nlm_lock *lock, int remove)
file, lock->fl.fl_pid, file, lock->fl.fl_pid,
(long long)lock->fl.fl_start, (long long)lock->fl.fl_start,
(long long)lock->fl.fl_end, lock->fl.fl_type); (long long)lock->fl.fl_end, lock->fl.fl_type);
for (head = &nlm_blocked; (block = *head); head = &block->b_next) { for (head = &nlm_blocked; (block = *head) != 0; head = &block->b_next) {
fl = &block->b_call.a_args.lock.fl; fl = &block->b_call.a_args.lock.fl;
dprintk("lockd: check f=%p pd=%d %Ld-%Ld ty=%d cookie=%x\n", dprintk("lockd: check f=%p pd=%d %Ld-%Ld ty=%d cookie=%x\n",
block->b_file, fl->fl_pid, block->b_file, fl->fl_pid,
...@@ -468,7 +468,7 @@ nlmsvc_notify_blocked(struct file_lock *fl) ...@@ -468,7 +468,7 @@ nlmsvc_notify_blocked(struct file_lock *fl)
struct nlm_block **bp, *block; struct nlm_block **bp, *block;
dprintk("lockd: VFS unblock notification for block %p\n", fl); dprintk("lockd: VFS unblock notification for block %p\n", fl);
for (bp = &nlm_blocked; (block = *bp); bp = &block->b_next) { for (bp = &nlm_blocked; (block = *bp) != 0; bp = &block->b_next) {
if (nlm_compare_locks(&block->b_call.a_args.lock.fl, fl)) { if (nlm_compare_locks(&block->b_call.a_args.lock.fl, fl)) {
nlmsvc_insert_block(block, 0); nlmsvc_insert_block(block, 0);
svc_wake_up(block->b_daemon); svc_wake_up(block->b_daemon);
...@@ -653,7 +653,7 @@ nlmsvc_retry_blocked(void) ...@@ -653,7 +653,7 @@ nlmsvc_retry_blocked(void)
dprintk("nlmsvc_retry_blocked(%p, when=%ld)\n", dprintk("nlmsvc_retry_blocked(%p, when=%ld)\n",
nlm_blocked, nlm_blocked,
nlm_blocked? nlm_blocked->b_when : 0); nlm_blocked? nlm_blocked->b_when : 0);
while ((block = nlm_blocked)) { while ((block = nlm_blocked) != 0) {
if (block->b_when == NLM_NEVER) if (block->b_when == NLM_NEVER)
break; break;
if (time_after(block->b_when,jiffies)) if (time_after(block->b_when,jiffies))
......
...@@ -71,7 +71,7 @@ nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file, ...@@ -71,7 +71,7 @@ nlmsvc_unshare_file(struct nlm_host *host, struct nlm_file *file,
struct nlm_share *share, **shpp; struct nlm_share *share, **shpp;
struct xdr_netobj *oh = &argp->lock.oh; struct xdr_netobj *oh = &argp->lock.oh;
for (shpp = &file->f_shares; (share = *shpp); shpp = &share->s_next) { for (shpp = &file->f_shares; (share = *shpp) != 0; shpp = &share->s_next) {
if (share->s_host == host && nlm_cmp_owner(share, oh)) { if (share->s_host == host && nlm_cmp_owner(share, oh)) {
*shpp = share->s_next; *shpp = share->s_next;
kfree(share); kfree(share);
......
...@@ -141,7 +141,7 @@ void sync_dquots(struct super_block *sb, int type) ...@@ -141,7 +141,7 @@ void sync_dquots(struct super_block *sb, int type)
sb->s_qcop->quota_sync(sb, type); sb->s_qcop->quota_sync(sb, type);
} }
else { else {
while ((sb = get_super_to_sync(type))) { while ((sb = get_super_to_sync(type)) != 0) {
if (sb->s_qcop->quota_sync) if (sb->s_qcop->quota_sync)
sb->s_qcop->quota_sync(sb, type); sb->s_qcop->quota_sync(sb, type);
drop_super(sb); drop_super(sb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment