From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 11 Nov 2014 10:09:03 -0700 Subject: [U-Boot] [PATCH v2] fs: make it possible to read the filesystem UUID In-Reply-To: <1415710543-2606-1-git-send-email-christian.gmeiner@gmail.com> References: <1415710543-2606-1-git-send-email-christian.gmeiner@gmail.com> Message-ID: <546242AF.80507@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 (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.