lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202210261011.9HTf8gQp-lkp@intel.com>
Date:   Wed, 26 Oct 2022 10:15:23 +0800
From:   kernel test robot <lkp@...el.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     oe-kbuild-all@...ts.linux.dev, devel@...verdev.osuosl.org,
        linux-kernel@...r.kernel.org
Subject: [driver-core:kobject-const 25/27]
 arch/mips/sgi-ip22/ip22-gio.c:388:22: error: initialization of 'int
 (*)(const struct device *, struct kobj_uevent_env *)' from incompatible
 pointer type 'int (*)(struct device *, struct kobj_uevent_env *)'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git kobject-const
head:   f14cb4b015ec0dd52034a4c66fcb581538e51095
commit: d9fe66b89e04a5adc6d116321f79dcb73e4181a7 [25/27] driver core: make struct bus_type.uevent() take a const *
config: mips-buildonly-randconfig-r002-20221024 (attached as .config)
compiler: mips64-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?id=d9fe66b89e04a5adc6d116321f79dcb73e4181a7
        git remote add driver-core https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git
        git fetch --no-tags driver-core kobject-const
        git checkout d9fe66b89e04a5adc6d116321f79dcb73e4181a7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=mips SHELL=/bin/bash arch/mips/sgi-ip22/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All errors (new ones prefixed by >>):

   arch/mips/sgi-ip22/ip22-gio.c:249:6: warning: no previous prototype for 'ip22_gio_set_64bit' [-Wmissing-prototypes]
     249 | void ip22_gio_set_64bit(int slotno)
         |      ^~~~~~~~~~~~~~~~~~
>> arch/mips/sgi-ip22/ip22-gio.c:388:22: error: initialization of 'int (*)(const struct device *, struct kobj_uevent_env *)' from incompatible pointer type 'int (*)(struct device *, struct kobj_uevent_env *)' [-Werror=incompatible-pointer-types]
     388 |         .uevent    = gio_device_uevent,
         |                      ^~~~~~~~~~~~~~~~~
   arch/mips/sgi-ip22/ip22-gio.c:388:22: note: (near initialization for 'gio_bus_type.uevent')
   arch/mips/sgi-ip22/ip22-gio.c:398:12: warning: no previous prototype for 'ip22_gio_init' [-Wmissing-prototypes]
     398 | int __init ip22_gio_init(void)
         |            ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors


vim +388 arch/mips/sgi-ip22/ip22-gio.c

e84de0c6190503 Thomas Bogendoerfer 2011-11-22  248  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22 @249  void ip22_gio_set_64bit(int slotno)
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  250  {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  251  	u32 tmp = sgimc->giopar;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  252  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  253  	switch (slotno) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  254  	case 0:
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  255  		tmp |= SGIMC_GIOPAR_GFX64;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  256  		break;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  257  	case 1:
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  258  		tmp |= SGIMC_GIOPAR_EXP064;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  259  		break;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  260  	case 2:
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  261  		tmp |= SGIMC_GIOPAR_EXP164;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  262  		break;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  263  	}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  264  	sgimc->giopar = tmp;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  265  }
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  266  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  267  static int ip22_gio_id(unsigned long addr, u32 *res)
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  268  {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  269  	u8 tmp8;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  270  	u8 tmp16;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  271  	u32 tmp32;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  272  	u8 *ptr8;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  273  	u16 *ptr16;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  274  	u32 *ptr32;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  275  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  276  	ptr32 = (void *)CKSEG1ADDR(addr);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  277  	if (!get_dbe(tmp32, ptr32)) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  278  		/*
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  279  		 * We got no DBE, but this doesn't mean anything.
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  280  		 * If GIO is pipelined (which can't be disabled
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  281  		 * for GFX slot) we don't get a DBE, but we see
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  282  		 * the transfer size as data. So we do an 8bit
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  283  		 * and a 16bit access and check whether the common
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  284  		 * data matches
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  285  		 */
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  286  		ptr8 = (void *)CKSEG1ADDR(addr + 3);
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  287  		if (get_dbe(tmp8, ptr8)) {
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  288  			/*
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  289  			 * 32bit access worked, but 8bit doesn't
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  290  			 * so we don't see phantom reads on
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  291  			 * a pipelined bus, but a real card which
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  292  			 * doesn't support 8 bit reads
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  293  			 */
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  294  			*res = tmp32;
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  295  			return 1;
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  296  		}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  297  		ptr16 = (void *)CKSEG1ADDR(addr + 2);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  298  		get_dbe(tmp16, ptr16);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  299  		if (tmp8 == (tmp16 & 0xff) &&
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  300  		    tmp8 == (tmp32 & 0xff) &&
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  301  		    tmp16 == (tmp32 & 0xffff)) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  302  			*res = tmp32;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  303  			return 1;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  304  		}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  305  	}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  306  	return 0; /* nothing here */
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  307  }
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  308  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  309  #define HQ2_MYSTERY_OFFS       0x6A07C
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  310  #define NEWPORT_USTATUS_OFFS   0xF133C
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  311  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  312  static int ip22_is_gr2(unsigned long addr)
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  313  {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  314  	u32 tmp;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  315  	u32 *ptr;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  316  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  317  	/* HQ2 only allows 32bit accesses */
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  318  	ptr = (void *)CKSEG1ADDR(addr + HQ2_MYSTERY_OFFS);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  319  	if (!get_dbe(tmp, ptr)) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  320  		if (tmp == 0xdeadbeef)
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  321  			return 1;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  322  	}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  323  	return 0;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  324  }
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  325  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  326  
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  327  static void ip22_check_gio(int slotno, unsigned long addr, int irq)
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  328  {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  329  	const char *name = "Unknown";
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  330  	struct gio_device *gio_dev;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  331  	u32 tmp;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  332  	__u8 id;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  333  	int i;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  334  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  335  	/* first look for GR2/GR3 by checking mystery register */
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  336  	if (ip22_is_gr2(addr))
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  337  		tmp = 0x7f;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  338  	else {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  339  		if (!ip22_gio_id(addr, &tmp)) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  340  			/*
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  341  			 * no GIO signature at start address of slot
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  342  			 * since Newport doesn't have one, we check if
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  343  			 * user status register is readable
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  344  			 */
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  345  			if (ip22_gio_id(addr + NEWPORT_USTATUS_OFFS, &tmp))
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  346  				tmp = 0x7e;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  347  			else
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  348  				tmp = 0;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  349  		}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  350  	}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  351  	if (tmp) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  352  		id = GIO_ID(tmp);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  353  		if (tmp & GIO_32BIT_ID) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  354  			if (tmp & GIO_64BIT_IFACE)
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  355  				ip22_gio_set_64bit(slotno);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  356  		}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  357  		for (i = 0; i < ARRAY_SIZE(gio_name_table); i++) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  358  			if (id == gio_name_table[i].id) {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  359  				name = gio_name_table[i].name;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  360  				break;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  361  			}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  362  		}
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  363  		printk(KERN_INFO "GIO: slot %d : %s (id %x)\n",
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  364  		       slotno, name, id);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  365  		gio_dev = kzalloc(sizeof *gio_dev, GFP_KERNEL);
f93e2a100ee73a Xiaoke Wang         2022-03-25  366  		if (!gio_dev)
f93e2a100ee73a Xiaoke Wang         2022-03-25  367  			return;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  368  		gio_dev->name = name;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  369  		gio_dev->slotno = slotno;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  370  		gio_dev->id.id = id;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  371  		gio_dev->resource.start = addr;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  372  		gio_dev->resource.end = addr + 0x3fffff;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  373  		gio_dev->resource.flags = IORESOURCE_MEM;
1d421ca9d7edba Thomas Bogendoerfer 2014-06-04  374  		gio_dev->irq = irq;
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  375  		dev_set_name(&gio_dev->dev, "%d", slotno);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  376  		gio_device_register(gio_dev);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  377  	} else
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  378  		printk(KERN_INFO "GIO: slot %d : Empty\n", slotno);
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  379  }
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  380  
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  381  static struct bus_type gio_bus_type = {
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  382  	.name	   = "gio",
136e882fccecea Greg Kroah-Hartman  2017-06-06  383  	.dev_groups = gio_dev_groups,
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  384  	.match	   = gio_bus_match,
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  385  	.probe	   = gio_device_probe,
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  386  	.remove	   = gio_device_remove,
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  387  	.shutdown  = gio_device_shutdown,
e84de0c6190503 Thomas Bogendoerfer 2011-11-22 @388  	.uevent	   = gio_device_uevent,
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  389  };
e84de0c6190503 Thomas Bogendoerfer 2011-11-22  390  

:::::: The code at line 388 was first introduced by commit
:::::: e84de0c61905030a0fe66b7210b6f1bb7c3e1eab MIPS: GIO bus support for SGI IP22/28

:::::: TO: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
:::::: CC: Ralf Baechle <ralf@...ux-mips.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Download attachment ".config.gz" of type "application/gzip" (27447 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ