All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [PATCH] fix valid but harmless sparse warning in xfs_log_recovery.c
Date: Sun, 16 Sep 2007 14:04:33 +0200	[thread overview]
Message-ID: <20070916120433.GA31602@lst.de> (raw)

The new xlog_recover_do_reg_buffer checks call be16_to_cpu on di_gen
which is a 32bit value so sparse rightly complains.  Fortunately the
warning is harmless because we don't care for the value, but only
whether it's non-NULL.  Due to that fact we can simply kill the endian
swaps on this and the previous di_mode check entirely.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6-xfs/fs/xfs/xfs_log_recover.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/xfs_log_recover.c	2007-09-16 12:57:25.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/xfs_log_recover.c	2007-09-16 12:57:38.000000000 +0200
@@ -1920,9 +1920,9 @@ xlog_recover_do_reg_buffer(
 				stale_buf = 1;
 				break;
 			}
-			if (be16_to_cpu(dip->di_core.di_mode))
+			if (dip->di_core.di_mode)
 				mode_count++;
-			if (be16_to_cpu(dip->di_core.di_gen))
+			if (dip->di_core.di_gen)
 				gen_count++;
 		}
 

             reply	other threads:[~2007-09-17  2:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-16 12:04 Christoph Hellwig [this message]
     [not found] ` <46EF6A6A.3080702@sgi.com>
2007-09-18 14:39   ` [PATCH] fix valid but harmless sparse warning in xfs_log_recovery.c Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070916120433.GA31602@lst.de \
    --to=hch@lst.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.