Skip to contentSkip to conversation

fix valid but harmless sparse warning in xfs_log_recovery.c

PATCH In review Christoph Hellwig 1 participant 2 messages Sep 17, 2007 – Sep 19, 2007 1 message not in the archive XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix valid but harmless sparse warning in xfs_log_recovery.c

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.

fs/xfs/xfs_log_recover.c +2 -2
Index: linux-2.6-xfs/fs/xfs/xfs_log_recover.c
===================================================================
@@ -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++;
 		}
 

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 1 line · Lachlan McIlroy

Ah thanks for that, my goof.

Can you and Tim make sure this goes to Linus? I saw Tim sent out your original fix, and I really don't want to regress on sparse warnings in mainline.