public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix valid but harmless sparse warning in xfs_log_recovery.c
@ 2007-09-16 12:04 Christoph Hellwig
       [not found] ` <46EF6A6A.3080702@sgi.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Hellwig @ 2007-09-16 12:04 UTC (permalink / raw)
  To: xfs

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++;
 		}
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-19 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-16 12:04 [PATCH] fix valid but harmless sparse warning in xfs_log_recovery.c Christoph Hellwig
     [not found] ` <46EF6A6A.3080702@sgi.com>
2007-09-18 14:39   ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox