mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
efi_loader: duplicate code in efi_dp_from_name
efi_dp_from_name() has duplicate code to replace slash by backslash. path_to_uefi() called by efi_dp_from_file() already does this. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
parent
d76184edc3
commit
bd646fc3de
1 changed files with 1 additions and 13 deletions
|
@ -1187,8 +1187,6 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
|
||||||
size_t image_size;
|
size_t image_size;
|
||||||
void *image_addr;
|
void *image_addr;
|
||||||
int part = 0;
|
int part = 0;
|
||||||
char *filename;
|
|
||||||
char *s;
|
|
||||||
|
|
||||||
if (path && !file)
|
if (path && !file)
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
|
@ -1220,17 +1218,7 @@ efi_status_t efi_dp_from_name(const char *dev, const char *devnr,
|
||||||
if (!path)
|
if (!path)
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
|
|
||||||
filename = calloc(1, strlen(path) + 1);
|
*file = efi_dp_from_file(desc, part, path);
|
||||||
if (!filename)
|
|
||||||
return EFI_OUT_OF_RESOURCES;
|
|
||||||
|
|
||||||
sprintf(filename, "%s", path);
|
|
||||||
/* DOS style file path: */
|
|
||||||
s = filename;
|
|
||||||
while ((s = strchr(s, '/')))
|
|
||||||
*s++ = '\\';
|
|
||||||
*file = efi_dp_from_file(desc, part, filename);
|
|
||||||
free(filename);
|
|
||||||
|
|
||||||
if (!*file)
|
if (!*file)
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue