Skip to contentSkip to conversation

fs/ufs/util.h 2nd parameter of fs32_to_cpu is not boolean

PATCH In review Roel Kluin 2 participants 2 messages Feb 16, 2008

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 fs/ufs/util.h 2nd parameter of fs32_to_cpu is not boolean

from: fs/befs/endian.h +33
static inline u32
fs32_to_cpu(const struct super_block *sb, fs32 n)

{
        if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
                return le32_to_cpu((__force __le32)n);
        else
                return be32_to_cpu((__force __be32)n);
}

The 2nd parameter is not boolean
---
Test the return value, rather than passing a boolean

---

fs/ufs/util.h +1 -1
index b26fc4d..23ceed8 100644
@@ -58,7 +58,7 @@ ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
 {
 	switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
 	case UFS_ST_SUNOS:
-		if (fs32_to_cpu(sb, usb3->fs_postblformat == UFS_42POSTBLFMT)) {
+		if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) {
 			usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
 			break;
 		}
Acked-by on v1 1/1
#1 lore raw
Quoted 21 lines · Roel Kluin

from: fs/befs/endian.h +33
static inline u32
fs32_to_cpu(const struct super_block *sb, fs32 n)

{
        if (BEFS_SB(sb)->byte_order == BEFS_BYTESEX_LE)
                return le32_to_cpu((__force __le32)n);
        else
                return be32_to_cpu((__force __be32)n);
}

The 2nd parameter is not boolean
---
Test the return value, rather than passing a boolean

---

fs/ufs/util.h +0 -0
index b26fc4d..23ceed8 100644

fs/ufs/util.h ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1, · line 64

Quoted 8 lines
fs/ufs/util.h +1 -1
@@ -58,7 +58,7 @@ ufs_set_fs_state(struct super_block *sb, struct ufs_super_block_first *usb1,
 {
 	switch (UFS_SB(sb)->s_flags & UFS_ST_MASK) {
 	case UFS_ST_SUNOS:
-		if (fs32_to_cpu(sb, usb3->fs_postblformat == UFS_42POSTBLFMT)) {
+		if (fs32_to_cpu(sb, usb3->fs_postblformat) == UFS_42POSTBLFMT) {
 			usb1->fs_u0.fs_sun.fs_state = cpu_to_fs32(sb, value);
 			break;
 		}

Yeah, in origin patch, which introduced this code was the similar misprint. It is sad that after review only one was fixed, and the second go to mainline.

Signature · 1 line
/Evgeniy