H. Peter Anvin
2013-May-10 19:48 UTC
[syslinux] [syslinux:firmware] efi: Lookup which file system we were loaded from
On 05/10/2013 06:27 AM, syslinux-bot for Matt Fleming wrote:> > diff --git a/efi/main.c b/efi/main.c > index 31f0bff..27e7f8f 100644 > --- a/efi/main.c > +++ b/efi/main.c > @@ -1177,13 +1177,10 @@ static void efi_setcwd(CHAR16 *dp) > > EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table) > { > + EFI_PXE_BASE_CODE *pxe; > EFI_LOADED_IMAGE *info; > EFI_STATUS status = EFI_SUCCESS; > -#if 0 > - const struct fs_ops *ops[] = { &vfat_fs_ops, NULL }; > -#else > - const struct fs_ops *ops[] = { &pxe_fs_ops, NULL }; > -#endif > + const struct fs_ops *ops[] = { NULL, NULL };Probably need to drop "const" here, no? -hpa
Matt Fleming
2013-May-13 11:25 UTC
[syslinux] [syslinux:firmware] efi: Lookup which file system we were loaded from
On Fri, 10 May, at 12:48:36PM, H. Peter Anvin wrote:> On 05/10/2013 06:27 AM, syslinux-bot for Matt Fleming wrote: > > > > diff --git a/efi/main.c b/efi/main.c > > index 31f0bff..27e7f8f 100644 > > --- a/efi/main.c > > +++ b/efi/main.c > > @@ -1177,13 +1177,10 @@ static void efi_setcwd(CHAR16 *dp) > > > > EFI_STATUS efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *table) > > { > > + EFI_PXE_BASE_CODE *pxe; > > EFI_LOADED_IMAGE *info; > > EFI_STATUS status = EFI_SUCCESS; > > -#if 0 > > - const struct fs_ops *ops[] = { &vfat_fs_ops, NULL }; > > -#else > > - const struct fs_ops *ops[] = { &pxe_fs_ops, NULL }; > > -#endif > > + const struct fs_ops *ops[] = { NULL, NULL }; > > Probably need to drop "const" here, no?Hmm... the compiler doesn't complain with the const, but does without, efi/main.c: In function ?efi_main?: efi/main.c:1217:10: warning: assignment discards ?const? qualifier from pointer target type [enabled by default] efi/main.c:1219:10: warning: assignment discards ?const? qualifier from pointer target type [enabled by default] efi/main.c:1238:2: warning: passing argument 1 of ?fs_init? from incompatible pointer type [enabled by default] In file included from efi/main.c:3:0: core/include/fs.h:188:6: note: expected ?const struct fs_ops **? but argument is of type ?struct fs_ops **? Is it not because the elements of the array are const, not the array itself? -- Matt Fleming, Intel Open Source Technology Center