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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202409271341.0dhpXk7G-lkp@intel.com>
Date: Fri, 27 Sep 2024 14:00:40 +0800
From: kernel test robot <lkp@...el.com>
To: Petar Stoykov <pd.pstoykov@...il.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Jonathan Cameron <Jonathan.Cameron@...wei.com>
Subject: drivers/iio/pressure/sdp500.c:130:undefined reference to
 `crc8_populate_msb'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   075dbe9f6e3c21596c5245826a4ee1f1c1676eb8
commit: 6ddb86d93cc08c00eccc1a14980f7260e4fbe2bc iio: pressure: Add driver for Sensirion SDP500
date:   8 weeks ago
config: sh-randconfig-r054-20240801 (https://download.01.org/0day-ci/archive/20240927/202409271341.0dhpXk7G-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 13.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240927/202409271341.0dhpXk7G-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202409271341.0dhpXk7G-lkp@intel.com/

All errors (new ones prefixed by >>):

   sh4-linux-ld: drivers/iio/pressure/sdp500.o: in function `sdp500_probe':
>> drivers/iio/pressure/sdp500.c:130:(.text+0xe8): undefined reference to `crc8_populate_msb'
   sh4-linux-ld: drivers/iio/pressure/sdp500.o: in function `sdp500_read_raw':
>> drivers/iio/pressure/sdp500.c:74:(.text+0x200): undefined reference to `crc8'


vim +130 drivers/iio/pressure/sdp500.c

    40	
    41	static int sdp500_read_raw(struct iio_dev *indio_dev,
    42				  struct iio_chan_spec const *chan,
    43				  int *val, int *val2, long mask)
    44	{
    45		int ret;
    46		u8 rxbuf[SDP500_READ_SIZE];
    47		u8 received_crc, calculated_crc;
    48		struct sdp500_data *data = iio_priv(indio_dev);
    49		struct i2c_client *client = to_i2c_client(data->dev);
    50	
    51		switch (mask) {
    52		case IIO_CHAN_INFO_RAW:
    53			ret = i2c_master_recv(client, rxbuf, SDP500_READ_SIZE);
    54			if (ret < 0) {
    55				dev_err(data->dev, "Failed to receive data");
    56				return ret;
    57			}
    58			if (ret != SDP500_READ_SIZE) {
    59				dev_err(data->dev, "Data is received wrongly");
    60				return -EIO;
    61			}
    62	
    63			received_crc = rxbuf[2];
    64			calculated_crc = crc8(sdp500_crc8_table, rxbuf,
    65					      sizeof(rxbuf) - 1, 0x00);
    66			if (received_crc != calculated_crc) {
    67				dev_err(data->dev,
    68					"calculated crc = 0x%.2X, received 0x%.2X",
    69					calculated_crc, received_crc);
    70				return -EIO;
    71			}
    72	
    73			*val = get_unaligned_be16(rxbuf);
  > 74			return IIO_VAL_INT;
    75		case IIO_CHAN_INFO_SCALE:
    76			*val = 1;
    77			*val2 = 60;
    78	
    79			return IIO_VAL_FRACTIONAL;
    80		default:
    81			return -EINVAL;
    82		}
    83	}
    84	
    85	static const struct iio_info sdp500_info = {
    86		.read_raw = &sdp500_read_raw,
    87	};
    88	
    89	static int sdp500_probe(struct i2c_client *client)
    90	{
    91		struct iio_dev *indio_dev;
    92		struct sdp500_data *data;
    93		struct device *dev = &client->dev;
    94		int ret;
    95		u8 rxbuf[SDP500_READ_SIZE];
    96	
    97		ret = devm_regulator_get_enable(dev, "vdd");
    98		if (ret)
    99			return dev_err_probe(dev, ret,
   100				"Failed to get and enable regulator\n");
   101	
   102		indio_dev = devm_iio_device_alloc(dev, sizeof(*data));
   103		if (!indio_dev)
   104			return -ENOMEM;
   105	
   106		/* has to be done before the first i2c communication */
   107		crc8_populate_msb(sdp500_crc8_table, SDP500_CRC8_POLYNOMIAL);
   108	
   109		data = iio_priv(indio_dev);
   110		data->dev = dev;
   111	
   112		indio_dev->name = "sdp500";
   113		indio_dev->channels = sdp500_channels;
   114		indio_dev->info = &sdp500_info;
   115		indio_dev->modes = INDIO_DIRECT_MODE;
   116		indio_dev->num_channels = ARRAY_SIZE(sdp500_channels);
   117	
   118		ret = sdp500_start_measurement(data);
   119		if (ret)
   120			return dev_err_probe(dev, ret, "Failed to start measurement");
   121	
   122		/* First measurement is not correct, read it out to get rid of it */
   123		i2c_master_recv(client, rxbuf, SDP500_READ_SIZE);
   124	
   125		ret = devm_iio_device_register(dev, indio_dev);
   126		if (ret)
   127			return dev_err_probe(dev, ret, "Failed to register indio_dev");
   128	
   129		return 0;
 > 130	}
   131	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ