[soc:drivers/scmi 15/20] drivers/firmware/arm_scmi/clock.c:142:21: sparse: sparse: Using plain integer as NULL pointer
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git drivers/scmi
head: 72a5eb9d9c319c99c11cfd9cfb486380dd136840
commit: dccec73de91de04f2a62c877411ecbe368a775f7 [15/20] firmware: arm_scmi: Keep the discrete clock rates sorted
config: arm64-randconfig-s031-20200716 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout dccec73de91de04f2a62c877411ecbe368a775f7
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> drivers/firmware/arm_scmi/clock.c:142:21: sparse: sparse: Using plain integer as NULL pointer
vim +142 drivers/firmware/arm_scmi/clock.c
137
138 static int
139 scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
140 struct scmi_clock_info *clk)
141 {
> 142 u64 *rate = 0;
143 int ret, cnt;
144 bool rate_discrete = false;
145 u32 tot_rate_cnt = 0, rates_flag;
146 u16 num_returned, num_remaining;
147 struct scmi_xfer *t;
148 struct scmi_msg_clock_describe_rates *clk_desc;
149 struct scmi_msg_resp_clock_describe_rates *rlist;
150
151 ret = scmi_xfer_get_init(handle, CLOCK_DESCRIBE_RATES,
152 SCMI_PROTOCOL_CLOCK, sizeof(*clk_desc), 0, &t);
153 if (ret)
154 return ret;
155
156 clk_desc = t->tx.buf;
157 rlist = t->rx.buf;
158
159 do {
160 clk_desc->id = cpu_to_le32(clk_id);
161 /* Set the number of rates to be skipped/already read */
162 clk_desc->rate_index = cpu_to_le32(tot_rate_cnt);
163
164 ret = scmi_do_xfer(handle, t);
165 if (ret)
166 goto err;
167
168 rates_flag = le32_to_cpu(rlist->num_rates_flags);
169 num_remaining = NUM_REMAINING(rates_flag);
170 rate_discrete = RATE_DISCRETE(rates_flag);
171 num_returned = NUM_RETURNED(rates_flag);
172
173 if (tot_rate_cnt + num_returned > SCMI_MAX_NUM_RATES) {
174 dev_err(handle->dev, "No. of rates > MAX_NUM_RATES");
175 break;
176 }
177
178 if (!rate_discrete) {
179 clk->range.min_rate = RATE_TO_U64(rlist->rate[0]);
180 clk->range.max_rate = RATE_TO_U64(rlist->rate[1]);
181 clk->range.step_size = RATE_TO_U64(rlist->rate[2]);
182 dev_dbg(handle->dev, "Min %llu Max %llu Step %llu Hz\n",
183 clk->range.min_rate, clk->range.max_rate,
184 clk->range.step_size);
185 break;
186 }
187
188 rate = &clk->list.rates[tot_rate_cnt];
189 for (cnt = 0; cnt < num_returned; cnt++, rate++) {
190 *rate = RATE_TO_U64(rlist->rate[cnt]);
191 dev_dbg(handle->dev, "Rate %llu Hz\n", *rate);
192 }
193
194 tot_rate_cnt += num_returned;
195 /*
196 * check for both returned and remaining to avoid infinite
197 * loop due to buggy firmware
198 */
199 } while (num_returned && num_remaining);
200
201 if (rate_discrete && rate) {
202 clk->list.num_rates = tot_rate_cnt;
203 sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL);
204 }
205
206 clk->rate_discrete = rate_discrete;
207
208 err:
209 scmi_xfer_put(handle, t);
210 return ret;
211 }
212
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH v5 08/13] gpio: add support for the sl28cpld GPIO controller
by kernel test robot
Hi Michael,
I love your patch! Perhaps something to improve:
[auto build test WARNING on ljones-mfd/for-mfd-next]
[also build test WARNING on shawnguo/for-next v5.8-rc5]
[cannot apply to gpio/for-next hwmon/hwmon-next 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/Michael-Walle/Add-support-for-Ko...
base: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
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 warnings (new ones prefixed by >>):
>> drivers/gpio/gpio-sl28cpld.c:121:29: warning: implicit conversion from 'unsigned long' to 'unsigned int' changes value from 18446744073709551615 to 4294967295 [-Wconstant-conversion]
config.reg_dir_out_base = GPIO_REGMAP_ADDR(base + GPIO_REG_DIR);
~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/gpio/regmap.h:12:44: note: expanded from macro 'GPIO_REGMAP_ADDR'
#define GPIO_REGMAP_ADDR(addr) ((addr) ? : GPIO_REGMAP_ADDR_ZERO)
^~~~~~~~~~~~~~~~~~~~~
include/linux/gpio/regmap.h:11:32: note: expanded from macro 'GPIO_REGMAP_ADDR_ZERO'
#define GPIO_REGMAP_ADDR_ZERO ((unsigned long)(-1))
^~~~~~~~~~~~~~~~~~~
1 warning generated.
vim +121 drivers/gpio/gpio-sl28cpld.c
88
89 static int sl28cpld_gpio_probe(struct platform_device *pdev)
90 {
91 struct gpio_regmap_config config = {0};
92 enum sl28cpld_gpio_type type;
93 struct regmap *regmap;
94 u32 base;
95 int ret;
96
97 if (!pdev->dev.parent)
98 return -ENODEV;
99
100 type = (uintptr_t)device_get_match_data(&pdev->dev);
101 if (!type)
102 return -ENODEV;
103
104 ret = device_property_read_u32(&pdev->dev, "reg", &base);
105 if (ret)
106 return -EINVAL;
107
108 regmap = dev_get_regmap(pdev->dev.parent, NULL);
109 if (!regmap)
110 return -ENODEV;
111
112 config.regmap = regmap;
113 config.parent = &pdev->dev;
114 config.ngpio = 8;
115
116 switch (type) {
117 case SL28CPLD_GPIO:
118 config.reg_dat_base = base + GPIO_REG_IN;
119 config.reg_set_base = base + GPIO_REG_OUT;
120 /* reg_dir_out_base might be zero */
> 121 config.reg_dir_out_base = GPIO_REGMAP_ADDR(base + GPIO_REG_DIR);
122
123 /* This type supports interrupts */
124 ret = sl28cpld_gpio_irq_init(pdev, base, &config);
125 if (ret)
126 return ret;
127 break;
128 case SL28CPLD_GPO:
129 config.reg_set_base = base + GPO_REG_OUT;
130 break;
131 case SL28CPLD_GPI:
132 config.reg_dat_base = base + GPI_REG_IN;
133 break;
134 default:
135 dev_err(&pdev->dev, "unknown type %d\n", type);
136 return -ENODEV;
137 }
138
139 return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(&pdev->dev, &config));
140 }
141
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[linux-review:UPDATE-20200716-153005/Nikolay-Borisov/Convert-seed-devices-to-proper-list-API/20200715-185120 2/5] fs/btrfs/volumes.c:1029:6: warning: no previous prototype for function '__btrfs_free_extra_devids'
by kernel test robot
tree: https://github.com/0day-ci/linux/commits/UPDATE-20200716-153005/Nikolay-B...
head: a4695ab8c9d28c2c826e742853afa972b713f620
commit: 7a8f87bd7d0c4c97083a1efeebc8739db85575cc [2/5] btrfs: Factor out loop logic from btrfs_free_extra_devids
config: arm64-randconfig-r004-20200716 (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 arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
git checkout 7a8f87bd7d0c4c97083a1efeebc8739db85575cc
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from fs/btrfs/volumes.c:17:
fs/btrfs/ctree.h:2271:8: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
size_t __const btrfs_get_num_csums(void);
^~~~~~~~
In file included from fs/btrfs/volumes.c:28:
fs/btrfs/sysfs.h:16:14: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]
const char * const btrfs_feature_set_name(enum btrfs_feature_set set);
^~~~~~
>> fs/btrfs/volumes.c:1029:6: warning: no previous prototype for function '__btrfs_free_extra_devids' [-Wmissing-prototypes]
void __btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step,
^
fs/btrfs/volumes.c:1029:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void __btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step,
^
static
3 warnings generated.
vim +/__btrfs_free_extra_devids +1029 fs/btrfs/volumes.c
1026
1027
1028
> 1029 void __btrfs_free_extra_devids(struct btrfs_fs_devices *fs_devices, int step,
1030 struct btrfs_device **latest_dev)
1031 {
1032 struct btrfs_device *device, *next;
1033
1034 /* This is the initialized path, it is safe to release the devices. */
1035 list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) {
1036 if (test_bit(BTRFS_DEV_STATE_IN_FS_METADATA,
1037 &device->dev_state)) {
1038 if (!test_bit(BTRFS_DEV_STATE_REPLACE_TGT,
1039 &device->dev_state) &&
1040 !test_bit(BTRFS_DEV_STATE_MISSING,
1041 &device->dev_state) &&
1042 (!*latest_dev ||
1043 device->generation > (*latest_dev)->generation)) {
1044 *latest_dev = device;
1045 }
1046 continue;
1047 }
1048
1049 if (device->devid == BTRFS_DEV_REPLACE_DEVID) {
1050 /*
1051 * In the first step, keep the device which has
1052 * the correct fsid and the devid that is used
1053 * for the dev_replace procedure.
1054 * In the second step, the dev_replace state is
1055 * read from the device tree and it is known
1056 * whether the procedure is really active or
1057 * not, which means whether this device is
1058 * used or whether it should be removed.
1059 */
1060 if (step == 0 || test_bit(BTRFS_DEV_STATE_REPLACE_TGT,
1061 &device->dev_state)) {
1062 continue;
1063 }
1064 }
1065 if (device->bdev) {
1066 blkdev_put(device->bdev, device->mode);
1067 device->bdev = NULL;
1068 fs_devices->open_devices--;
1069 }
1070 if (test_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state)) {
1071 list_del_init(&device->dev_alloc_list);
1072 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state);
1073 if (!test_bit(BTRFS_DEV_STATE_REPLACE_TGT,
1074 &device->dev_state))
1075 fs_devices->rw_devices--;
1076 }
1077 list_del_init(&device->dev_list);
1078 fs_devices->num_devices--;
1079 btrfs_free_device(device);
1080 }
1081
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH RFC leds + net-next 2/3] leds: trigger: return error value if .activate() failed
by kernel test robot
Hi "Marek,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/Add-support-for-LEDs...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 59632b220f2d61df274ed3a14a204e941051fdad
config: powerpc-randconfig-r005-20200716 (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 powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/leds/led-triggers.c:52:6: warning: variable 'ret' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (sysfs_streq(buf, "none")) {
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/led-triggers.c:74:9: note: uninitialized use occurs here
return ret < 0 ? ret : count;
^~~
drivers/leds/led-triggers.c:52:2: note: remove the 'if' if its condition is always false
if (sysfs_streq(buf, "none")) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/leds/led-triggers.c:43:9: note: initialize the variable 'ret' to silence this warning
int ret;
^
= 0
1 warning generated.
vim +52 drivers/leds/led-triggers.c
abf0e9916c9400 Marek Behún 2020-07-16 35
11f70002213774 Akinobu Mita 2019-09-29 36 ssize_t led_trigger_write(struct file *filp, struct kobject *kobj,
11f70002213774 Akinobu Mita 2019-09-29 37 struct bin_attribute *bin_attr, char *buf,
11f70002213774 Akinobu Mita 2019-09-29 38 loff_t pos, size_t count)
c3bc9956ec52fb Richard Purdie 2006-03-31 39 {
11f70002213774 Akinobu Mita 2019-09-29 40 struct device *dev = kobj_to_dev(kobj);
f8a7c6fe14f556 Richard Purdie 2007-07-08 41 struct led_classdev *led_cdev = dev_get_drvdata(dev);
c3bc9956ec52fb Richard Purdie 2006-03-31 42 struct led_trigger *trig;
979669942e8602 Marek Behún 2020-07-16 43 int ret;
acd899e4f3066b Jacek Anaszewski 2014-09-22 44
acd899e4f3066b Jacek Anaszewski 2014-09-22 45 mutex_lock(&led_cdev->led_access);
acd899e4f3066b Jacek Anaszewski 2014-09-22 46
acd899e4f3066b Jacek Anaszewski 2014-09-22 47 if (led_sysfs_is_disabled(led_cdev)) {
acd899e4f3066b Jacek Anaszewski 2014-09-22 48 ret = -EBUSY;
acd899e4f3066b Jacek Anaszewski 2014-09-22 49 goto unlock;
acd899e4f3066b Jacek Anaszewski 2014-09-22 50 }
c3bc9956ec52fb Richard Purdie 2006-03-31 51
7296c33ed12ef1 Heiner Kallweit 2016-03-08 @52 if (sysfs_streq(buf, "none")) {
0013b23d66a276 Németh Márton 2008-03-09 53 led_trigger_remove(led_cdev);
acd899e4f3066b Jacek Anaszewski 2014-09-22 54 goto unlock;
c3bc9956ec52fb Richard Purdie 2006-03-31 55 }
c3bc9956ec52fb Richard Purdie 2006-03-31 56
dc47206e552c08 Richard Purdie 2007-11-10 57 down_read(&triggers_list_lock);
c3bc9956ec52fb Richard Purdie 2006-03-31 58 list_for_each_entry(trig, &trigger_list, next_trig) {
abf0e9916c9400 Marek Behún 2020-07-16 59 if (sysfs_streq(buf, trig->name) && trigger_relevant(led_cdev, trig)) {
dc47206e552c08 Richard Purdie 2007-11-10 60 down_write(&led_cdev->trigger_lock);
979669942e8602 Marek Behún 2020-07-16 61 ret = led_trigger_set(led_cdev, trig);
dc47206e552c08 Richard Purdie 2007-11-10 62 up_write(&led_cdev->trigger_lock);
c3bc9956ec52fb Richard Purdie 2006-03-31 63
dc47206e552c08 Richard Purdie 2007-11-10 64 up_read(&triggers_list_lock);
acd899e4f3066b Jacek Anaszewski 2014-09-22 65 goto unlock;
c3bc9956ec52fb Richard Purdie 2006-03-31 66 }
c3bc9956ec52fb Richard Purdie 2006-03-31 67 }
a3eac76cdf7225 Heiner Kallweit 2016-07-01 68 /* we come here only if buf matches no trigger */
a3eac76cdf7225 Heiner Kallweit 2016-07-01 69 ret = -EINVAL;
dc47206e552c08 Richard Purdie 2007-11-10 70 up_read(&triggers_list_lock);
c3bc9956ec52fb Richard Purdie 2006-03-31 71
acd899e4f3066b Jacek Anaszewski 2014-09-22 72 unlock:
acd899e4f3066b Jacek Anaszewski 2014-09-22 73 mutex_unlock(&led_cdev->led_access);
979669942e8602 Marek Behún 2020-07-16 74 return ret < 0 ? ret : count;
c3bc9956ec52fb Richard Purdie 2006-03-31 75 }
11f70002213774 Akinobu Mita 2019-09-29 76 EXPORT_SYMBOL_GPL(led_trigger_write);
c3bc9956ec52fb Richard Purdie 2006-03-31 77
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[ljones-mfd:for-mfd-next 56/58] drivers/mfd/mfd-core.c:147:17: error: implicit declaration of function 'of_read_number'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
head: ae387961ae94021c2322c59e069e7476fb7702f7
commit: 70d48975c152997bea1c715de3382ef854c288ed [56/58] mfd: core: Make a best effort attempt to match devices with the correct of_nodes
config: x86_64-rhel (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
git checkout 70d48975c152997bea1c715de3382ef854c288ed
# save the attached .config to linux build tree
make W=1 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/mfd/mfd-core.c: In function 'mfd_match_of_node_to_dev':
>> drivers/mfd/mfd-core.c:147:17: error: implicit declaration of function 'of_read_number' [-Werror=implicit-function-declaration]
147 | of_node_addr = of_read_number(reg, of_n_addr_cells(np));
| ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/of_read_number +147 drivers/mfd/mfd-core.c
119
120 static int mfd_match_of_node_to_dev(struct platform_device *pdev,
121 struct device_node *np,
122 const struct mfd_cell *cell)
123 {
124 struct mfd_of_node_entry *of_entry;
125 const __be32 *reg;
126 u64 of_node_addr;
127
128 /* Skip devices 'disabled' by Device Tree */
129 if (!of_device_is_available(np))
130 return -ENODEV;
131
132 /* Skip if OF node has previously been allocated to a device */
133 list_for_each_entry(of_entry, &mfd_of_node_list, list)
134 if (of_entry->np == np)
135 return -EAGAIN;
136
137 if (!cell->use_of_reg)
138 /* No of_reg defined - allocate first free compatible match */
139 goto allocate_of_node;
140
141 /* We only care about each node's first defined address */
142 reg = of_get_address(np, 0, NULL, NULL);
143 if (!reg)
144 /* OF node does not contatin a 'reg' property to match to */
145 return -EAGAIN;
146
> 147 of_node_addr = of_read_number(reg, of_n_addr_cells(np));
148
149 if (cell->of_reg != of_node_addr)
150 /* No match */
151 return -EAGAIN;
152
153 allocate_of_node:
154 of_entry = kzalloc(sizeof(*of_entry), GFP_KERNEL);
155 if (!of_entry)
156 return -ENOMEM;
157
158 of_entry->dev = &pdev->dev;
159 of_entry->np = np;
160 list_add_tail(&of_entry->list, &mfd_of_node_list);
161
162 pdev->dev.of_node = np;
163 pdev->dev.fwnode = &np->fwnode;
164
165 return 0;
166 }
167
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
Re: [PATCH RFC leds + net-next 3/3] net: phy: marvell: add support for PHY LEDs via LED class
by kernel test robot
Hi "Marek,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on net-next/master]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/Add-support-for-LEDs...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 59632b220f2d61df274ed3a14a204e941051fdad
config: alpha-allyesconfig (attached as .config)
compiler: alpha-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=alpha
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
drivers/net/phy/marvell.c: In function 'marvell_led_set_regval':
>> drivers/net/phy/marvell.c:775:6: warning: variable 'reg' set but not used [-Wunused-but-set-variable]
775 | int reg;
| ^~~
drivers/net/phy/marvell.c: In function '_marvell_led_brightness_set':
>> drivers/net/phy/marvell.c:806:6: warning: variable 'led' set but not used [-Wunused-but-set-variable]
806 | int led;
| ^~~
vim +/reg +775 drivers/net/phy/marvell.c
771
772 static int marvell_led_set_regval(struct phy_device *phydev, int led, u16 val)
773 {
774 u16 mask;
> 775 int reg;
776
777 switch (led) {
778 case 0 ... 3:
779 reg = MII_PHY_LED_CTRL;
780 break;
781 case 4 ... 5:
782 reg = MII_PHY_LED45_CTRL;
783 break;
784 default:
785 return -EINVAL;
786 }
787
788 val <<= (led % 4) * 4;
789 mask = 0xf << ((led % 4) * 4);
790
791 return phy_modify_paged(phydev, MII_MARVELL_LED_PAGE, MII_PHY_LED_CTRL, mask, val);
792 }
793
794 static inline int marvell_led_index(struct led_classdev *cdev)
795 {
796 struct marvell_priv *priv = to_phy_device(cdev->dev->parent)->priv;
797
798 return cdev - &priv->leds[0];
799 }
800
801 static int _marvell_led_brightness_set(struct led_classdev *cdev, enum led_brightness brightness,
802 bool check_trigger)
803 {
804 struct phy_device *phydev = to_phy_device(cdev->dev->parent);
805 struct marvell_priv *priv = phydev->priv;
> 806 int led;
807 u8 val;
808
809 /* don't do anything if one of HW triggers is set */
810 if (check_trigger && &marvell_led_triggers[0] <= cdev->trigger &&
811 cdev->trigger < &marvell_led_triggers[ARRAY_SIZE(marvell_led_triggers)])
812 return 0;
813
814 led = cdev - &priv->leds[0];
815 val = brightness ? MII_PHY_LED_CTRL_FORCE_ON : MII_PHY_LED_CTRL_FORCE_OFF;
816
817 return marvell_led_set_regval(phydev, marvell_led_index(cdev), val);
818 }
819
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[dhowells-fs:keys-acl 4/5] security/integrity/digsig_asymmetric.c:35:10: error: too few arguments to function 'keyring_search'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git keys-acl
head: 2a3c3edfc979691a7dc4733da827f508da90995a
commit: d1aa67ba9c4d53ddb95f6b5ec73968287df65fb4 [4/5] keys: Split the search perms between KEY_NEED_USE and KEY_NEED_SEARCH
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
git checkout d1aa67ba9c4d53ddb95f6b5ec73968287df65fb4
# save the attached .config to linux build tree
make W=1 ARCH=i386
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 >>):
security/integrity/digsig_asymmetric.c: In function 'request_asymmetric_key':
>> security/integrity/digsig_asymmetric.c:35:10: error: too few arguments to function 'keyring_search'
35 | kref = keyring_search(make_key_ref(key, 1),
| ^~~~~~~~~~~~~~
In file included from include/linux/key-type.h:11,
from security/integrity/digsig_asymmetric.c:11:
include/linux/key.h:433:18: note: declared here
433 | extern key_ref_t keyring_search(key_ref_t keyring,
| ^~~~~~~~~~~~~~
security/integrity/digsig_asymmetric.c:47:10: error: too few arguments to function 'keyring_search'
47 | kref = keyring_search(make_key_ref(keyring, 1),
| ^~~~~~~~~~~~~~
In file included from include/linux/key-type.h:11,
from security/integrity/digsig_asymmetric.c:11:
include/linux/key.h:433:18: note: declared here
433 | extern key_ref_t keyring_search(key_ref_t keyring,
| ^~~~~~~~~~~~~~
--
fs/crypto/keyring.c: In function 'search_fscrypt_keyring':
>> fs/crypto/keyring.c:145:11: error: too few arguments to function 'keyring_search'
145 | keyref = keyring_search(keyref, type, description, false);
| ^~~~~~~~~~~~~~
In file included from include/linux/key-type.h:11,
from fs/crypto/keyring.c:22:
include/linux/key.h:433:18: note: declared here
433 | extern key_ref_t keyring_search(key_ref_t keyring,
| ^~~~~~~~~~~~~~
vim +/keyring_search +35 security/integrity/digsig_asymmetric.c
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 18
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 19 /*
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 20 * Request an asymmetric key.
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 21 */
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 22 static struct key *request_asymmetric_key(struct key *keyring, uint32_t keyid)
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 23 {
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 24 struct key *key;
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 25 char name[12];
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 26
594081ee7145cc Dmitry Kasatkin 2014-10-06 27 sprintf(name, "id:%08x", keyid);
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 28
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 29 pr_debug("key search: \"%s\"\n", name);
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 30
41c89b64d7184a Petko Manolov 2015-12-02 31 key = get_ima_blacklist_keyring();
41c89b64d7184a Petko Manolov 2015-12-02 32 if (key) {
41c89b64d7184a Petko Manolov 2015-12-02 33 key_ref_t kref;
41c89b64d7184a Petko Manolov 2015-12-02 34
41c89b64d7184a Petko Manolov 2015-12-02 @35 kref = keyring_search(make_key_ref(key, 1),
dcf49dbc8077e2 David Howells 2019-06-26 36 &key_type_asymmetric, name, true);
41c89b64d7184a Petko Manolov 2015-12-02 37 if (!IS_ERR(kref)) {
41c89b64d7184a Petko Manolov 2015-12-02 38 pr_err("Key '%s' is in ima_blacklist_keyring\n", name);
41c89b64d7184a Petko Manolov 2015-12-02 39 return ERR_PTR(-EKEYREJECTED);
41c89b64d7184a Petko Manolov 2015-12-02 40 }
41c89b64d7184a Petko Manolov 2015-12-02 41 }
41c89b64d7184a Petko Manolov 2015-12-02 42
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 43 if (keyring) {
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 44 /* search in specific keyring */
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 45 key_ref_t kref;
41c89b64d7184a Petko Manolov 2015-12-02 46
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 47 kref = keyring_search(make_key_ref(keyring, 1),
dcf49dbc8077e2 David Howells 2019-06-26 48 &key_type_asymmetric, name, true);
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 49 if (IS_ERR(kref))
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 50 key = ERR_CAST(kref);
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 51 else
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 52 key = key_ref_to_ptr(kref);
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 53 } else {
dac087514d86cf David Howells 2020-02-12 54 key = request_key(&key_type_asymmetric, name, NULL, NULL);
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 55 }
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 56
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 57 if (IS_ERR(key)) {
d9a2e5d788d39f Dmitry Kasatkin 2014-07-02 58 pr_err_ratelimited("Request for unknown key '%s' err %ld\n",
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 59 name, PTR_ERR(key));
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 60 switch (PTR_ERR(key)) {
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 61 /* Hide some search errors */
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 62 case -EACCES:
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 63 case -ENOTDIR:
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 64 case -EAGAIN:
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 65 return ERR_PTR(-ENOKEY);
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 66 default:
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 67 return key;
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 68 }
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 69 }
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 70
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 71 pr_debug("%s() = 0 [%x]\n", __func__, key_serial(key));
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 72
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 73 return key;
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 74 }
e0751257a64ea1 Dmitry Kasatkin 2013-02-07 75
:::::: The code at line 35 was first introduced by commit
:::::: 41c89b64d7184a780f12f2cccdabe65cb2408893 IMA: create machine owner and blacklist keyrings
:::::: TO: Petko Manolov <petkan(a)mip-labs.com>
:::::: CC: Mimi Zohar <zohar(a)linux.vnet.ibm.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[dhowells-fs:keys-acl 4/5] fs/crypto/keyring.c:145:32: sparse: sparse: not enough arguments for function keyring_search
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git keys-acl
head: 2a3c3edfc979691a7dc4733da827f508da90995a
commit: d1aa67ba9c4d53ddb95f6b5ec73968287df65fb4 [4/5] keys: Split the search perms between KEY_NEED_USE and KEY_NEED_SEARCH
config: arc-randconfig-s032-20200716 (attached as .config)
compiler: arc-elf-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.2-49-g707c5017-dirty
git checkout d1aa67ba9c4d53ddb95f6b5ec73968287df65fb4
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=arc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
>> fs/crypto/keyring.c:145:32: sparse: sparse: not enough arguments for function keyring_search
vim +145 fs/crypto/keyring.c
23c688b54016ee Eric Biggers 2019-08-04 133
23c688b54016ee Eric Biggers 2019-08-04 134 /* Search ->s_master_keys or ->mk_users */
22d94f493bfb40 Eric Biggers 2019-08-04 135 static struct key *search_fscrypt_keyring(struct key *keyring,
22d94f493bfb40 Eric Biggers 2019-08-04 136 struct key_type *type,
22d94f493bfb40 Eric Biggers 2019-08-04 137 const char *description)
22d94f493bfb40 Eric Biggers 2019-08-04 138 {
22d94f493bfb40 Eric Biggers 2019-08-04 139 /*
22d94f493bfb40 Eric Biggers 2019-08-04 140 * We need to mark the keyring reference as "possessed" so that we
22d94f493bfb40 Eric Biggers 2019-08-04 141 * acquire permission to search it, via the KEY_POS_SEARCH permission.
22d94f493bfb40 Eric Biggers 2019-08-04 142 */
22d94f493bfb40 Eric Biggers 2019-08-04 143 key_ref_t keyref = make_key_ref(keyring, true /* possessed */);
22d94f493bfb40 Eric Biggers 2019-08-04 144
22d94f493bfb40 Eric Biggers 2019-08-04 @145 keyref = keyring_search(keyref, type, description, false);
22d94f493bfb40 Eric Biggers 2019-08-04 146 if (IS_ERR(keyref)) {
22d94f493bfb40 Eric Biggers 2019-08-04 147 if (PTR_ERR(keyref) == -EAGAIN || /* not found */
22d94f493bfb40 Eric Biggers 2019-08-04 148 PTR_ERR(keyref) == -EKEYREVOKED) /* recently invalidated */
22d94f493bfb40 Eric Biggers 2019-08-04 149 keyref = ERR_PTR(-ENOKEY);
22d94f493bfb40 Eric Biggers 2019-08-04 150 return ERR_CAST(keyref);
22d94f493bfb40 Eric Biggers 2019-08-04 151 }
22d94f493bfb40 Eric Biggers 2019-08-04 152 return key_ref_to_ptr(keyref);
22d94f493bfb40 Eric Biggers 2019-08-04 153 }
22d94f493bfb40 Eric Biggers 2019-08-04 154
:::::: The code at line 145 was first introduced by commit
:::::: 22d94f493bfb408fdd764f7b1d0363af2122fba5 fscrypt: add FS_IOC_ADD_ENCRYPTION_KEY ioctl
:::::: TO: Eric Biggers <ebiggers(a)google.com>
:::::: CC: Eric Biggers <ebiggers(a)google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months
[dhowells-fs:keys-acl 1/5] security/smack/smack_lsm.c:4258:3: error: 'auth_can_override' undeclared
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.git keys-acl
head: 2a3c3edfc979691a7dc4733da827f508da90995a
commit: 0c172f6031ad95d98e74806335feb64d461816b8 [1/5] keys: Move permissions checking decisions into the checking code
config: i386-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce (this is a W=1 build):
git checkout 0c172f6031ad95d98e74806335feb64d461816b8
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
security/smack/smack_lsm.c: In function 'smack_key_permission':
>> security/smack/smack_lsm.c:4258:3: error: 'auth_can_override' undeclared (first use in this function)
4258 | auth_can_override = true;
| ^~~~~~~~~~~~~~~~~
security/smack/smack_lsm.c:4258:3: note: each undeclared identifier is reported only once for each function it appears in
>> security/smack/smack_lsm.c:4309:10: error: dereferencing pointer to incomplete type 'struct request_key_auth'
4309 | if (rka->target_key == key)
| ^~
>> security/smack/smack_lsm.c:4309:26: error: 'key' undeclared (first use in this function)
4309 | if (rka->target_key == key)
| ^~~
>> security/smack/smack_lsm.c:4310:5: error: '_perm' undeclared (first use in this function)
4310 | *_perm = 0;
| ^~~~~
--
security/selinux/hooks.c: In function 'selinux_keyperm_to_av':
>> security/selinux/hooks.c:6548:7: warning: variable 'sysadmin_can_override' set but not used [-Wunused-but-set-variable]
6548 | bool sysadmin_can_override = false;
| ^~~~~~~~~~~~~~~~~~~~~
In file included from arch/x86/include/asm/page_32.h:35,
from arch/x86/include/asm/page.h:14,
from arch/x86/include/asm/thread_info.h:12,
from include/linux/thread_info.h:38,
from arch/x86/include/asm/preempt.h:7,
from include/linux/preempt.h:78,
from include/linux/rcupdate.h:27,
from include/linux/rculist.h:11,
from include/linux/pid.h:5,
from include/linux/sched.h:14,
from include/linux/tracehook.h:46,
from security/selinux/hooks.c:27:
In function 'strncpy',
inlined from 'selinux_ib_endport_manage_subnet' at security/selinux/hooks.c:6769:2:
include/linux/string.h:297:30: warning: '__builtin_strncpy' specified bound 64 equals destination size [-Wstringop-truncation]
297 | #define __underlying_strncpy __builtin_strncpy
| ^
include/linux/string.h:307:9: note: in expansion of macro '__underlying_strncpy'
307 | return __underlying_strncpy(p, q, size);
| ^~~~~~~~~~~~~~~~~~~~
vim +/auth_can_override +4258 security/smack/smack_lsm.c
4212
4213 /**
4214 * smack_key_permission - Smack access on a key
4215 * @key_ref: gets to the object
4216 * @cred: the credentials to use
4217 * @need_perm: requested key permission
4218 *
4219 * Return 0 if the task has read and write to the object,
4220 * an error code otherwise
4221 */
4222 static int smack_key_permission(key_ref_t key_ref,
4223 const struct cred *cred,
4224 enum key_need_perm need_perm,
4225 unsigned int flags)
4226 {
4227 struct key *keyp;
4228 struct smk_audit_info ad;
4229 struct smack_known *tkp = smk_of_task(smack_cred(cred));
4230 int request = 0;
4231 int rc;
4232
4233 keyp = key_ref_to_ptr(key_ref);
4234 if (keyp == NULL)
4235 return -EINVAL;
4236 /*
4237 * If the key hasn't been initialized give it access so that
4238 * it may do so.
4239 */
4240 if (keyp->security == NULL)
4241 return 0;
4242 /*
4243 * This should not occur
4244 */
4245 if (tkp == NULL)
4246 return -EACCES;
4247
4248 /*
4249 * Validate requested permissions
4250 */
4251 switch (need_perm) {
4252 case KEY_NEED_ASSUME_AUTHORITY:
4253 return 0;
4254
4255 case KEY_NEED_DESCRIBE:
4256 case KEY_NEED_GET_SECURITY:
4257 request |= MAY_READ;
> 4258 auth_can_override = true;
4259 break;
4260
4261 case KEY_NEED_CHOWN:
4262 case KEY_NEED_INVALIDATE:
4263 case KEY_NEED_JOIN:
4264 case KEY_NEED_LINK:
4265 case KEY_NEED_KEYRING_ADD:
4266 case KEY_NEED_KEYRING_CLEAR:
4267 case KEY_NEED_KEYRING_DELETE:
4268 case KEY_NEED_REVOKE:
4269 case KEY_NEED_SETPERM:
4270 case KEY_NEED_SET_RESTRICTION:
4271 case KEY_NEED_UPDATE:
4272 request |= MAY_WRITE;
4273 break;
4274
4275 case KEY_NEED_INSTANTIATE:
4276 auth_can_override = true;
4277 break;
4278
4279 case KEY_NEED_READ:
4280 case KEY_NEED_SEARCH:
4281 case KEY_NEED_USE:
4282 case KEY_NEED_WATCH:
4283 request |= MAY_READ;
4284 break;
4285
4286 case KEY_NEED_SET_TIMEOUT:
4287 request |= MAY_WRITE;
4288 auth_can_override = true;
4289 break;
4290
4291 case KEY_NEED_UNLINK:
4292 return 0; /* Mustn't prevent this; KEY_FLAG_KEEP is already
4293 * dealt with. */
4294
4295 default:
4296 WARN_ON(1);
4297 return -EINVAL;
4298 }
4299
4300 /* Just allow the operation if the process has an authorisation token.
4301 * The presence of the token means that the kernel delegated
4302 * instantiation of a key to the process - which is problematic if we
4303 * then say that the process isn't allowed to get the description of
4304 * the key or actually instantiate it.
4305 */
4306 if (auth_can_override && cred->request_key_auth) {
4307 struct request_key_auth *rka =
4308 cred->request_key_auth->payload.data[0];
> 4309 if (rka->target_key == key)
> 4310 *_perm = 0;
4311 }
4312
4313 if (smack_privileged_cred(CAP_MAC_OVERRIDE, cred))
4314 return 0;
4315
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 2 months