All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jiri Prchal <jiri.prchal@aksignal.cz>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	Rob Herring <robh+dt@kernel.org>,
	Christian Eggers <ceggers@arri.de>, Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Prchal <jiri.prchal@aksignal.cz>,
	kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v10 2/4] nvmem: eeprom: at25: add support for FRAM
Date: Thu, 17 Jun 2021 02:59:48 +0800	[thread overview]
Message-ID: <202106170221.fGCSlK4p-lkp@intel.com> (raw)
In-Reply-To: <20210611094601.95131-3-jiri.prchal@aksignal.cz>

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

Hi Jiri,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linux/master linus/master v5.13-rc6]
[cannot apply to char-misc/char-misc-testing next-20210616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jiri-Prchal/add-support-for-FRAM/20210616-203024
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: x86_64-randconfig-a015-20210615 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/663658b01091a6ef4239088cc41d96821ab6d43e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jiri-Prchal/add-support-for-FRAM/20210616-203024
        git checkout 663658b01091a6ef4239088cc41d96821ab6d43e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/misc/eeprom/at25.c:367:13: warning: cast to smaller integer type 'int' from 'const void *' [-Wvoid-pointer-to-int-cast]
                   is_fram = (int)match->data;
                             ^~~~~~~~~~~~~~~~
   1 warning generated.


vim +367 drivers/misc/eeprom/at25.c

   354	
   355	static int at25_probe(struct spi_device *spi)
   356	{
   357		struct at25_data	*at25 = NULL;
   358		struct spi_eeprom	chip;
   359		int			err;
   360		int			sr;
   361		u8 id[FM25_ID_LEN];
   362		const struct of_device_id *match;
   363		int is_fram = 0;
   364	
   365		match = of_match_device(of_match_ptr(at25_of_match), &spi->dev);
   366		if (match)
 > 367			is_fram = (int)match->data;
   368	
   369		/* Chip description */
   370		if (!spi->dev.platform_data) {
   371			if (!is_fram) {
   372				err = at25_fw_to_chip(&spi->dev, &chip);
   373				if (err)
   374					return err;
   375			}
   376		} else
   377			chip = *(struct spi_eeprom *)spi->dev.platform_data;
   378	
   379		/* Ping the chip ... the status register is pretty portable,
   380		 * unlike probing manufacturer IDs.  We do expect that system
   381		 * firmware didn't write it in the past few milliseconds!
   382		 */
   383		sr = spi_w8r8(spi, AT25_RDSR);
   384		if (sr < 0 || sr & AT25_SR_nRDY) {
   385			dev_dbg(&spi->dev, "rdsr --> %d (%02x)\n", sr, sr);
   386			return -ENXIO;
   387		}
   388	
   389		at25 = devm_kzalloc(&spi->dev, sizeof(struct at25_data), GFP_KERNEL);
   390		if (!at25)
   391			return -ENOMEM;
   392	
   393		mutex_init(&at25->lock);
   394		at25->chip = chip;
   395		at25->spi = spi;
   396		spi_set_drvdata(spi, at25);
   397	
   398		if (is_fram) {
   399			/* Get ID of chip */
   400			fm25_aux_read(at25, id, FM25_RDID, FM25_ID_LEN);
   401			if (id[6] != 0xc2) {
   402				dev_err(&spi->dev,
   403					"Error: no Cypress FRAM (id %02x)\n", id[6]);
   404				return -ENODEV;
   405			}
   406			/* set size found in ID */
   407			if (id[7] < 0x21 || id[7] > 0x26) {
   408				dev_err(&spi->dev, "Error: unsupported size (id %02x)\n", id[7]);
   409				return -ENODEV;
   410			}
   411			chip.byte_len = int_pow(2, id[7] - 0x21 + 4) * 1024;
   412	
   413			if (at25->chip.byte_len > 64 * 1024)
   414				at25->chip.flags |= EE_ADDR3;
   415			else
   416				at25->chip.flags |= EE_ADDR2;
   417	
   418			at25->chip.page_size = PAGE_SIZE;
   419			strncpy(at25->chip.name, "fm25", sizeof(at25->chip.name));
   420		}
   421	
   422		/* For now we only support 8/16/24 bit addressing */
   423		if (at25->chip.flags & EE_ADDR1)
   424			at25->addrlen = 1;
   425		else if (at25->chip.flags & EE_ADDR2)
   426			at25->addrlen = 2;
   427		else if (at25->chip.flags & EE_ADDR3)
   428			at25->addrlen = 3;
   429		else {
   430			dev_dbg(&spi->dev, "unsupported address type\n");
   431			return -EINVAL;
   432		}
   433	
   434		at25->nvmem_config.type = is_fram ? NVMEM_TYPE_FRAM : NVMEM_TYPE_EEPROM;
   435		at25->nvmem_config.name = dev_name(&spi->dev);
   436		at25->nvmem_config.dev = &spi->dev;
   437		at25->nvmem_config.read_only = chip.flags & EE_READONLY;
   438		at25->nvmem_config.root_only = true;
   439		at25->nvmem_config.owner = THIS_MODULE;
   440		at25->nvmem_config.compat = true;
   441		at25->nvmem_config.base_dev = &spi->dev;
   442		at25->nvmem_config.reg_read = at25_ee_read;
   443		at25->nvmem_config.reg_write = at25_ee_write;
   444		at25->nvmem_config.priv = at25;
   445		at25->nvmem_config.stride = 1;
   446		at25->nvmem_config.word_size = 1;
   447		at25->nvmem_config.size = chip.byte_len;
   448	
   449		at25->nvmem = devm_nvmem_register(&spi->dev, &at25->nvmem_config);
   450		if (IS_ERR(at25->nvmem))
   451			return PTR_ERR(at25->nvmem);
   452	
   453		dev_info(&spi->dev, "%d %s %s %s%s, pagesize %u\n",
   454			 (chip.byte_len < 1024) ? chip.byte_len : (chip.byte_len / 1024),
   455			 (chip.byte_len < 1024) ? "Byte" : "KByte",
   456			 at25->chip.name, is_fram ? "fram" : "eeprom",
   457			 (chip.flags & EE_READONLY) ? " (readonly)" : "",
   458			 at25->chip.page_size);
   459		return 0;
   460	}
   461	

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

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH v10 2/4] nvmem: eeprom: at25: add support for FRAM
Date: Thu, 17 Jun 2021 02:59:48 +0800	[thread overview]
Message-ID: <202106170221.fGCSlK4p-lkp@intel.com> (raw)
In-Reply-To: <20210611094601.95131-3-jiri.prchal@aksignal.cz>

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

Hi Jiri,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on linux/master linus/master v5.13-rc6]
[cannot apply to char-misc/char-misc-testing next-20210616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Jiri-Prchal/add-support-for-FRAM/20210616-203024
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: x86_64-randconfig-a015-20210615 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 64720f57bea6a6bf033feef4a5751ab9c0c3b401)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/663658b01091a6ef4239088cc41d96821ab6d43e
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jiri-Prchal/add-support-for-FRAM/20210616-203024
        git checkout 663658b01091a6ef4239088cc41d96821ab6d43e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/misc/eeprom/at25.c:367:13: warning: cast to smaller integer type 'int' from 'const void *' [-Wvoid-pointer-to-int-cast]
                   is_fram = (int)match->data;
                             ^~~~~~~~~~~~~~~~
   1 warning generated.


vim +367 drivers/misc/eeprom/at25.c

   354	
   355	static int at25_probe(struct spi_device *spi)
   356	{
   357		struct at25_data	*at25 = NULL;
   358		struct spi_eeprom	chip;
   359		int			err;
   360		int			sr;
   361		u8 id[FM25_ID_LEN];
   362		const struct of_device_id *match;
   363		int is_fram = 0;
   364	
   365		match = of_match_device(of_match_ptr(at25_of_match), &spi->dev);
   366		if (match)
 > 367			is_fram = (int)match->data;
   368	
   369		/* Chip description */
   370		if (!spi->dev.platform_data) {
   371			if (!is_fram) {
   372				err = at25_fw_to_chip(&spi->dev, &chip);
   373				if (err)
   374					return err;
   375			}
   376		} else
   377			chip = *(struct spi_eeprom *)spi->dev.platform_data;
   378	
   379		/* Ping the chip ... the status register is pretty portable,
   380		 * unlike probing manufacturer IDs.  We do expect that system
   381		 * firmware didn't write it in the past few milliseconds!
   382		 */
   383		sr = spi_w8r8(spi, AT25_RDSR);
   384		if (sr < 0 || sr & AT25_SR_nRDY) {
   385			dev_dbg(&spi->dev, "rdsr --> %d (%02x)\n", sr, sr);
   386			return -ENXIO;
   387		}
   388	
   389		at25 = devm_kzalloc(&spi->dev, sizeof(struct at25_data), GFP_KERNEL);
   390		if (!at25)
   391			return -ENOMEM;
   392	
   393		mutex_init(&at25->lock);
   394		at25->chip = chip;
   395		at25->spi = spi;
   396		spi_set_drvdata(spi, at25);
   397	
   398		if (is_fram) {
   399			/* Get ID of chip */
   400			fm25_aux_read(at25, id, FM25_RDID, FM25_ID_LEN);
   401			if (id[6] != 0xc2) {
   402				dev_err(&spi->dev,
   403					"Error: no Cypress FRAM (id %02x)\n", id[6]);
   404				return -ENODEV;
   405			}
   406			/* set size found in ID */
   407			if (id[7] < 0x21 || id[7] > 0x26) {
   408				dev_err(&spi->dev, "Error: unsupported size (id %02x)\n", id[7]);
   409				return -ENODEV;
   410			}
   411			chip.byte_len = int_pow(2, id[7] - 0x21 + 4) * 1024;
   412	
   413			if (at25->chip.byte_len > 64 * 1024)
   414				at25->chip.flags |= EE_ADDR3;
   415			else
   416				at25->chip.flags |= EE_ADDR2;
   417	
   418			at25->chip.page_size = PAGE_SIZE;
   419			strncpy(at25->chip.name, "fm25", sizeof(at25->chip.name));
   420		}
   421	
   422		/* For now we only support 8/16/24 bit addressing */
   423		if (at25->chip.flags & EE_ADDR1)
   424			at25->addrlen = 1;
   425		else if (at25->chip.flags & EE_ADDR2)
   426			at25->addrlen = 2;
   427		else if (at25->chip.flags & EE_ADDR3)
   428			at25->addrlen = 3;
   429		else {
   430			dev_dbg(&spi->dev, "unsupported address type\n");
   431			return -EINVAL;
   432		}
   433	
   434		at25->nvmem_config.type = is_fram ? NVMEM_TYPE_FRAM : NVMEM_TYPE_EEPROM;
   435		at25->nvmem_config.name = dev_name(&spi->dev);
   436		at25->nvmem_config.dev = &spi->dev;
   437		at25->nvmem_config.read_only = chip.flags & EE_READONLY;
   438		at25->nvmem_config.root_only = true;
   439		at25->nvmem_config.owner = THIS_MODULE;
   440		at25->nvmem_config.compat = true;
   441		at25->nvmem_config.base_dev = &spi->dev;
   442		at25->nvmem_config.reg_read = at25_ee_read;
   443		at25->nvmem_config.reg_write = at25_ee_write;
   444		at25->nvmem_config.priv = at25;
   445		at25->nvmem_config.stride = 1;
   446		at25->nvmem_config.word_size = 1;
   447		at25->nvmem_config.size = chip.byte_len;
   448	
   449		at25->nvmem = devm_nvmem_register(&spi->dev, &at25->nvmem_config);
   450		if (IS_ERR(at25->nvmem))
   451			return PTR_ERR(at25->nvmem);
   452	
   453		dev_info(&spi->dev, "%d %s %s %s%s, pagesize %u\n",
   454			 (chip.byte_len < 1024) ? chip.byte_len : (chip.byte_len / 1024),
   455			 (chip.byte_len < 1024) ? "Byte" : "KByte",
   456			 at25->chip.name, is_fram ? "fram" : "eeprom",
   457			 (chip.flags & EE_READONLY) ? " (readonly)" : "",
   458			 at25->chip.page_size);
   459		return 0;
   460	}
   461	

---
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: 40655 bytes --]

  reply	other threads:[~2021-06-16 19:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-11  9:45 [PATCH v10 0/4] add support for FRAM Jiri Prchal
2021-06-11  9:45 ` [PATCH v10 1/4] nvmem: prepare basics for FRAM support Jiri Prchal
2021-06-11  9:45 ` [PATCH v10 2/4] nvmem: eeprom: at25: add support for FRAM Jiri Prchal
2021-06-16 18:59   ` kernel test robot [this message]
2021-06-16 18:59     ` kernel test robot
2021-06-22  7:44   ` kernel test robot
2021-06-22  7:44     ` kernel test robot
2021-06-11  9:46 ` [PATCH v10 3/4] dt-bindings: nvmem: at25: add for FRAM support Jiri Prchal
2021-06-11  9:46 ` [PATCH v10 4/4] nvmem: eeprom: at25: export FRAM serial num Jiri Prchal
2021-06-16 20:10   ` kernel test robot
2021-06-16 20:10     ` kernel test robot
2021-06-22  9:33   ` kernel test robot
2021-06-22  9:33     ` kernel test robot
2021-06-11 10:25 ` [PATCH v10 0/4] add support for FRAM Greg Kroah-Hartman

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=202106170221.fGCSlK4p-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=arnd@arndb.de \
    --cc=ceggers@arri.de \
    --cc=clang-built-linux@googlegroups.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jiri.prchal@aksignal.cz \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.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.