[agraf-2.6:kvm-kho-gmem-test 24/27] drivers/misc/fdbox.c:504:12: error: initializing 'ulong *' (aka 'unsigned long *') with an expression of type 'const void *' discards qualifiers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://github.com/agraf/linux-2.6.git kvm-kho-gmem-test
head:   9a58862a298a63bad21d05191e28b857063bb9dc
commit: eac026594b9dc0e92a0093a3443b9bc973be99a4 [24/27] XXX WIP
config: i386-randconfig-141-20240505 (https://download.01.org/0day-ci/archive/20240505/202405050321.MKZxcasf-lkp@xxxxxxxxx/config)
compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240505/202405050321.MKZxcasf-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405050321.MKZxcasf-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

   In file included from drivers/misc/fdbox.c:13:
   include/linux/kexec.h:369:20: error: field has incomplete type 'struct kexec_buf'
     369 |                 struct kexec_buf dt;
         |                                  ^
   include/linux/kexec.h:369:10: note: forward declaration of 'struct kexec_buf'
     369 |                 struct kexec_buf dt;
         |                        ^
   include/linux/kexec.h:370:20: error: field has incomplete type 'struct kexec_buf'
     370 |                 struct kexec_buf mem_cache;
         |                                  ^
   include/linux/kexec.h:369:10: note: forward declaration of 'struct kexec_buf'
     369 |                 struct kexec_buf dt;
         |                        ^
>> drivers/misc/fdbox.c:504:12: error: initializing 'ulong *' (aka 'unsigned long *') with an expression of type 'const void *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
     504 |                                 ulong *link = fdt_getprop(fdt, fd, "link", &l);
         |                                        ^      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   3 errors generated.


vim +504 drivers/misc/fdbox.c

   448	
   449	static void fdbox_kho_recover(void)
   450	{
   451		const void *fdt = kho_get_fdt();
   452		const char *path = "/fdbox";
   453		int fdbox, box, fd;
   454		int err;
   455	
   456		/* Not a KHO boot */
   457		if (!fdt)
   458			return;
   459	
   460		fdbox = fdt_path_offset(fdt, path);
   461		if (fdbox < 0) {
   462			pr_debug("Could not find '%s' in DT", path);
   463			return;
   464		}
   465	
   466		err = fdt_node_check_compatible(fdt, fdbox, "fdbox-v1");
   467		if (err) {
   468			char p[256] = "";
   469			fdt_get_path(fdt, fdbox, p, sizeof(p) - 1);
   470			pr_warn("Node '%s' has invalid compatible", p);
   471			return;
   472		}
   473	
   474		fdt_for_each_subnode(box, fdt, fdbox) {
   475			struct fdbox_create_box create_box = {
   476				.flags = 0,
   477			};
   478			struct box *new_box;
   479	
   480			strncpy(create_box.name, fdt_get_name(fdt, box, NULL), sizeof(create_box.name) - 1);
   481	
   482			err = fdt_node_check_compatible(fdt, box, "fdbox,box-v1");
   483			if (err) {
   484				char p[256] = "";
   485				fdt_get_path(fdt, box, p, sizeof(p) - 1);
   486				pr_warn("Node '%s' has invalid compatible", p);
   487				continue;
   488			}
   489	
   490			err = _fdbox_create_box(&create_box, &new_box);
   491			if (err) {
   492				char p[256] = "";
   493				fdt_get_path(fdt, box, p, sizeof(p) - 1);
   494				pr_warn("Node '%s' could not spawn", p);
   495				continue;
   496			}
   497	
   498			new_box->wrapped = true;
   499			
   500			fdt_for_each_subnode(fd, fdt, box) {
   501				if (!fdt_node_check_compatible(fdt, fd, "fdbox,fd-v1")) {
   502					int l;
   503					struct box_dangle *dangle;
 > 504					ulong *link = fdt_getprop(fdt, fd, "link", &l);
   505					struct fdbox_fd put_fd = {
   506						.flags = 0,
   507						.fd = -1,
   508					};
   509					struct box_fd *box_fd;
   510	
   511					strncpy(put_fd.name, fdt_get_name(fdt, fd, NULL), sizeof(put_fd.name) - 1);
   512	
   513					if (!link || l != sizeof(ulong))
   514						continue;
   515					dangle = find_dangle(*link);
   516					box_fd = fdbox_put_file(new_box, &put_fd, dangle->file);
   517					if (!box_fd)
   518						continue;
   519					list_del(&dangle->next);
   520				} else {
   521					char p[256] = "";
   522					fdt_get_path(fdt, fd, p, sizeof(p) - 1);
   523					pr_warn("Node '%s' has invalid compatible", p);
   524				}
   525			}
   526		}
   527	}
   528	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux