]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_loader: remove unused members from struct efi_disk_obj
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Mon, 25 Dec 2023 04:43:54 +0000 (13:43 +0900)
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 13 Jan 2024 17:17:46 +0000 (18:17 +0100)
part and dev_index in struct efi_disk_obj are not used,
let's remove it.

This commit also removes the invalid structure comment
for @dev, it does not exist.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_loader/efi_disk.c

index ed997008c4ed7d49e605c9b6fab5dfee439307df..013842f077668c2e9744bb1c7ee5631e8fb7a91e 100644 (file)
@@ -31,20 +31,15 @@ const efi_guid_t efi_system_partition_guid = PARTITION_SYSTEM_GUID;
  *
  * @header:    EFI object header
  * @ops:       EFI disk I/O protocol interface
- * @dev_index: device index of block device
  * @media:     block I/O media information
  * @dp:                device path to the block device
- * @part:      partition
  * @volume:    simple file system protocol of the partition
- * @dev:       associated DM device
  */
 struct efi_disk_obj {
        struct efi_object header;
        struct efi_block_io ops;
-       int dev_index;
        struct efi_block_io_media media;
        struct efi_device_path *dp;
-       unsigned int part;
        struct efi_simple_file_system_protocol *volume;
 };
 
@@ -382,7 +377,6 @@ static int efi_fs_exists(struct blk_desc *desc, int part)
  * @parent:            parent handle
  * @dp_parent:         parent device path
  * @desc:              internal block device
- * @dev_index:         device index for block device
  * @part_info:         partition info
  * @part:              partition
  * @disk:              pointer to receive the created handle
@@ -393,7 +387,6 @@ static efi_status_t efi_disk_add_dev(
                                efi_handle_t parent,
                                struct efi_device_path *dp_parent,
                                struct blk_desc *desc,
-                               int dev_index,
                                struct disk_partition *part_info,
                                unsigned int part,
                                struct efi_disk_obj **disk,
@@ -455,7 +448,6 @@ static efi_status_t efi_disk_add_dev(
                diskobj->dp = efi_dp_from_part(desc, part);
                diskobj->media.last_block = desc->lba - 1;
        }
-       diskobj->part = part;
 
        /*
         * Install the device path and the block IO protocol.
@@ -498,7 +490,6 @@ static efi_status_t efi_disk_add_dev(
                        goto error;
        }
        diskobj->ops = block_io_disk_template;
-       diskobj->dev_index = dev_index;
 
        /* Fill in EFI IO Media info (for read/write callbacks) */
        diskobj->media.removable_media = desc->removable;
@@ -518,7 +509,7 @@ static efi_status_t efi_disk_add_dev(
 
        EFI_PRINT("BlockIO: part %u, present %d, logical %d, removable %d"
                  ", last_block %llu\n",
-                 diskobj->part,
+                 part,
                  diskobj->media.media_present,
                  diskobj->media.logical_partition,
                  diskobj->media.removable_media,
@@ -565,7 +556,7 @@ static int efi_disk_create_raw(struct udevice *dev, efi_handle_t agent_handle)
        diskid = desc->devnum;
 
        ret = efi_disk_add_dev(NULL, NULL, desc,
-                              diskid, NULL, 0, &disk, agent_handle);
+                              NULL, 0, &disk, agent_handle);
        if (ret != EFI_SUCCESS) {
                if (ret == EFI_NOT_READY) {
                        log_notice("Disk %s not ready\n", dev->name);
@@ -626,7 +617,7 @@ static int efi_disk_create_part(struct udevice *dev, efi_handle_t agent_handle)
                return -1;
        dp_parent = (struct efi_device_path *)handler->protocol_interface;
 
-       ret = efi_disk_add_dev(parent, dp_parent, desc, diskid,
+       ret = efi_disk_add_dev(parent, dp_parent, desc,
                               info, part, &disk, agent_handle);
        if (ret != EFI_SUCCESS) {
                log_err("Adding partition for %s failed\n", dev->name);