]> xenbits.xensource.com Git - people/aperard/xen-unstable.git/commitdiff
xen/earlycpio: Drop nextoff parameter
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 27 Mar 2023 18:33:46 +0000 (19:33 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 24 Oct 2024 16:57:59 +0000 (17:57 +0100)
This is imported from Linux, but the parameter being signed is dubious in the
first place and we're not plausibly going to gain a use for the functionality.
Linux has subsequently made it an optional parameter to avoid forcing callers
to pass a stack variable they don't care about using.

In the unlikely case that we gain a usecase, we can reintroduce it, but in the
meantime simplify the single caller.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/cpu/microcode/core.c
xen/common/earlycpio.c
xen/include/xen/earlycpio.h

index 1d58cb0f3bc16c831cbcfa5dd34a4a49e8b44ff2..1e5fdd02e4617c460af702f7d156bae433095565 100644 (file)
@@ -158,7 +158,6 @@ static void __init microcode_scan_module(struct boot_info *bi)
     uint64_t *_blob_start;
     unsigned long _blob_size;
     struct cpio_data cd;
-    long offset;
     const char *p = NULL;
     int i;
 
@@ -191,7 +190,7 @@ static void __init microcode_scan_module(struct boot_info *bi)
         }
         cd.data = NULL;
         cd.size = 0;
-        cd = find_cpio_data(p, _blob_start, _blob_size, &offset /* ignore */);
+        cd = find_cpio_data(p, _blob_start, _blob_size);
         if ( cd.data )
         {
             ucode_blob.size = cd.size;
index 4bcf32a51cebeab68ce0dd2da7bdfa39fa1a6614..6c76307c2541104753a62331c2d60a16d1bb1c4c 100644 (file)
@@ -56,10 +56,6 @@ enum cpio_fields {
  * @path:       The directory to search for, including a slash at the end
  * @data:       Pointer to the the cpio archive or a header inside
  * @len:        Remaining length of the cpio based on data pointer
- * @nextoff:    When a matching file is found, this is the offset from the
- *              beginning of the cpio to the beginning of the next file, not the
- *              matching file itself. It can be used to iterate through the cpio
- *              to find all files inside of a directory path.
  *
  * @return:     struct cpio_data containing the address, length and
  *              filename (with the directory path cut off) of the found file.
@@ -68,8 +64,7 @@ enum cpio_fields {
  *              the match returned an empty filename string.
  */
 
-struct cpio_data __init find_cpio_data(const char *path, void *data,
-                                      size_t len,  long *nextoff)
+struct cpio_data __init find_cpio_data(const char *path, void *data, size_t len)
 {
        const size_t cpio_header_len = 8*C_NFIELDS - 2;
        struct cpio_data cd = { NULL, 0, "" };
@@ -129,7 +124,6 @@ struct cpio_data __init find_cpio_data(const char *path, void *data,
                if ((ch[C_MODE] & 0170000) == 0100000 &&
                    ch[C_NAMESIZE] >= mypathsize &&
                    !memcmp(p, path, mypathsize)) {
-                       *nextoff = (long)nptr - (long)data;
                        if (ch[C_NAMESIZE] - mypathsize >= MAX_CPIO_FILE_NAME) {
                                printk(
                                "File %s exceeding MAX_CPIO_FILE_NAME [%d]\n",
index 16d9404d739e0c1238d487fa193a044b78f67fe6..d4992035982daaf99eb9f146ba037eda08a90361 100644 (file)
@@ -9,7 +9,6 @@ struct cpio_data {
        char name[MAX_CPIO_FILE_NAME];
 };
 
-struct cpio_data find_cpio_data(const char *path, void *data, size_t len,
-                               long *offset);
+struct cpio_data find_cpio_data(const char *path, void *data, size_t len);
 
 #endif /* _EARLYCPIO_H */