From 3b47da5b18b4463d7d146534182c40b95b6ca6d4 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Diego=20E.=20'Flameeyes'=20Petten=C3=B2?= Date: Wed, 7 Jan 2009 01:02:37 +0100 Subject: [PATCH] Swap the constant when comparing values read from disk. This way the swap can be done at build-time without doing it on the running system. Upon comment by Harvey Harrison. --- fs/hfsplus/dir.c | 2 +- fs/hfsplus/super.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c index 5f40236..16f825b 100644 --- a/fs/hfsplus/dir.c +++ b/fs/hfsplus/dir.c @@ -139,7 +139,7 @@ static int hfsplus_readdir(struct file *filp, void *dirent, filldir_t filldir) /* fall through */ case 1: hfs_bnode_read(fd.bnode, &entry, fd.entryoffset, fd.entrylength); - if (be16_to_cpu(entry.type) != HFSPLUS_FOLDER_THREAD) { + if (entry.type != cpu_to_be16(HFSPLUS_FOLDER_THREAD)) { printk(KERN_ERR "hfs: bad catalog folder thread\n"); err = -EIO; goto out; diff --git a/fs/hfsplus/super.c b/fs/hfsplus/super.c index b5d1153..7ef993b 100644 --- a/fs/hfsplus/super.c +++ b/fs/hfsplus/super.c @@ -182,7 +182,7 @@ static void hfsplus_write_super(struct super_block *sb) bh = sb_bread(sb, block); if (bh) { vhdr = (struct hfsplus_vh *)(bh->b_data + offset); - if (be16_to_cpu(vhdr->signature) == HFSPLUS_VOLHEAD_SIG) { + if (vhdr->signature == cpu_to_be16(HFSPLUS_VOLHEAD_SIG)) { memcpy(vhdr, HFSPLUS_SB(sb).s_vhdr, sizeof(*vhdr)); mark_buffer_dirty(bh); brelse(bh); -- 1.6.0.6