From: Andrew Morton Date: Mon, 16 Jul 2007 06:39:50 +0000 (-0700) Subject: fuse warning fix X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=21f3da95daed2d0f0c28cc4ef8b1103fbfb7bded;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git fuse warning fix gcc-4.3: fs/fuse/dir.c: In function 'parse_dirfile': fs/fuse/dir.c:833: warning: cast from pointer to integer of different size fs/fuse/dir.c:835: warning: cast from pointer to integer of different size [miklos@szeredi.hu: use offsetof] Acked-by: Miklos Szeredi Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 534744efe30d..9fbe9d258e22 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h @@ -339,7 +339,7 @@ struct fuse_dirent { char name[0]; }; -#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) +#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name) #define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) #define FUSE_DIRENT_SIZE(d) \ FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)