Hi Daniel,
I love your patch! Yet something to improve:
[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on soc/for-next linus/master v5.8-rc5 next-20200716]
[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/Daniel-Gutson/Firmware-security-...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
fadbfc38dde26d31e901c3c85cf01332cb6a2224
config: x86_64-allyesconfig (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
ed6b578040a85977026c93bf4188f996148f3218)
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
# 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(a)intel.com>
All errors (new ones prefixed by >>):
> drivers/misc/firmware_security_data.c:51:2: error: member
reference type 'struct attribute' is not a pointer; did you mean to use
'.'?
sysfs_attr_init(new_data->kobj_attr.attr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:55:8: note: expanded from macro 'sysfs_attr_init'
(attr)->key = &__key; \
~~~~~~^
> drivers/misc/firmware_security_data.c:51:2: error: expression is
not assignable
sysfs_attr_init(new_data->kobj_attr.attr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/sysfs.h:55:14: note: expanded from macro 'sysfs_attr_init'
(attr)->key = &__key; \
~~~~~~~~~~~ ^
2 errors generated.
vim +51 drivers/misc/firmware_security_data.c
34
35 int register_firmware_security_data_callback(
36 const char *name, ssize_t (*callback)(char *buf, void *private_data),
37 void *private_data)
38 {
39 int retval;
40
41 struct firmware_security_data *new_data;
42
43 if (name == NULL || name[0] == 0)
44 return -EINVAL;
45
46 new_data = kmalloc(sizeof(struct firmware_security_data), GFP_KERNEL);
47 if (new_data == NULL)
48 return -ENOMEM;
49
50 /* initialize attributes: */
51 sysfs_attr_init(new_data->kobj_attr.attr);
52 new_data->kobj_attr.attr.name = name;
53 new_data->kobj_attr.attr.mode = 0664;
54 new_data->kobj_attr.show = internal_callback;
55 new_data->kobj_attr.store = NULL;
56
57 new_data->callback = callback;
58 new_data->private_data = private_data;
59
60 /* attempt to create the file: */
61 retval = sysfs_create_file(firmware_data_kobj,
62 &new_data->kobj_attr.attr);
63 if (retval == 0) {
64 /* append to the list of entries: */
65 INIT_LIST_HEAD(&new_data->list_node);
66 mutex_lock(&entries_mutex);
67 list_add(&new_data->list_node, &entries);
68 mutex_unlock(&entries_mutex);
69 } else {
70 kfree(new_data);
71 }
72
73 return retval;
74 }
75 EXPORT_SYMBOL_GPL(register_firmware_security_data_callback);
76
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org