grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

UFS byte swapping


From: Hollis Blanchard
Subject: UFS byte swapping
Date: Tue, 22 Nov 2005 21:32:24 -0600

This warning has been annoying me for quite some time:
        ../fs/ufs.c: In function `grub_ufs_find_file':
        ../fs/ufs.c:474: warning: declaration of `_x' shadows a previous local
        ../fs/ufs.c:474: warning: shadowed declaration is here
        ../fs/ufs.c:474: warning: declaration of `_x' shadows a previous local
        ../fs/ufs.c:474: warning: shadowed declaration is here

The line in question:
    } while (pos < grub_le_to_cpu32 (INODE_SIZE (data)));

This warning coincidentally calls attention to a bug that would otherwise be unnoticed.

From a look at INODE_SIZE, you can see that "data" is being swapped twice. On big-endian systems it will be done twice; on wrong-endian it won't happen at all. Based on that, and other users of INODE_SIZE, I'm going to remove the extra swap, but I would like to know how this code can be tested.

-Hollis





reply via email to

[Prev in Thread] Current Thread [Next in Thread]