All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [vishal-nvdimm:for-5.9/firmware-activate 8/10] drivers/nvdimm/region_devs.c:608:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_ADMIN_RO'
Date: Thu, 30 Jul 2020 16:10:56 +0800	[thread overview]
Message-ID: <202007301651.aJUO2yP6%lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vishal/nvdimm.git for-5.9/firmware-activate
head:   d62450f8b77310bc62ef67d60db40d1fd3251da9
commit: a54837b604a770f5c485847816bd6c570ab84880 [8/10] libnvdimm: Convert to DEVICE_ATTR_ADMIN_RO()
config: arm64-randconfig-r004-20200729 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.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
        git checkout a54837b604a770f5c485847816bd6c570ab84880
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

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

All errors (new ones prefixed by >>):

>> drivers/nvdimm/region_devs.c:608:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_ADMIN_RO' [-Werror=implicit-int]
     608 | static DEVICE_ATTR_ADMIN_RO(resource);
         |        ^~~~~~~~~~~~~~~~~~~~
   drivers/nvdimm/region_devs.c:608:1: warning: parameter names (without types) in function declaration
     608 | static DEVICE_ATTR_ADMIN_RO(resource);
         | ^~~~~~
>> drivers/nvdimm/region_devs.c:640:3: error: 'dev_attr_resource' undeclared here (not in a function); did you mean 'dev_attr_nstype'?
     640 |  &dev_attr_resource.attr,
         |   ^~~~~~~~~~~~~~~~~
         |   dev_attr_nstype
   drivers/nvdimm/region_devs.c: In function 'region_visible':
>> drivers/nvdimm/region_devs.c:661:29: error: request for member 'attr' in something not a structure or union
     661 |  if (a == &dev_attr_resource.attr && !is_memory(dev))
         |                             ^
   drivers/nvdimm/region_devs.c:661:8: warning: comparison of distinct pointer types lacks a cast
     661 |  if (a == &dev_attr_resource.attr && !is_memory(dev))
         |        ^~
   drivers/nvdimm/region_devs.c: At top level:
   drivers/nvdimm/region_devs.c:608:8: warning: 'DEVICE_ATTR_ADMIN_RO' declared 'static' but never defined [-Wunused-function]
     608 | static DEVICE_ATTR_ADMIN_RO(resource);
         |        ^~~~~~~~~~~~~~~~~~~~
   drivers/nvdimm/region_devs.c:601:16: warning: 'resource_show' defined but not used [-Wunused-function]
     601 | static ssize_t resource_show(struct device *dev,
         |                ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors
--
>> drivers/nvdimm/namespace_devs.c:1312:8: error: type defaults to 'int' in declaration of 'DEVICE_ATTR_ADMIN_RO' [-Werror=implicit-int]
    1312 | static DEVICE_ATTR_ADMIN_RO(resource);
         |        ^~~~~~~~~~~~~~~~~~~~
   drivers/nvdimm/namespace_devs.c:1312:1: warning: parameter names (without types) in function declaration
    1312 | static DEVICE_ATTR_ADMIN_RO(resource);
         | ^~~~~~
>> drivers/nvdimm/namespace_devs.c:1614:3: error: 'dev_attr_resource' undeclared here (not in a function); did you mean 'dev_attr_mode'?
    1614 |  &dev_attr_resource.attr,
         |   ^~~~~~~~~~~~~~~~~
         |   dev_attr_mode
   drivers/nvdimm/namespace_devs.c: In function 'namespace_visible':
>> drivers/nvdimm/namespace_devs.c:1628:29: error: request for member 'attr' in something not a structure or union
    1628 |  if (a == &dev_attr_resource.attr && is_namespace_blk(dev))
         |                             ^
   drivers/nvdimm/namespace_devs.c:1628:8: warning: comparison of distinct pointer types lacks a cast
    1628 |  if (a == &dev_attr_resource.attr && is_namespace_blk(dev))
         |        ^~
   drivers/nvdimm/namespace_devs.c: At top level:
   drivers/nvdimm/namespace_devs.c:1312:8: warning: 'DEVICE_ATTR_ADMIN_RO' declared 'static' but never defined [-Wunused-function]
    1312 | static DEVICE_ATTR_ADMIN_RO(resource);
         |        ^~~~~~~~~~~~~~~~~~~~
   drivers/nvdimm/namespace_devs.c:1291:16: warning: 'resource_show' defined but not used [-Wunused-function]
    1291 | static ssize_t resource_show(struct device *dev,
         |                ^~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +608 drivers/nvdimm/region_devs.c

   600	
   601	static ssize_t resource_show(struct device *dev,
   602			struct device_attribute *attr, char *buf)
   603	{
   604		struct nd_region *nd_region = to_nd_region(dev);
   605	
   606		return sprintf(buf, "%#llx\n", nd_region->ndr_start);
   607	}
 > 608	static DEVICE_ATTR_ADMIN_RO(resource);
   609	
   610	static ssize_t persistence_domain_show(struct device *dev,
   611			struct device_attribute *attr, char *buf)
   612	{
   613		struct nd_region *nd_region = to_nd_region(dev);
   614	
   615		if (test_bit(ND_REGION_PERSIST_CACHE, &nd_region->flags))
   616			return sprintf(buf, "cpu_cache\n");
   617		else if (test_bit(ND_REGION_PERSIST_MEMCTRL, &nd_region->flags))
   618			return sprintf(buf, "memory_controller\n");
   619		else
   620			return sprintf(buf, "\n");
   621	}
   622	static DEVICE_ATTR_RO(persistence_domain);
   623	
   624	static struct attribute *nd_region_attributes[] = {
   625		&dev_attr_size.attr,
   626		&dev_attr_align.attr,
   627		&dev_attr_nstype.attr,
   628		&dev_attr_mappings.attr,
   629		&dev_attr_btt_seed.attr,
   630		&dev_attr_pfn_seed.attr,
   631		&dev_attr_dax_seed.attr,
   632		&dev_attr_deep_flush.attr,
   633		&dev_attr_read_only.attr,
   634		&dev_attr_set_cookie.attr,
   635		&dev_attr_available_size.attr,
   636		&dev_attr_max_available_extent.attr,
   637		&dev_attr_namespace_seed.attr,
   638		&dev_attr_init_namespaces.attr,
   639		&dev_attr_badblocks.attr,
 > 640		&dev_attr_resource.attr,
   641		&dev_attr_persistence_domain.attr,
   642		NULL,
   643	};
   644	
   645	static umode_t region_visible(struct kobject *kobj, struct attribute *a, int n)
   646	{
   647		struct device *dev = container_of(kobj, typeof(*dev), kobj);
   648		struct nd_region *nd_region = to_nd_region(dev);
   649		struct nd_interleave_set *nd_set = nd_region->nd_set;
   650		int type = nd_region_to_nstype(nd_region);
   651	
   652		if (!is_memory(dev) && a == &dev_attr_pfn_seed.attr)
   653			return 0;
   654	
   655		if (!is_memory(dev) && a == &dev_attr_dax_seed.attr)
   656			return 0;
   657	
   658		if (!is_memory(dev) && a == &dev_attr_badblocks.attr)
   659			return 0;
   660	
 > 661		if (a == &dev_attr_resource.attr && !is_memory(dev))
   662			return 0;
   663	
   664		if (a == &dev_attr_deep_flush.attr) {
   665			int has_flush = nvdimm_has_flush(nd_region);
   666	
   667			if (has_flush == 1)
   668				return a->mode;
   669			else if (has_flush == 0)
   670				return 0444;
   671			else
   672				return 0;
   673		}
   674	
   675		if (a == &dev_attr_persistence_domain.attr) {
   676			if ((nd_region->flags & (BIT(ND_REGION_PERSIST_CACHE)
   677						| BIT(ND_REGION_PERSIST_MEMCTRL))) == 0)
   678				return 0;
   679			return a->mode;
   680		}
   681	
   682		if (a == &dev_attr_align.attr)
   683			return a->mode;
   684	
   685		if (a != &dev_attr_set_cookie.attr
   686				&& a != &dev_attr_available_size.attr)
   687			return a->mode;
   688	
   689		if ((type == ND_DEVICE_NAMESPACE_PMEM
   690					|| type == ND_DEVICE_NAMESPACE_BLK)
   691				&& a == &dev_attr_available_size.attr)
   692			return a->mode;
   693		else if (is_memory(dev) && nd_set)
   694			return a->mode;
   695	
   696		return 0;
   697	}
   698	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

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

                 reply	other threads:[~2020-07-30  8:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202007301651.aJUO2yP6%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.