From: Eric Sandeen Date: Sun, 31 May 2015 21:15:38 +0000 (+1000) Subject: xfs: don't cast string literals X-Git-Tag: v4.2.0-rc3~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=efb358200aed8193219d4e16bc48a83b81bdff76;p=thirdparty%2Fxfsprogs-dev.git xfs: don't cast string literals The commit: a9273ca5 xfs: convert attr to use unsigned names added these (unsigned char *) casts, but then the _SIZE macros return "7" - size of a pointer minus one - not the length of the string. This is harmless in the kernel, because the _SIZE macros are not used, but as we sync up with userspace, this will matter. I don't think the cast is necessary; i.e. assigning the string literal to an unsigned char *, or passing it to a function expecting an unsigned char *, should be ok, right? Signed-off-by: Eric Sandeen Reviewed-by: Brian Foster Signed-off-by: Dave Chinner --- diff --git a/libxfs/xfs_format.h b/libxfs/xfs_format.h index bb7cc043d..3c98635f2 100644 --- a/libxfs/xfs_format.h +++ b/libxfs/xfs_format.h @@ -1492,8 +1492,8 @@ struct xfs_acl { sizeof(struct xfs_acl_entry) * XFS_ACL_MAX_ENTRIES((mp))) /* On-disk XFS extended attribute names */ -#define SGI_ACL_FILE (char *)"SGI_ACL_FILE" -#define SGI_ACL_DEFAULT (char *)"SGI_ACL_DEFAULT" +#define SGI_ACL_FILE "SGI_ACL_FILE" +#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT" #define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1)