[U-Boot] [PATCH v2] fs: make it possible to read the filesystem UUID

Stephen Warren swarren at wwwdotorg.org
Tue Nov 11 18:09:03 CET 2014


On 11/11/2014 05:55 AM, Christian Gmeiner wrote:
> Some filesystems have a UUID stored in its superblock. To
> allow using root=UUID=... for the kernel command line we
> need a way to read-out the filesystem UUID.

Just one more nit below, otherwise,

Acked-by: Stephen Warren <swarren at nvidia.com>

(feel free to add that the patch description for any repost)

> diff --git a/fs/ext4/ext4fs.c b/fs/ext4/ext4fs.c

> +int ext4fs_uuid(char *uuid_str)
> +{
> +	if (ext4fs_root == NULL)
> +		return -1;
> +
> +#ifdef CONFIG_LIB_UUID
> +	uuid_bin_to_str((unsigned char *)ext4fs_root->sblock.unique_id,
> +			uuid_str, UUID_STR_FORMAT_STD);
> +
> +	return 0;
> +#endif
> +
> +	return -ENOSYS;
> +}

If CONFIG_LIB_UUID is defined, doesn't that generate an unreachable code 
warning for the second return statement? I think you want a #if ... 
#else ... #endif to avoid that.


More information about the U-Boot mailing list