* grub-core/osdep/linux/getroot.c: Fix cast-align problems.

This commit is contained in:
Vladimir Serbinenko 2013-11-03 00:43:49 +01:00
parent 48145ea358
commit 090d7c81cf
2 changed files with 11 additions and 9 deletions

View file

@ -1,3 +1,7 @@
2013-11-03 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/osdep/linux/getroot.c: Fix cast-align problems.
2013-11-02 Vladimir Serbinenko <phcoder@gmail.com> 2013-11-02 Vladimir Serbinenko <phcoder@gmail.com>
* configure.ac: Don't add -m32/-m64 on emu. * configure.ac: Don't add -m32/-m64 on emu.

View file

@ -102,8 +102,9 @@ struct btrfs_ioctl_search_key
}; };
struct btrfs_ioctl_search_args { struct btrfs_ioctl_search_args {
struct btrfs_ioctl_search_key key; struct btrfs_ioctl_search_key key;
char buf[4096 - sizeof(struct btrfs_ioctl_search_key)]; grub_uint64_t buf[(4096 - sizeof(struct btrfs_ioctl_search_key))
/ sizeof (grub_uint64_t)];
}; };
#define BTRFS_IOC_TREE_SEARCH _IOWR(0x94, 17, \ #define BTRFS_IOC_TREE_SEARCH _IOWR(0x94, 17, \
@ -283,7 +284,6 @@ get_btrfs_fs_prefix (const char *mount_path)
while (tree_id != GRUB_BTRFS_ROOT_VOL_OBJECTID while (tree_id != GRUB_BTRFS_ROOT_VOL_OBJECTID
|| inode_id != GRUB_BTRFS_TREE_ROOT_OBJECTID) || inode_id != GRUB_BTRFS_TREE_ROOT_OBJECTID)
{ {
grub_uint64_t *nid;
const char *name; const char *name;
size_t namelen; size_t namelen;
struct btrfs_ioctl_search_args sargs; struct btrfs_ioctl_search_args sargs;
@ -314,9 +314,8 @@ get_btrfs_fs_prefix (const char *mount_path)
if (sargs.key.nr_items == 0) if (sargs.key.nr_items == 0)
return NULL; return NULL;
nid = (grub_uint64_t *) (sargs.buf + 16); tree_id = sargs.buf[2];
tree_id = *nid; br = (struct grub_btrfs_root_backref *) (sargs.buf + 4);
br = (struct grub_btrfs_root_backref *) (sargs.buf + 32);
inode_id = br->inode_id; inode_id = br->inode_id;
name = br->name; name = br->name;
namelen = br->n; namelen = br->n;
@ -342,10 +341,9 @@ get_btrfs_fs_prefix (const char *mount_path)
if (sargs.key.nr_items == 0) if (sargs.key.nr_items == 0)
return NULL; return NULL;
nid = (grub_uint64_t *) (sargs.buf + 16); inode_id = sargs.buf[2];
inode_id = *nid;
ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 32); ir = (struct grub_btrfs_inode_ref *) (sargs.buf + 4);
name = ir->name; name = ir->name;
namelen = ir->n; namelen = ir->n;
} }