[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202301040834.YsMHDMpw-lkp@intel.com>
Date: Wed, 4 Jan 2023 08:45:00 +0800
From: kernel test robot <lkp@...el.com>
To: Eddie James <eajames@...ux.ibm.com>,
linux-integrity@...r.kernel.org
Cc: llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
linux-kernel@...r.kernel.org, jgg@...pe.ca, jarkko@...nel.org,
peterhuewe@....de, joel@....id.au,
Eddie James <eajames@...ux.ibm.com>
Subject: Re: [PATCH] tpm: Add reserved memory event log
Hi Eddie,
I love your patch! Perhaps something to improve:
[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on char-misc/char-misc-next char-misc/char-misc-linus linus/master v6.2-rc2 next-20221226]
[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#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Eddie-James/tpm-Add-reserved-memory-event-log/20230104-002229
patch link: https://lore.kernel.org/r/20230103162010.381214-1-eajames%40linux.ibm.com
patch subject: [PATCH] tpm: Add reserved memory event log
config: arm-buildonly-randconfig-r005-20230101
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 7a8cb6cd4e3ff8aaadebff2b9d3ee9e2a326d444)
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 arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/6aebeea318ade8b695dc36f4c5a2ad166ae4f1a7
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Eddie-James/tpm-Add-reserved-memory-event-log/20230104-002229
git checkout 6aebeea318ade8b695dc36f4c5a2ad166ae4f1a7
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash drivers/char/tpm/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>
All warnings (new ones prefixed by >>):
In file included from drivers/char/tpm/tpm-chip.c:24:
include/linux/tpm_eventlog.h:167:6: warning: variable 'mapping_size' set but not used [-Wunused-but-set-variable]
int mapping_size;
^
>> drivers/char/tpm/tpm-chip.c:327:22: warning: cast from 'void (*)(const void *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
chip->log.release = (void(*)(void *))kfree;
^~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
vim +327 drivers/char/tpm/tpm-chip.c
302
303 /**
304 * tpm_chip_alloc() - allocate a new struct tpm_chip instance
305 * @pdev: device to which the chip is associated
306 * At this point pdev mst be initialized, but does not have to
307 * be registered
308 * @ops: struct tpm_class_ops instance
309 *
310 * Allocates a new struct tpm_chip instance and assigns a free
311 * device number for it. Must be paired with put_device(&chip->dev).
312 */
313 struct tpm_chip *tpm_chip_alloc(struct device *pdev,
314 const struct tpm_class_ops *ops)
315 {
316 struct tpm_chip *chip;
317 int rc;
318
319 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
320 if (chip == NULL)
321 return ERR_PTR(-ENOMEM);
322
323 mutex_init(&chip->tpm_mutex);
324 init_rwsem(&chip->ops_sem);
325
326 chip->ops = ops;
> 327 chip->log.release = (void(*)(void *))kfree;
328
329 mutex_lock(&idr_lock);
330 rc = idr_alloc(&dev_nums_idr, NULL, 0, TPM_NUM_DEVICES, GFP_KERNEL);
331 mutex_unlock(&idr_lock);
332 if (rc < 0) {
333 dev_err(pdev, "No available tpm device numbers\n");
334 kfree(chip);
335 return ERR_PTR(rc);
336 }
337 chip->dev_num = rc;
338
339 device_initialize(&chip->dev);
340
341 chip->dev.class = tpm_class;
342 chip->dev.class->shutdown_pre = tpm_class_shutdown;
343 chip->dev.release = tpm_dev_release;
344 chip->dev.parent = pdev;
345 chip->dev.groups = chip->groups;
346
347 if (chip->dev_num == 0)
348 chip->dev.devt = MKDEV(MISC_MAJOR, TPM_MINOR);
349 else
350 chip->dev.devt = MKDEV(MAJOR(tpm_devt), chip->dev_num);
351
352 rc = dev_set_name(&chip->dev, "tpm%d", chip->dev_num);
353 if (rc)
354 goto out;
355
356 if (!pdev)
357 chip->flags |= TPM_CHIP_FLAG_VIRTUAL;
358
359 cdev_init(&chip->cdev, &tpm_fops);
360 chip->cdev.owner = THIS_MODULE;
361
362 rc = tpm2_init_space(&chip->work_space, TPM2_SPACE_BUFFER_SIZE);
363 if (rc) {
364 rc = -ENOMEM;
365 goto out;
366 }
367
368 chip->locality = -1;
369 return chip;
370
371 out:
372 put_device(&chip->dev);
373 return ERR_PTR(rc);
374 }
375 EXPORT_SYMBOL_GPL(tpm_chip_alloc);
376
--
0-DAY CI Kernel Test Service
https://01.org/lkp
View attachment "config" of type "text/plain" (167999 bytes)
Powered by blists - more mailing lists