All of lore.kernel.org
 help / color / mirror / Atom feed
* [brgl-linux:at24/for-next 4/6] drivers/nvmem/core.c:354:10: warning: returning 'long int' from a function with return type 'struct nvmem_device *' makes pointer from integer without a cast
@ 2020-01-09 20:49 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-01-09 20:49 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5133 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git at24/for-next
head:   1c89074bf85068d1b86f2e0f0c2110fdd9b83c9f
commit: 2a127da461a9d8d97782d6e82b227041393eb4d2 [4/6] nvmem: add support for the write-protect pin
config: arc-randconfig-a001-20200109 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 2a127da461a9d8d97782d6e82b227041393eb4d2
        # save the attached .config to linux build tree
        GCC_VERSION=9.2.0 make.cross ARCH=arc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   drivers/nvmem/core.c: In function 'nvmem_register':
>> drivers/nvmem/core.c:354:10: warning: returning 'long int' from a function with return type 'struct nvmem_device *' makes pointer from integer without a cast [-Wint-conversion]
     354 |   return PTR_ERR(nvmem->wp_gpio);
         |          ^~~~~~~~~~~~~~~~~~~~~~~

vim +354 drivers/nvmem/core.c

   320	
   321	/**
   322	 * nvmem_register() - Register a nvmem device for given nvmem_config.
   323	 * Also creates an binary entry in /sys/bus/nvmem/devices/dev-name/nvmem
   324	 *
   325	 * @config: nvmem device configuration with which nvmem device is created.
   326	 *
   327	 * Return: Will be an ERR_PTR() on error or a valid pointer to nvmem_device
   328	 * on success.
   329	 */
   330	
   331	struct nvmem_device *nvmem_register(const struct nvmem_config *config)
   332	{
   333		struct nvmem_device *nvmem;
   334		int rval;
   335	
   336		if (!config->dev)
   337			return ERR_PTR(-EINVAL);
   338	
   339		nvmem = kzalloc(sizeof(*nvmem), GFP_KERNEL);
   340		if (!nvmem)
   341			return ERR_PTR(-ENOMEM);
   342	
   343		rval  = ida_simple_get(&nvmem_ida, 0, 0, GFP_KERNEL);
   344		if (rval < 0) {
   345			kfree(nvmem);
   346			return ERR_PTR(rval);
   347		}
   348		if (config->wp_gpio)
   349			nvmem->wp_gpio = config->wp_gpio;
   350		else
   351			nvmem->wp_gpio = gpiod_get_optional(config->dev, "wp",
   352							    GPIOD_OUT_HIGH);
   353		if (IS_ERR(nvmem->wp_gpio))
 > 354			return PTR_ERR(nvmem->wp_gpio);
   355	
   356	
   357		kref_init(&nvmem->refcnt);
   358		INIT_LIST_HEAD(&nvmem->cells);
   359	
   360		nvmem->id = rval;
   361		nvmem->owner = config->owner;
   362		if (!nvmem->owner && config->dev->driver)
   363			nvmem->owner = config->dev->driver->owner;
   364		nvmem->stride = config->stride ?: 1;
   365		nvmem->word_size = config->word_size ?: 1;
   366		nvmem->size = config->size;
   367		nvmem->dev.type = &nvmem_provider_type;
   368		nvmem->dev.bus = &nvmem_bus_type;
   369		nvmem->dev.parent = config->dev;
   370		nvmem->priv = config->priv;
   371		nvmem->type = config->type;
   372		nvmem->reg_read = config->reg_read;
   373		nvmem->reg_write = config->reg_write;
   374		if (!config->no_of_node)
   375			nvmem->dev.of_node = config->dev->of_node;
   376	
   377		if (config->id == -1 && config->name) {
   378			dev_set_name(&nvmem->dev, "%s", config->name);
   379		} else {
   380			dev_set_name(&nvmem->dev, "%s%d",
   381				     config->name ? : "nvmem",
   382				     config->name ? config->id : nvmem->id);
   383		}
   384	
   385		nvmem->read_only = device_property_present(config->dev, "read-only") ||
   386				   config->read_only || !nvmem->reg_write;
   387	
   388		nvmem->dev.groups = nvmem_sysfs_get_groups(nvmem, config);
   389	
   390		device_initialize(&nvmem->dev);
   391	
   392		dev_dbg(&nvmem->dev, "Registering nvmem device %s\n", config->name);
   393	
   394		rval = device_add(&nvmem->dev);
   395		if (rval)
   396			goto err_put_device;
   397	
   398		if (config->compat) {
   399			rval = nvmem_sysfs_setup_compat(nvmem, config);
   400			if (rval)
   401				goto err_device_del;
   402		}
   403	
   404		if (config->cells) {
   405			rval = nvmem_add_cells(nvmem, config->cells, config->ncells);
   406			if (rval)
   407				goto err_teardown_compat;
   408		}
   409	
   410		rval = nvmem_add_cells_from_table(nvmem);
   411		if (rval)
   412			goto err_remove_cells;
   413	
   414		rval = nvmem_add_cells_from_of(nvmem);
   415		if (rval)
   416			goto err_remove_cells;
   417	
   418		blocking_notifier_call_chain(&nvmem_notifier, NVMEM_ADD, nvmem);
   419	
   420		return nvmem;
   421	
   422	err_remove_cells:
   423		nvmem_device_remove_all_cells(nvmem);
   424	err_teardown_compat:
   425		if (config->compat)
   426			nvmem_sysfs_remove_compat(nvmem, config);
   427	err_device_del:
   428		device_del(&nvmem->dev);
   429	err_put_device:
   430		put_device(&nvmem->dev);
   431	
   432		return ERR_PTR(rval);
   433	}
   434	EXPORT_SYMBOL_GPL(nvmem_register);
   435	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 27292 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-01-09 20:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-09 20:49 [brgl-linux:at24/for-next 4/6] drivers/nvmem/core.c:354:10: warning: returning 'long int' from a function with return type 'struct nvmem_device *' makes pointer from integer without a cast kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.