[linux-next:master 2181/2472] drivers/spi/spi-bcm2835.c:1264 bcm2835_spi_setup() error: uninitialized symbol 'lflags'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: "Martin Hundebøll" <martin(a)geanix.com>
CC: Mark Brown <broonie(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 4e78c578cb987725eef1cec7d11b6437109e9a49
commit: 5e31ba0c0543a04483b53151eb5b7413efece94c [2181/2472] spi: bcm2835: fix gpio cs level inversion
:::::: branch date: 35 hours ago
:::::: commit date: 2 days ago
config: parisc-randconfig-m031-20201031 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/spi/spi-bcm2835.c:1264 bcm2835_spi_setup() error: uninitialized symbol 'lflags'.
vim +/lflags +1264 drivers/spi/spi-bcm2835.c
a30a555d7435a44 Martin Sperl 2015-04-06 1190
e34ff011c70e5f4 Martin Sperl 2015-03-26 1191 static int bcm2835_spi_setup(struct spi_device *spi)
e34ff011c70e5f4 Martin Sperl 2015-03-26 1192 {
8259bf667a0f9ea Lukas Wunner 2019-09-11 1193 struct spi_controller *ctlr = spi->controller;
8259bf667a0f9ea Lukas Wunner 2019-09-11 1194 struct bcm2835_spi *bs = spi_controller_get_devdata(ctlr);
a30a555d7435a44 Martin Sperl 2015-04-06 1195 struct gpio_chip *chip;
3bd158c56a56e87 Linus Walleij 2019-08-04 1196 enum gpio_lookup_flags lflags;
571e31fa60b3697 Lukas Wunner 2019-09-11 1197 u32 cs;
571e31fa60b3697 Lukas Wunner 2019-09-11 1198
571e31fa60b3697 Lukas Wunner 2019-09-11 1199 /*
571e31fa60b3697 Lukas Wunner 2019-09-11 1200 * Precalculate SPI slave's CS register value for ->prepare_message():
571e31fa60b3697 Lukas Wunner 2019-09-11 1201 * The driver always uses software-controlled GPIO chip select, hence
571e31fa60b3697 Lukas Wunner 2019-09-11 1202 * set the hardware-controlled native chip select to an invalid value
571e31fa60b3697 Lukas Wunner 2019-09-11 1203 * to prevent it from interfering.
571e31fa60b3697 Lukas Wunner 2019-09-11 1204 */
571e31fa60b3697 Lukas Wunner 2019-09-11 1205 cs = BCM2835_SPI_CS_CS_10 | BCM2835_SPI_CS_CS_01;
571e31fa60b3697 Lukas Wunner 2019-09-11 1206 if (spi->mode & SPI_CPOL)
571e31fa60b3697 Lukas Wunner 2019-09-11 1207 cs |= BCM2835_SPI_CS_CPOL;
571e31fa60b3697 Lukas Wunner 2019-09-11 1208 if (spi->mode & SPI_CPHA)
571e31fa60b3697 Lukas Wunner 2019-09-11 1209 cs |= BCM2835_SPI_CS_CPHA;
571e31fa60b3697 Lukas Wunner 2019-09-11 1210 bs->prepare_cs[spi->chip_select] = cs;
3bd158c56a56e87 Linus Walleij 2019-08-04 1211
8259bf667a0f9ea Lukas Wunner 2019-09-11 1212 /*
8259bf667a0f9ea Lukas Wunner 2019-09-11 1213 * Precalculate SPI slave's CS register value to clear RX FIFO
8259bf667a0f9ea Lukas Wunner 2019-09-11 1214 * in case of a TX-only DMA transfer.
8259bf667a0f9ea Lukas Wunner 2019-09-11 1215 */
8259bf667a0f9ea Lukas Wunner 2019-09-11 1216 if (ctlr->dma_rx) {
8259bf667a0f9ea Lukas Wunner 2019-09-11 1217 bs->clear_rx_cs[spi->chip_select] = cs |
8259bf667a0f9ea Lukas Wunner 2019-09-11 1218 BCM2835_SPI_CS_TA |
8259bf667a0f9ea Lukas Wunner 2019-09-11 1219 BCM2835_SPI_CS_DMAEN |
8259bf667a0f9ea Lukas Wunner 2019-09-11 1220 BCM2835_SPI_CS_CLEAR_RX;
8259bf667a0f9ea Lukas Wunner 2019-09-11 1221 dma_sync_single_for_device(ctlr->dma_rx->device->dev,
8259bf667a0f9ea Lukas Wunner 2019-09-11 1222 bs->clear_rx_addr,
8259bf667a0f9ea Lukas Wunner 2019-09-11 1223 sizeof(bs->clear_rx_cs),
8259bf667a0f9ea Lukas Wunner 2019-09-11 1224 DMA_TO_DEVICE);
8259bf667a0f9ea Lukas Wunner 2019-09-11 1225 }
8259bf667a0f9ea Lukas Wunner 2019-09-11 1226
e34ff011c70e5f4 Martin Sperl 2015-03-26 1227 /*
e34ff011c70e5f4 Martin Sperl 2015-03-26 1228 * sanity checking the native-chipselects
e34ff011c70e5f4 Martin Sperl 2015-03-26 1229 */
e34ff011c70e5f4 Martin Sperl 2015-03-26 1230 if (spi->mode & SPI_NO_CS)
e34ff011c70e5f4 Martin Sperl 2015-03-26 1231 return 0;
3bd158c56a56e87 Linus Walleij 2019-08-04 1232 /*
3bd158c56a56e87 Linus Walleij 2019-08-04 1233 * The SPI core has successfully requested the CS GPIO line from the
3bd158c56a56e87 Linus Walleij 2019-08-04 1234 * device tree, so we are done.
3bd158c56a56e87 Linus Walleij 2019-08-04 1235 */
3bd158c56a56e87 Linus Walleij 2019-08-04 1236 if (spi->cs_gpiod)
e34ff011c70e5f4 Martin Sperl 2015-03-26 1237 return 0;
a30a555d7435a44 Martin Sperl 2015-04-06 1238 if (spi->chip_select > 1) {
a30a555d7435a44 Martin Sperl 2015-04-06 1239 /* error in the case of native CS requested with CS > 1
a30a555d7435a44 Martin Sperl 2015-04-06 1240 * officially there is a CS2, but it is not documented
a30a555d7435a44 Martin Sperl 2015-04-06 1241 * which GPIO is connected with that...
a30a555d7435a44 Martin Sperl 2015-04-06 1242 */
a30a555d7435a44 Martin Sperl 2015-04-06 1243 dev_err(&spi->dev,
a30a555d7435a44 Martin Sperl 2015-04-06 1244 "setup: only two native chip-selects are supported\n");
a30a555d7435a44 Martin Sperl 2015-04-06 1245 return -EINVAL;
a30a555d7435a44 Martin Sperl 2015-04-06 1246 }
3bd158c56a56e87 Linus Walleij 2019-08-04 1247
3bd158c56a56e87 Linus Walleij 2019-08-04 1248 /*
3bd158c56a56e87 Linus Walleij 2019-08-04 1249 * Translate native CS to GPIO
3bd158c56a56e87 Linus Walleij 2019-08-04 1250 *
3bd158c56a56e87 Linus Walleij 2019-08-04 1251 * FIXME: poking around in the gpiolib internals like this is
3bd158c56a56e87 Linus Walleij 2019-08-04 1252 * not very good practice. Find a way to locate the real problem
3bd158c56a56e87 Linus Walleij 2019-08-04 1253 * and fix it. Why is the GPIO descriptor in spi->cs_gpiod
3bd158c56a56e87 Linus Walleij 2019-08-04 1254 * sometimes not assigned correctly? Erroneous device trees?
3bd158c56a56e87 Linus Walleij 2019-08-04 1255 */
a30a555d7435a44 Martin Sperl 2015-04-06 1256
a30a555d7435a44 Martin Sperl 2015-04-06 1257 /* get the gpio chip for the base */
a30a555d7435a44 Martin Sperl 2015-04-06 1258 chip = gpiochip_find("pinctrl-bcm2835", chip_match_name);
a30a555d7435a44 Martin Sperl 2015-04-06 1259 if (!chip)
f8043872e79614a Chris Boot 2013-03-11 1260 return 0;
e34ff011c70e5f4 Martin Sperl 2015-03-26 1261
3bd158c56a56e87 Linus Walleij 2019-08-04 1262 spi->cs_gpiod = gpiochip_request_own_desc(chip, 8 - spi->chip_select,
3bd158c56a56e87 Linus Walleij 2019-08-04 1263 DRV_NAME,
3bd158c56a56e87 Linus Walleij 2019-08-04 @1264 lflags,
3bd158c56a56e87 Linus Walleij 2019-08-04 1265 GPIOD_OUT_LOW);
3bd158c56a56e87 Linus Walleij 2019-08-04 1266 if (IS_ERR(spi->cs_gpiod))
3bd158c56a56e87 Linus Walleij 2019-08-04 1267 return PTR_ERR(spi->cs_gpiod);
a30a555d7435a44 Martin Sperl 2015-04-06 1268
a30a555d7435a44 Martin Sperl 2015-04-06 1269 /* and set up the "mode" and level */
3bd158c56a56e87 Linus Walleij 2019-08-04 1270 dev_info(&spi->dev, "setting up native-CS%i to use GPIO\n",
3bd158c56a56e87 Linus Walleij 2019-08-04 1271 spi->chip_select);
a30a555d7435a44 Martin Sperl 2015-04-06 1272
a30a555d7435a44 Martin Sperl 2015-04-06 1273 return 0;
f8043872e79614a Chris Boot 2013-03-11 1274 }
f8043872e79614a Chris Boot 2013-03-11 1275
:::::: The code at line 1264 was first introduced by commit
:::::: 3bd158c56a56e8767e569d7fbc66efbedc478077 spi: bcm2835: Convert to use CS GPIO descriptors
:::::: TO: Linus Walleij <linus.walleij(a)linaro.org>
:::::: CC: Mark Brown <broonie(a)kernel.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Zong Li <zong.li(a)sifive.com>
CC: Palmer Dabbelt <palmerdabbelt(a)google.com>
CC: Masami Hiramatsu <mhiramat(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5fc6b075e165f641fbc366b58b578055762d5f8c
commit: 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6 riscv: Use text_mutex instead of patch_lock
date: 6 months ago
:::::: branch date: 16 hours ago
:::::: commit date: 6 months ago
config: riscv-randconfig-s031-20201031 (attached as .config)
compiler: riscv64-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.3-56-gc09e8239-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 0ff7c3b331276f584bde3ae9a16bacd8fa3d01e6
# 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=riscv
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 >>)"
arch/riscv/kernel/ftrace.c:15:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_prepare' - wrong count at exit
>> arch/riscv/kernel/ftrace.c:21:5: sparse: sparse: context imbalance in 'ftrace_arch_code_modify_post_process' - wrong count at exit
vim +/ftrace_arch_code_modify_post_process +21 arch/riscv/kernel/ftrace.c
0ff7c3b331276f5 Zong Li 2020-04-21 20
0ff7c3b331276f5 Zong Li 2020-04-21 @21 int ftrace_arch_code_modify_post_process(void) __releases(&text_mutex)
0ff7c3b331276f5 Zong Li 2020-04-21 22 {
0ff7c3b331276f5 Zong Li 2020-04-21 23 mutex_unlock(&text_mutex);
0ff7c3b331276f5 Zong Li 2020-04-21 24 return 0;
0ff7c3b331276f5 Zong Li 2020-04-21 25 }
0ff7c3b331276f5 Zong Li 2020-04-21 26
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
drivers/i2c/busses/i2c-davinci.c:207 i2c_davinci_calc_clk_dividers() warn: '(input_clock / 12000000) - 1' 4294967295 can't fit into 65535 'psc'
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Krzysztof Kozlowski <krzk(a)kernel.org>
CC: Wolfram Sang <wsa-dev(a)sang-engineering.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5fc6b075e165f641fbc366b58b578055762d5f8c
commit: 4a2d5f663dab6614772d8e28ca190b127ba46d9d i2c: Enable compile testing for more drivers
date: 9 months ago
:::::: branch date: 15 hours ago
:::::: commit date: 9 months ago
config: openrisc-randconfig-m031-20201031 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/i2c/busses/i2c-davinci.c:207 i2c_davinci_calc_clk_dividers() warn: '(input_clock / 12000000) - 1' 4294967295 can't fit into 65535 'psc'
drivers/i2c/busses/i2c-omap.c:438 omap_i2c_init() warn: 'scl - (scl / 3) - 7' 4294967289 can't fit into 65535 'hsscll'
drivers/i2c/busses/i2c-omap.c:439 omap_i2c_init() warn: '(scl / 3) - 5' 4294967291 can't fit into 65535 'hssclh'
vim +207 drivers/i2c/busses/i2c-davinci.c
5ae5b1136e0c434 Chaithrika U S 2010-01-06 168
5ae5b1136e0c434 Chaithrika U S 2010-01-06 169 static void i2c_davinci_calc_clk_dividers(struct davinci_i2c_dev *dev)
95a7f10eadcd88c Vladimir Barinov 2007-10-13 170 {
5c3d8a46ac9778d Heiko Schocher 2012-07-30 171 struct davinci_i2c_platform_data *pdata = dev->pdata;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 172 u16 psc;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 173 u32 clk;
cc99ff70c7ad36e Troy Kisky 2008-07-14 174 u32 d;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 175 u32 clkh;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 176 u32 clkl;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 177 u32 input_clock = clk_get_rate(dev->clk);
35780e860f7d4a5 Alexander Sverdlin 2015-09-14 178 struct device_node *of_node = dev->dev->of_node;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 179
95a7f10eadcd88c Vladimir Barinov 2007-10-13 180 /* NOTE: I2C Clock divider programming info
95a7f10eadcd88c Vladimir Barinov 2007-10-13 181 * As per I2C specs the following formulas provide prescaler
95a7f10eadcd88c Vladimir Barinov 2007-10-13 182 * and low/high divider values
95a7f10eadcd88c Vladimir Barinov 2007-10-13 183 * input clk --> PSC Div -----------> ICCL/H Div --> output clock
95a7f10eadcd88c Vladimir Barinov 2007-10-13 184 * module clk
95a7f10eadcd88c Vladimir Barinov 2007-10-13 185 *
95a7f10eadcd88c Vladimir Barinov 2007-10-13 186 * output clk = module clk / (PSC + 1) [ (ICCL + d) + (ICCH + d) ]
95a7f10eadcd88c Vladimir Barinov 2007-10-13 187 *
95a7f10eadcd88c Vladimir Barinov 2007-10-13 188 * Thus,
95a7f10eadcd88c Vladimir Barinov 2007-10-13 189 * (ICCL + ICCH) = clk = (input clk / ((psc +1) * output clk)) - 2d;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 190 *
95a7f10eadcd88c Vladimir Barinov 2007-10-13 191 * where if PSC == 0, d = 7,
95a7f10eadcd88c Vladimir Barinov 2007-10-13 192 * if PSC == 1, d = 6
95a7f10eadcd88c Vladimir Barinov 2007-10-13 193 * if PSC > 1 , d = 5
35780e860f7d4a5 Alexander Sverdlin 2015-09-14 194 *
35780e860f7d4a5 Alexander Sverdlin 2015-09-14 195 * Note:
35780e860f7d4a5 Alexander Sverdlin 2015-09-14 196 * d is always 6 on Keystone I2C controller
95a7f10eadcd88c Vladimir Barinov 2007-10-13 197 */
95a7f10eadcd88c Vladimir Barinov 2007-10-13 198
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 199 /*
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 200 * Both Davinci and current Keystone User Guides recommend a value
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 201 * between 7MHz and 12MHz. In reality 7MHz module clock doesn't
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 202 * always produce enough margin between SDA and SCL transitions.
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 203 * Measurements show that the higher the module clock is, the
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 204 * bigger is the margin, providing more reliable communication.
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 205 * So we better target for 12MHz.
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 206 */
87cb5b425fa3209 Alexander Sverdlin 2015-11-30 @207 psc = (input_clock / 12000000) - 1;
cc99ff70c7ad36e Troy Kisky 2008-07-14 208 if ((input_clock / (psc + 1)) > 12000000)
cc99ff70c7ad36e Troy Kisky 2008-07-14 209 psc++; /* better to run under spec than over */
cc99ff70c7ad36e Troy Kisky 2008-07-14 210 d = (psc >= 2) ? 5 : 7 - psc;
95a7f10eadcd88c Vladimir Barinov 2007-10-13 211
35780e860f7d4a5 Alexander Sverdlin 2015-09-14 212 if (of_node && of_device_is_compatible(of_node, "ti,keystone-i2c"))
35780e860f7d4a5 Alexander Sverdlin 2015-09-14 213 d = 6;
35780e860f7d4a5 Alexander Sverdlin 2015-09-14 214
955fc950795d1c9 Alexander Sverdlin 2015-06-11 215 clk = ((input_clock / (psc + 1)) / (pdata->bus_freq * 1000));
955fc950795d1c9 Alexander Sverdlin 2015-06-11 216 /* Avoid driving the bus too fast because of rounding errors above */
955fc950795d1c9 Alexander Sverdlin 2015-06-11 217 if (input_clock / (psc + 1) / clk > pdata->bus_freq * 1000)
955fc950795d1c9 Alexander Sverdlin 2015-06-11 218 clk++;
955fc950795d1c9 Alexander Sverdlin 2015-06-11 219 /*
955fc950795d1c9 Alexander Sverdlin 2015-06-11 220 * According to I2C-BUS Spec 2.1, in FAST-MODE LOW period should be at
955fc950795d1c9 Alexander Sverdlin 2015-06-11 221 * least 1.3uS, which is not the case with 50% duty cycle. Driving HIGH
955fc950795d1c9 Alexander Sverdlin 2015-06-11 222 * to LOW ratio as 1 to 2 is more safe.
955fc950795d1c9 Alexander Sverdlin 2015-06-11 223 */
955fc950795d1c9 Alexander Sverdlin 2015-06-11 224 if (pdata->bus_freq > 100)
955fc950795d1c9 Alexander Sverdlin 2015-06-11 225 clkl = (clk << 1) / 3;
955fc950795d1c9 Alexander Sverdlin 2015-06-11 226 else
955fc950795d1c9 Alexander Sverdlin 2015-06-11 227 clkl = (clk >> 1);
955fc950795d1c9 Alexander Sverdlin 2015-06-11 228 /*
955fc950795d1c9 Alexander Sverdlin 2015-06-11 229 * It's not always possible to have 1 to 2 ratio when d=7, so fall back
955fc950795d1c9 Alexander Sverdlin 2015-06-11 230 * to minimal possible clkh in this case.
cc8de9a68599b26 Alexander Sverdlin 2018-07-13 231 *
cc8de9a68599b26 Alexander Sverdlin 2018-07-13 232 * Note:
cc8de9a68599b26 Alexander Sverdlin 2018-07-13 233 * CLKH is not allowed to be 0, in this case I2C clock is not generated
cc8de9a68599b26 Alexander Sverdlin 2018-07-13 234 * at all
955fc950795d1c9 Alexander Sverdlin 2015-06-11 235 */
cc8de9a68599b26 Alexander Sverdlin 2018-07-13 236 if (clk > clkl + d) {
955fc950795d1c9 Alexander Sverdlin 2015-06-11 237 clkh = clk - clkl - d;
955fc950795d1c9 Alexander Sverdlin 2015-06-11 238 clkl -= d;
955fc950795d1c9 Alexander Sverdlin 2015-06-11 239 } else {
cc8de9a68599b26 Alexander Sverdlin 2018-07-13 240 clkh = 1;
955fc950795d1c9 Alexander Sverdlin 2015-06-11 241 clkl = clk - (d << 1);
955fc950795d1c9 Alexander Sverdlin 2015-06-11 242 }
95a7f10eadcd88c Vladimir Barinov 2007-10-13 243
95a7f10eadcd88c Vladimir Barinov 2007-10-13 244 davinci_i2c_write_reg(dev, DAVINCI_I2C_PSC_REG, psc);
95a7f10eadcd88c Vladimir Barinov 2007-10-13 245 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKH_REG, clkh);
95a7f10eadcd88c Vladimir Barinov 2007-10-13 246 davinci_i2c_write_reg(dev, DAVINCI_I2C_CLKL_REG, clkl);
95a7f10eadcd88c Vladimir Barinov 2007-10-13 247
5ae5b1136e0c434 Chaithrika U S 2010-01-06 248 dev_dbg(dev->dev, "input_clock = %d, CLK = %d\n", input_clock, clk);
5ae5b1136e0c434 Chaithrika U S 2010-01-06 249 }
5ae5b1136e0c434 Chaithrika U S 2010-01-06 250
:::::: The code at line 207 was first introduced by commit
:::::: 87cb5b425fa32094972868b50e65083c586509a3 i2c: davinci: Increase module clock frequency
:::::: TO: Alexander Sverdlin <alexander.sverdlin(a)nokia.com>
:::::: CC: Wolfram Sang <wsa(a)the-dreams.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[alaahl:netdev-next 6/102] drivers/staging/wimax/i2400m/usb-tx.c:205 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: alaa(a)dev.mellanox.co.il
TO: Arnd Bergmann <arnd(a)arndb.de>
Hi Arnd,
First bad commit (maybe != root cause):
tree: https://github.com/alaahl/linux.git netdev-next
head: 68bb4665a2ce1338a74867e71bd5182f5b214a91
commit: f54ec58fee837ec847cb8b50593e81bfaa46107f [6/102] wimax: move out to staging
:::::: branch date: 8 hours ago
:::::: commit date: 2 days ago
config: s390-randconfig-m031-20201030 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/staging/wimax/i2400m/usb-tx.c:205 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
drivers/staging/wimax/i2400m/fw.c:339 i2400m_barker_db_init() warn: impossible condition '(barker > 4294967295) => (0-u32max > u32max)'
Old smatch warnings:
drivers/staging/wimax/i2400m/usb-tx.c:206 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
drivers/staging/wimax/i2400m/usb-tx.c:208 i2400mu_txd() error: uninitialized symbol 'tx_msg_size'.
vim +/tx_msg_size +205 drivers/staging/wimax/i2400m/usb-tx.c
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 166
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 167
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 168 /*
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 169 * Get the next TX message in the TX FIFO and send it to the device
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 170 *
25985edcedea63 drivers/net/wimax/i2400m/usb-tx.c Lucas De Marchi 2011-03-30 171 * Note we exit the loop if i2400mu_tx() fails; that function only
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 172 * fails on hard error (failing to tx a buffer not being one of them,
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 173 * see its doc).
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 174 *
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 175 * Return: 0
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 176 */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 177 static
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 178 int i2400mu_txd(void *_i2400mu)
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 179 {
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 180 struct i2400mu *i2400mu = _i2400mu;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 181 struct i2400m *i2400m = &i2400mu->i2400m;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 182 struct device *dev = &i2400mu->usb_iface->dev;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 183 struct i2400m_msg_hdr *tx_msg;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 184 size_t tx_msg_size;
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 185 unsigned long flags;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 186
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 187 d_fnstart(4, dev, "(i2400mu %p)\n", i2400mu);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 188
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 189 spin_lock_irqsave(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 190 BUG_ON(i2400mu->tx_kthread != NULL);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 191 i2400mu->tx_kthread = current;
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 192 spin_unlock_irqrestore(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 193
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 194 while (1) {
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 195 d_printf(2, dev, "TX: waiting for messages\n");
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 196 tx_msg = NULL;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 197 wait_event_interruptible(
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 198 i2400mu->tx_wq,
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 199 (kthread_should_stop() /* check this first! */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 200 || (tx_msg = i2400m_tx_msg_get(i2400m, &tx_msg_size)))
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 201 );
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 202 if (kthread_should_stop())
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 203 break;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 204 WARN_ON(tx_msg == NULL); /* should not happen...*/
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 @205 d_printf(2, dev, "TX: submitting %zu bytes\n", tx_msg_size);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 206 d_dump(5, dev, tx_msg, tx_msg_size);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 207 /* Yeah, we ignore errors ... not much we can do */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 208 i2400mu_tx(i2400mu, tx_msg, tx_msg_size);
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 209 i2400m_tx_msg_sent(i2400m); /* ack it, advance the FIFO */
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 210 }
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 211
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 212 spin_lock_irqsave(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 213 i2400mu->tx_kthread = NULL;
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 214 spin_unlock_irqrestore(&i2400m->tx_lock, flags);
4a78fd9a736db4 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2009-10-08 215
d1d182e00d7230 drivers/net/wimax/i2400m/usb-tx.c Dan Carpenter 2011-12-16 216 d_fnend(4, dev, "(i2400mu %p)\n", i2400mu);
d1d182e00d7230 drivers/net/wimax/i2400m/usb-tx.c Dan Carpenter 2011-12-16 217 return 0;
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 218 }
a8ebf98f541463 drivers/net/wimax/i2400m/usb-tx.c Inaky Perez-Gonzalez 2008-12-20 219
:::::: The code at line 205 was first introduced by commit
:::::: a8ebf98f541463107bb9544a1b611981dc2477e7 i2400m/USB: TX and RX path backends
:::::: TO: Inaky Perez-Gonzalez <inaky(a)linux.intel.com>
:::::: CC: Greg Kroah-Hartman <gregkh(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
drivers/media/i2c/tvp5150.c:1114 tvp5150_set_selection() warn: passing a valid pointer to 'PTR_ERR'
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Marco Felsch <m.felsch(a)pengutronix.de>
CC: Mauro Carvalho Chehab <mchehab(a)kernel.org>
CC: linux-media(a)vger.kernel.org
CC: Hans Verkuil <hverkuil(a)xs4all.nl>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 5fc6b075e165f641fbc366b58b578055762d5f8c
commit: 46fe6e7dcededcf4aba88163fee80f4f7df23deb media: tvp5150: add FORMAT_TRY support for get/set selection handlers
date: 8 months ago
:::::: branch date: 11 hours ago
:::::: commit date: 8 months ago
config: parisc-randconfig-m031-20201031 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/media/i2c/tvp5150.c:1114 tvp5150_set_selection() warn: passing a valid pointer to 'PTR_ERR'
drivers/media/i2c/tvp5150.c:1157 tvp5150_get_selection() warn: passing a valid pointer to 'PTR_ERR'
vim +/PTR_ERR +1114 drivers/media/i2c/tvp5150.c
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1076
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1077 static int tvp5150_set_selection(struct v4l2_subdev *sd,
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1078 struct v4l2_subdev_pad_config *cfg,
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1079 struct v4l2_subdev_selection *sel)
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1080 {
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1081 struct tvp5150 *decoder = to_tvp5150(sd);
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1082 struct v4l2_rect *rect = &sel->r;
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1083 struct v4l2_rect *crop;
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1084 unsigned int hmax;
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1085
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1086 if (sel->target != V4L2_SEL_TGT_CROP)
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1087 return -EINVAL;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1088
257e29f84e377d drivers/media/i2c/tvp5150.c Mauro Carvalho Chehab 2016-11-16 1089 dev_dbg_lvl(sd->dev, 1, debug, "%s left=%d, top=%d, width=%d, height=%d\n",
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1090 __func__, rect->left, rect->top, rect->width, rect->height);
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1091
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1092 /* tvp5150 has some special limits */
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1093 rect->left = clamp(rect->left, 0, TVP5150_MAX_CROP_LEFT);
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1094 rect->top = clamp(rect->top, 0, TVP5150_MAX_CROP_TOP);
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1095 hmax = tvp5150_get_hmax(sd);
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1096
bd24db04101f45 drivers/media/i2c/tvp5150.c Marco Felsch 2018-06-28 1097 /*
bd24db04101f45 drivers/media/i2c/tvp5150.c Marco Felsch 2018-06-28 1098 * alignments:
bd24db04101f45 drivers/media/i2c/tvp5150.c Marco Felsch 2018-06-28 1099 * - width = 2 due to UYVY colorspace
bd24db04101f45 drivers/media/i2c/tvp5150.c Marco Felsch 2018-06-28 1100 * - height, image = no special alignment
bd24db04101f45 drivers/media/i2c/tvp5150.c Marco Felsch 2018-06-28 1101 */
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1102 v4l_bound_align_image(&rect->width,
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1103 TVP5150_H_MAX - TVP5150_MAX_CROP_LEFT - rect->left,
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1104 TVP5150_H_MAX - rect->left, 1, &rect->height,
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1105 hmax - TVP5150_MAX_CROP_TOP - rect->top,
b4125e5b1bd70d drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1106 hmax - rect->top, 0, 0);
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1107
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1108 if (!IS_ENABLED(CONFIG_VIDEO_V4L2_SUBDEV_API) &&
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1109 sel->which == V4L2_SUBDEV_FORMAT_TRY)
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1110 return 0;
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1111
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1112 crop = tvp5150_get_pad_crop(decoder, cfg, sel->pad, sel->which);
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1113 if (IS_ERR(crop))
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 @1114 return PTR_ERR(crop);
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1115
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1116 /*
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1117 * Update output image size if the selection (crop) rectangle size or
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1118 * position has been modified.
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1119 */
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1120 if (sel->which == V4L2_SUBDEV_FORMAT_ACTIVE &&
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1121 !v4l2_rect_equal(rect, crop))
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1122 tvp5150_set_hw_selection(sd, rect);
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1123
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1124 *crop = *rect;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1125
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1126 return 0;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1127 }
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1128
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1129 static int tvp5150_get_selection(struct v4l2_subdev *sd,
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1130 struct v4l2_subdev_pad_config *cfg,
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1131 struct v4l2_subdev_selection *sel)
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1132 {
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1133 struct tvp5150 *decoder = container_of(sd, struct tvp5150, sd);
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1134 struct v4l2_rect *crop;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1135 v4l2_std_id std;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1136
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1137 switch (sel->target) {
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1138 case V4L2_SEL_TGT_CROP_BOUNDS:
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1139 sel->r.left = 0;
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1140 sel->r.top = 0;
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1141 sel->r.width = TVP5150_H_MAX;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1142
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1143 /* Calculate height based on current standard */
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1144 if (decoder->norm == V4L2_STD_ALL)
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1145 std = tvp5150_read_std(sd);
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1146 else
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1147 std = decoder->norm;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1148 if (std & V4L2_STD_525_60)
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1149 sel->r.height = TVP5150_V_MAX_525_60;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1150 else
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1151 sel->r.height = TVP5150_V_MAX_OTHERS;
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1152 return 0;
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1153 case V4L2_SEL_TGT_CROP:
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1154 crop = tvp5150_get_pad_crop(decoder, cfg, sel->pad,
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1155 sel->which);
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1156 if (IS_ERR(crop))
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 @1157 return PTR_ERR(crop);
46fe6e7dcededc drivers/media/i2c/tvp5150.c Marco Felsch 2020-03-12 1158 sel->r = *crop;
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1159 return 0;
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1160 default:
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1161 return -EINVAL;
10d5509c8d50a2 drivers/media/i2c/tvp5150.c Hans Verkuil 2015-12-14 1162 }
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1163 }
963ddc63e20d5e drivers/media/video/tvp5150.c Javier Martin 2012-01-31 1164
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[kdave-btrfs-devel:for-next-20201030 14906/14978] fs/btrfs/file-item.c:1024 btrfs_csum_file_blocks() warn: should 'ins_size << fs_info->sectorsize_bits' be a 64 bit
by kernel test robot
CC: kbuild-all(a)lists.01.org
TO: David Sterba <dsterba(a)suse.com>
CC: Johannes Thumshirn <johannes.thumshirn(a)wdc.com>
tree: https://github.com/kdave/btrfs-devel.git for-next-20201030
head: 757db2d191a0eb51ffb9acf023e31393d731b0a9
commit: e327ae96b938d96c0926ab0d482106fc10dffe53 [14906/14978] btrfs: use precalculated sectorsize_bits from fs_info
:::::: branch date: 9 hours ago
:::::: commit date: 9 hours ago
config: x86_64-randconfig-m001-20201030 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
fs/btrfs/file-item.c:1024 btrfs_csum_file_blocks() warn: should 'ins_size << fs_info->sectorsize_bits' be a 64 bit type?
vim +1024 fs/btrfs/file-item.c
459931eca5f4b8c Chris Mason 2008-12-10 832
065631f6dccea07 Chris Mason 2008-02-20 833 int btrfs_csum_file_blocks(struct btrfs_trans_handle *trans,
d20f7043fa65659 Chris Mason 2008-12-08 834 struct btrfs_root *root,
e6dcd2dc9c48910 Chris Mason 2008-07-17 835 struct btrfs_ordered_sum *sums)
f254e52c1ce550f Chris Mason 2007-03-29 836 {
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 837 struct btrfs_fs_info *fs_info = root->fs_info;
f254e52c1ce550f Chris Mason 2007-03-29 838 struct btrfs_key file_key;
6567e837df07e43 Chris Mason 2007-04-16 839 struct btrfs_key found_key;
5caf2a002901f0f Chris Mason 2007-04-02 840 struct btrfs_path *path;
f254e52c1ce550f Chris Mason 2007-03-29 841 struct btrfs_csum_item *item;
065631f6dccea07 Chris Mason 2008-02-20 842 struct btrfs_csum_item *item_end;
ff79f8190b6e955 Chris Mason 2007-10-15 843 struct extent_buffer *leaf = NULL;
f51a4a1826ff810 Miao Xie 2013-06-19 844 u64 next_offset;
f51a4a1826ff810 Miao Xie 2013-06-19 845 u64 total_bytes = 0;
6567e837df07e43 Chris Mason 2007-04-16 846 u64 csum_offset;
f51a4a1826ff810 Miao Xie 2013-06-19 847 u64 bytenr;
f578d4bd7e141dd Chris Mason 2007-10-25 848 u32 nritems;
f578d4bd7e141dd Chris Mason 2007-10-25 849 u32 ins_size;
f51a4a1826ff810 Miao Xie 2013-06-19 850 int index = 0;
f51a4a1826ff810 Miao Xie 2013-06-19 851 int found_next;
f51a4a1826ff810 Miao Xie 2013-06-19 852 int ret;
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 853 u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
6e92f5e651a34f2 Chris Mason 2008-02-20 854
5caf2a002901f0f Chris Mason 2007-04-02 855 path = btrfs_alloc_path();
d8926bb3badd366 Mark Fasheh 2011-07-13 856 if (!path)
d8926bb3badd366 Mark Fasheh 2011-07-13 857 return -ENOMEM;
065631f6dccea07 Chris Mason 2008-02-20 858 again:
065631f6dccea07 Chris Mason 2008-02-20 859 next_offset = (u64)-1;
065631f6dccea07 Chris Mason 2008-02-20 860 found_next = 0;
f51a4a1826ff810 Miao Xie 2013-06-19 861 bytenr = sums->bytenr + total_bytes;
d20f7043fa65659 Chris Mason 2008-12-08 862 file_key.objectid = BTRFS_EXTENT_CSUM_OBJECTID;
f51a4a1826ff810 Miao Xie 2013-06-19 863 file_key.offset = bytenr;
962a298f35110ed David Sterba 2014-06-04 864 file_key.type = BTRFS_EXTENT_CSUM_KEY;
a429e51371eee3c Chris Mason 2007-04-18 865
f51a4a1826ff810 Miao Xie 2013-06-19 866 item = btrfs_lookup_csum(trans, root, path, bytenr, 1);
ff79f8190b6e955 Chris Mason 2007-10-15 867 if (!IS_ERR(item)) {
639cb58675ce9b5 Chris Mason 2008-08-28 868 ret = 0;
f51a4a1826ff810 Miao Xie 2013-06-19 869 leaf = path->nodes[0];
f51a4a1826ff810 Miao Xie 2013-06-19 870 item_end = btrfs_item_ptr(leaf, path->slots[0],
f51a4a1826ff810 Miao Xie 2013-06-19 871 struct btrfs_csum_item);
f51a4a1826ff810 Miao Xie 2013-06-19 872 item_end = (struct btrfs_csum_item *)((char *)item_end +
f51a4a1826ff810 Miao Xie 2013-06-19 873 btrfs_item_size_nr(leaf, path->slots[0]));
a429e51371eee3c Chris Mason 2007-04-18 874 goto found;
ff79f8190b6e955 Chris Mason 2007-10-15 875 }
a429e51371eee3c Chris Mason 2007-04-18 876 ret = PTR_ERR(item);
4a500fd178c89b9 Yan, Zheng 2010-05-16 877 if (ret != -EFBIG && ret != -ENOENT)
918cdf442326e5e Filipe Manana 2020-05-18 878 goto out;
4a500fd178c89b9 Yan, Zheng 2010-05-16 879
a429e51371eee3c Chris Mason 2007-04-18 880 if (ret == -EFBIG) {
a429e51371eee3c Chris Mason 2007-04-18 881 u32 item_size;
a429e51371eee3c Chris Mason 2007-04-18 882 /* we found one, but it isn't big enough yet */
5f39d397dfbe140 Chris Mason 2007-10-15 883 leaf = path->nodes[0];
5f39d397dfbe140 Chris Mason 2007-10-15 884 item_size = btrfs_item_size_nr(leaf, path->slots[0]);
607d432da0542e8 Josef Bacik 2008-12-02 885 if ((item_size / csum_size) >=
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 886 MAX_CSUM_ITEMS(fs_info, csum_size)) {
a429e51371eee3c Chris Mason 2007-04-18 887 /* already at max size, make a new one */
a429e51371eee3c Chris Mason 2007-04-18 888 goto insert;
a429e51371eee3c Chris Mason 2007-04-18 889 }
a429e51371eee3c Chris Mason 2007-04-18 890 } else {
f578d4bd7e141dd Chris Mason 2007-10-25 891 int slot = path->slots[0] + 1;
a429e51371eee3c Chris Mason 2007-04-18 892 /* we didn't find a csum item, insert one */
f578d4bd7e141dd Chris Mason 2007-10-25 893 nritems = btrfs_header_nritems(path->nodes[0]);
35045bf2fd7c030 Filipe Manana 2014-04-09 894 if (!nritems || (path->slots[0] >= nritems - 1)) {
f578d4bd7e141dd Chris Mason 2007-10-25 895 ret = btrfs_next_leaf(root, path);
7e4a3f7ed5d5492 Filipe Manana 2020-05-18 896 if (ret < 0) {
7e4a3f7ed5d5492 Filipe Manana 2020-05-18 897 goto out;
7e4a3f7ed5d5492 Filipe Manana 2020-05-18 898 } else if (ret > 0) {
f578d4bd7e141dd Chris Mason 2007-10-25 899 found_next = 1;
f578d4bd7e141dd Chris Mason 2007-10-25 900 goto insert;
7e4a3f7ed5d5492 Filipe Manana 2020-05-18 901 }
27b9a8122ff71a8 Filipe Manana 2014-08-09 902 slot = path->slots[0];
f578d4bd7e141dd Chris Mason 2007-10-25 903 }
f578d4bd7e141dd Chris Mason 2007-10-25 904 btrfs_item_key_to_cpu(path->nodes[0], &found_key, slot);
d20f7043fa65659 Chris Mason 2008-12-08 905 if (found_key.objectid != BTRFS_EXTENT_CSUM_OBJECTID ||
d20f7043fa65659 Chris Mason 2008-12-08 906 found_key.type != BTRFS_EXTENT_CSUM_KEY) {
f578d4bd7e141dd Chris Mason 2007-10-25 907 found_next = 1;
f578d4bd7e141dd Chris Mason 2007-10-25 908 goto insert;
f578d4bd7e141dd Chris Mason 2007-10-25 909 }
f578d4bd7e141dd Chris Mason 2007-10-25 910 next_offset = found_key.offset;
f578d4bd7e141dd Chris Mason 2007-10-25 911 found_next = 1;
a429e51371eee3c Chris Mason 2007-04-18 912 goto insert;
a429e51371eee3c Chris Mason 2007-04-18 913 }
a429e51371eee3c Chris Mason 2007-04-18 914
a429e51371eee3c Chris Mason 2007-04-18 915 /*
cc14600c1516f6c Filipe Manana 2020-05-18 916 * At this point, we know the tree has a checksum item that ends at an
cc14600c1516f6c Filipe Manana 2020-05-18 917 * offset matching the start of the checksum range we want to insert.
cc14600c1516f6c Filipe Manana 2020-05-18 918 * We try to extend that item as much as possible and then add as many
cc14600c1516f6c Filipe Manana 2020-05-18 919 * checksums to it as they fit.
cc14600c1516f6c Filipe Manana 2020-05-18 920 *
cc14600c1516f6c Filipe Manana 2020-05-18 921 * First check if the leaf has enough free space for at least one
cc14600c1516f6c Filipe Manana 2020-05-18 922 * checksum. If it has go directly to the item extension code, otherwise
cc14600c1516f6c Filipe Manana 2020-05-18 923 * release the path and do a search for insertion before the extension.
a429e51371eee3c Chris Mason 2007-04-18 924 */
cc14600c1516f6c Filipe Manana 2020-05-18 925 if (btrfs_leaf_free_space(leaf) >= csum_size) {
cc14600c1516f6c Filipe Manana 2020-05-18 926 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
cc14600c1516f6c Filipe Manana 2020-05-18 927 csum_offset = (bytenr - found_key.offset) >>
cc14600c1516f6c Filipe Manana 2020-05-18 928 fs_info->sb->s_blocksize_bits;
cc14600c1516f6c Filipe Manana 2020-05-18 929 goto extend_csum;
cc14600c1516f6c Filipe Manana 2020-05-18 930 }
cc14600c1516f6c Filipe Manana 2020-05-18 931
b3b4aa74b58bded David Sterba 2011-04-21 932 btrfs_release_path(path);
6567e837df07e43 Chris Mason 2007-04-16 933 ret = btrfs_search_slot(trans, root, &file_key, path,
607d432da0542e8 Josef Bacik 2008-12-02 934 csum_size, 1);
6567e837df07e43 Chris Mason 2007-04-16 935 if (ret < 0)
918cdf442326e5e Filipe Manana 2020-05-18 936 goto out;
459931eca5f4b8c Chris Mason 2008-12-10 937
459931eca5f4b8c Chris Mason 2008-12-10 938 if (ret > 0) {
459931eca5f4b8c Chris Mason 2008-12-10 939 if (path->slots[0] == 0)
6567e837df07e43 Chris Mason 2007-04-16 940 goto insert;
6567e837df07e43 Chris Mason 2007-04-16 941 path->slots[0]--;
459931eca5f4b8c Chris Mason 2008-12-10 942 }
459931eca5f4b8c Chris Mason 2008-12-10 943
5f39d397dfbe140 Chris Mason 2007-10-15 944 leaf = path->nodes[0];
5f39d397dfbe140 Chris Mason 2007-10-15 945 btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]);
d20f7043fa65659 Chris Mason 2008-12-08 946 csum_offset = (bytenr - found_key.offset) >>
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 947 fs_info->sb->s_blocksize_bits;
459931eca5f4b8c Chris Mason 2008-12-10 948
962a298f35110ed David Sterba 2014-06-04 949 if (found_key.type != BTRFS_EXTENT_CSUM_KEY ||
d20f7043fa65659 Chris Mason 2008-12-08 950 found_key.objectid != BTRFS_EXTENT_CSUM_OBJECTID ||
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 951 csum_offset >= MAX_CSUM_ITEMS(fs_info, csum_size)) {
6567e837df07e43 Chris Mason 2007-04-16 952 goto insert;
6567e837df07e43 Chris Mason 2007-04-16 953 }
459931eca5f4b8c Chris Mason 2008-12-10 954
cc14600c1516f6c Filipe Manana 2020-05-18 955 extend_csum:
2f697dc6a648d3a Liu Bo 2013-02-04 956 if (csum_offset == btrfs_item_size_nr(leaf, path->slots[0]) /
607d432da0542e8 Josef Bacik 2008-12-02 957 csum_size) {
2f697dc6a648d3a Liu Bo 2013-02-04 958 int extend_nr;
2f697dc6a648d3a Liu Bo 2013-02-04 959 u64 tmp;
2f697dc6a648d3a Liu Bo 2013-02-04 960 u32 diff;
2f697dc6a648d3a Liu Bo 2013-02-04 961
f51a4a1826ff810 Miao Xie 2013-06-19 962 tmp = sums->len - total_bytes;
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 963 tmp >>= fs_info->sb->s_blocksize_bits;
2f697dc6a648d3a Liu Bo 2013-02-04 964 WARN_ON(tmp < 1);
2f697dc6a648d3a Liu Bo 2013-02-04 965
2f697dc6a648d3a Liu Bo 2013-02-04 966 extend_nr = max_t(int, 1, (int)tmp);
2f697dc6a648d3a Liu Bo 2013-02-04 967 diff = (csum_offset + extend_nr) * csum_size;
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 968 diff = min(diff,
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 969 MAX_CSUM_ITEMS(fs_info, csum_size) * csum_size);
459931eca5f4b8c Chris Mason 2008-12-10 970
5f39d397dfbe140 Chris Mason 2007-10-15 971 diff = diff - btrfs_item_size_nr(leaf, path->slots[0]);
cc14600c1516f6c Filipe Manana 2020-05-18 972 diff = min_t(u32, btrfs_leaf_free_space(leaf), diff);
2f697dc6a648d3a Liu Bo 2013-02-04 973 diff /= csum_size;
2f697dc6a648d3a Liu Bo 2013-02-04 974 diff *= csum_size;
459931eca5f4b8c Chris Mason 2008-12-10 975
c71dd88007bdc8b David Sterba 2019-03-20 976 btrfs_extend_item(path, diff);
f51a4a1826ff810 Miao Xie 2013-06-19 977 ret = 0;
6567e837df07e43 Chris Mason 2007-04-16 978 goto csum;
6567e837df07e43 Chris Mason 2007-04-16 979 }
6567e837df07e43 Chris Mason 2007-04-16 980
6567e837df07e43 Chris Mason 2007-04-16 981 insert:
b3b4aa74b58bded David Sterba 2011-04-21 982 btrfs_release_path(path);
6567e837df07e43 Chris Mason 2007-04-16 983 csum_offset = 0;
f578d4bd7e141dd Chris Mason 2007-10-25 984 if (found_next) {
2f697dc6a648d3a Liu Bo 2013-02-04 985 u64 tmp;
d20f7043fa65659 Chris Mason 2008-12-08 986
f51a4a1826ff810 Miao Xie 2013-06-19 987 tmp = sums->len - total_bytes;
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 988 tmp >>= fs_info->sb->s_blocksize_bits;
2f697dc6a648d3a Liu Bo 2013-02-04 989 tmp = min(tmp, (next_offset - file_key.offset) >>
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 990 fs_info->sb->s_blocksize_bits);
2f697dc6a648d3a Liu Bo 2013-02-04 991
50d0446e68fa0b6 Seraphime Kirkovski 2016-12-15 992 tmp = max_t(u64, 1, tmp);
50d0446e68fa0b6 Seraphime Kirkovski 2016-12-15 993 tmp = min_t(u64, tmp, MAX_CSUM_ITEMS(fs_info, csum_size));
607d432da0542e8 Josef Bacik 2008-12-02 994 ins_size = csum_size * tmp;
f578d4bd7e141dd Chris Mason 2007-10-25 995 } else {
607d432da0542e8 Josef Bacik 2008-12-02 996 ins_size = csum_size;
f578d4bd7e141dd Chris Mason 2007-10-25 997 }
b9473439d3e84d9 Chris Mason 2009-03-13 998 path->leave_spinning = 1;
5caf2a002901f0f Chris Mason 2007-04-02 999 ret = btrfs_insert_empty_item(trans, root, path, &file_key,
f578d4bd7e141dd Chris Mason 2007-10-25 1000 ins_size);
b9473439d3e84d9 Chris Mason 2009-03-13 1001 path->leave_spinning = 0;
54aa1f4dfdacd60 Chris Mason 2007-06-22 1002 if (ret < 0)
918cdf442326e5e Filipe Manana 2020-05-18 1003 goto out;
fae7f21cece9a4c Dulshani Gunawardhana 2013-10-31 1004 if (WARN_ON(ret != 0))
918cdf442326e5e Filipe Manana 2020-05-18 1005 goto out;
5f39d397dfbe140 Chris Mason 2007-10-15 1006 leaf = path->nodes[0];
f51a4a1826ff810 Miao Xie 2013-06-19 1007 csum:
5f39d397dfbe140 Chris Mason 2007-10-15 1008 item = btrfs_item_ptr(leaf, path->slots[0], struct btrfs_csum_item);
f51a4a1826ff810 Miao Xie 2013-06-19 1009 item_end = (struct btrfs_csum_item *)((unsigned char *)item +
f51a4a1826ff810 Miao Xie 2013-06-19 1010 btrfs_item_size_nr(leaf, path->slots[0]));
509659cde578d89 Chris Mason 2007-05-10 1011 item = (struct btrfs_csum_item *)((unsigned char *)item +
607d432da0542e8 Josef Bacik 2008-12-02 1012 csum_offset * csum_size);
b18c6685810af8e Chris Mason 2007-04-17 1013 found:
f51a4a1826ff810 Miao Xie 2013-06-19 1014 ins_size = (u32)(sums->len - total_bytes) >>
0b246afa62b0cf5 Jeff Mahoney 2016-06-22 1015 fs_info->sb->s_blocksize_bits;
f51a4a1826ff810 Miao Xie 2013-06-19 1016 ins_size *= csum_size;
f51a4a1826ff810 Miao Xie 2013-06-19 1017 ins_size = min_t(u32, (unsigned long)item_end - (unsigned long)item,
f51a4a1826ff810 Miao Xie 2013-06-19 1018 ins_size);
f51a4a1826ff810 Miao Xie 2013-06-19 1019 write_extent_buffer(leaf, sums->sums + index, (unsigned long)item,
f51a4a1826ff810 Miao Xie 2013-06-19 1020 ins_size);
7f3c74fb831fa19 Chris Mason 2008-07-18 1021
1e25a2e3ca0dab0 Johannes Thumshirn 2019-05-22 1022 index += ins_size;
f51a4a1826ff810 Miao Xie 2013-06-19 1023 ins_size /= csum_size;
e327ae96b938d96 David Sterba 2020-07-01 @1024 total_bytes += ins_size << fs_info->sectorsize_bits;
a65917156e34594 Chris Mason 2011-07-19 1025
5caf2a002901f0f Chris Mason 2007-04-02 1026 btrfs_mark_buffer_dirty(path->nodes[0]);
e6dcd2dc9c48910 Chris Mason 2008-07-17 1027 if (total_bytes < sums->len) {
b3b4aa74b58bded David Sterba 2011-04-21 1028 btrfs_release_path(path);
b9473439d3e84d9 Chris Mason 2009-03-13 1029 cond_resched();
065631f6dccea07 Chris Mason 2008-02-20 1030 goto again;
065631f6dccea07 Chris Mason 2008-02-20 1031 }
53863232ef96177 Chris Mason 2008-08-15 1032 out:
5caf2a002901f0f Chris Mason 2007-04-02 1033 btrfs_free_path(path);
f254e52c1ce550f Chris Mason 2007-03-29 1034 return ret;
f254e52c1ce550f Chris Mason 2007-03-29 1035 }
7ffbb598a059b73 Filipe Manana 2014-06-09 1036
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
mm/nommu.c:924:4: warning: Assignment of function parameter has no effect outside the function.
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Christoph Hellwig <hch(a)lst.de>
CC: Paul Walmsley <paul.walmsley(a)sifive.com>
CC: Anup Patel <anup(a)brainfault.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 07e0887302450a62f51dba72df6afb5fabb23d1c
commit: 6bd33e1ece528f67646db33bf97406b747dafda0 riscv: add nommu support
date: 12 months ago
:::::: branch date: 26 hours ago
:::::: commit date: 12 months ago
compiler: riscv64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> mm/nommu.c:924:4: warning: Assignment of function parameter has no effect outside the function. [uselessAssignmentArg]
prot |= PROT_EXEC;
^
vim +924 mm/nommu.c
^1da177e4c3f415 Linus Torvalds 2005-04-16 775
^1da177e4c3f415 Linus Torvalds 2005-04-16 776 /*
^1da177e4c3f415 Linus Torvalds 2005-04-16 777 * determine whether a mapping should be permitted and, if so, what sort of
^1da177e4c3f415 Linus Torvalds 2005-04-16 778 * mapping we're capable of supporting
^1da177e4c3f415 Linus Torvalds 2005-04-16 779 */
^1da177e4c3f415 Linus Torvalds 2005-04-16 780 static int validate_mmap_request(struct file *file,
^1da177e4c3f415 Linus Torvalds 2005-04-16 781 unsigned long addr,
^1da177e4c3f415 Linus Torvalds 2005-04-16 782 unsigned long len,
^1da177e4c3f415 Linus Torvalds 2005-04-16 783 unsigned long prot,
^1da177e4c3f415 Linus Torvalds 2005-04-16 784 unsigned long flags,
^1da177e4c3f415 Linus Torvalds 2005-04-16 785 unsigned long pgoff,
^1da177e4c3f415 Linus Torvalds 2005-04-16 786 unsigned long *_capabilities)
^1da177e4c3f415 Linus Torvalds 2005-04-16 787 {
8feae13110d60cc David Howells 2009-01-08 788 unsigned long capabilities, rlen;
^1da177e4c3f415 Linus Torvalds 2005-04-16 789 int ret;
^1da177e4c3f415 Linus Torvalds 2005-04-16 790
^1da177e4c3f415 Linus Torvalds 2005-04-16 791 /* do the simple checks first */
22cc877b32202b6 Leon Romanovsky 2015-06-24 792 if (flags & MAP_FIXED)
^1da177e4c3f415 Linus Torvalds 2005-04-16 793 return -EINVAL;
^1da177e4c3f415 Linus Torvalds 2005-04-16 794
^1da177e4c3f415 Linus Torvalds 2005-04-16 795 if ((flags & MAP_TYPE) != MAP_PRIVATE &&
^1da177e4c3f415 Linus Torvalds 2005-04-16 796 (flags & MAP_TYPE) != MAP_SHARED)
^1da177e4c3f415 Linus Torvalds 2005-04-16 797 return -EINVAL;
^1da177e4c3f415 Linus Torvalds 2005-04-16 798
f81cff0d4067e41 Mike Frysinger 2006-12-06 799 if (!len)
^1da177e4c3f415 Linus Torvalds 2005-04-16 800 return -EINVAL;
^1da177e4c3f415 Linus Torvalds 2005-04-16 801
f81cff0d4067e41 Mike Frysinger 2006-12-06 802 /* Careful about overflows.. */
8feae13110d60cc David Howells 2009-01-08 803 rlen = PAGE_ALIGN(len);
8feae13110d60cc David Howells 2009-01-08 804 if (!rlen || rlen > TASK_SIZE)
f81cff0d4067e41 Mike Frysinger 2006-12-06 805 return -ENOMEM;
f81cff0d4067e41 Mike Frysinger 2006-12-06 806
^1da177e4c3f415 Linus Torvalds 2005-04-16 807 /* offset overflow? */
8feae13110d60cc David Howells 2009-01-08 808 if ((pgoff + (rlen >> PAGE_SHIFT)) < pgoff)
f81cff0d4067e41 Mike Frysinger 2006-12-06 809 return -EOVERFLOW;
^1da177e4c3f415 Linus Torvalds 2005-04-16 810
^1da177e4c3f415 Linus Torvalds 2005-04-16 811 if (file) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 812 /* files must support mmap */
72c2d5319200484 Al Viro 2013-09-22 813 if (!file->f_op->mmap)
^1da177e4c3f415 Linus Torvalds 2005-04-16 814 return -ENODEV;
^1da177e4c3f415 Linus Torvalds 2005-04-16 815
^1da177e4c3f415 Linus Torvalds 2005-04-16 816 /* work out if what we've got could possibly be shared
^1da177e4c3f415 Linus Torvalds 2005-04-16 817 * - we support chardevs that provide their own "memory"
^1da177e4c3f415 Linus Torvalds 2005-04-16 818 * - we support files/blockdevs that are memory backed
^1da177e4c3f415 Linus Torvalds 2005-04-16 819 */
b4caecd48005fbe Christoph Hellwig 2015-01-14 820 if (file->f_op->mmap_capabilities) {
b4caecd48005fbe Christoph Hellwig 2015-01-14 821 capabilities = file->f_op->mmap_capabilities(file);
b4caecd48005fbe Christoph Hellwig 2015-01-14 822 } else {
^1da177e4c3f415 Linus Torvalds 2005-04-16 823 /* no explicit capabilities set, so assume some
^1da177e4c3f415 Linus Torvalds 2005-04-16 824 * defaults */
496ad9aa8ef4480 Al Viro 2013-01-23 825 switch (file_inode(file)->i_mode & S_IFMT) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 826 case S_IFREG:
^1da177e4c3f415 Linus Torvalds 2005-04-16 827 case S_IFBLK:
b4caecd48005fbe Christoph Hellwig 2015-01-14 828 capabilities = NOMMU_MAP_COPY;
^1da177e4c3f415 Linus Torvalds 2005-04-16 829 break;
^1da177e4c3f415 Linus Torvalds 2005-04-16 830
^1da177e4c3f415 Linus Torvalds 2005-04-16 831 case S_IFCHR:
^1da177e4c3f415 Linus Torvalds 2005-04-16 832 capabilities =
b4caecd48005fbe Christoph Hellwig 2015-01-14 833 NOMMU_MAP_DIRECT |
b4caecd48005fbe Christoph Hellwig 2015-01-14 834 NOMMU_MAP_READ |
b4caecd48005fbe Christoph Hellwig 2015-01-14 835 NOMMU_MAP_WRITE;
^1da177e4c3f415 Linus Torvalds 2005-04-16 836 break;
^1da177e4c3f415 Linus Torvalds 2005-04-16 837
^1da177e4c3f415 Linus Torvalds 2005-04-16 838 default:
^1da177e4c3f415 Linus Torvalds 2005-04-16 839 return -EINVAL;
^1da177e4c3f415 Linus Torvalds 2005-04-16 840 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 841 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 842
^1da177e4c3f415 Linus Torvalds 2005-04-16 843 /* eliminate any capabilities that we can't support on this
^1da177e4c3f415 Linus Torvalds 2005-04-16 844 * device */
^1da177e4c3f415 Linus Torvalds 2005-04-16 845 if (!file->f_op->get_unmapped_area)
b4caecd48005fbe Christoph Hellwig 2015-01-14 846 capabilities &= ~NOMMU_MAP_DIRECT;
6e242a1ceeb1bcf Al Viro 2015-03-31 847 if (!(file->f_mode & FMODE_CAN_READ))
b4caecd48005fbe Christoph Hellwig 2015-01-14 848 capabilities &= ~NOMMU_MAP_COPY;
^1da177e4c3f415 Linus Torvalds 2005-04-16 849
28d7a6ae92c099d Graff Yang 2009-08-18 850 /* The file shall have been opened with read permission. */
28d7a6ae92c099d Graff Yang 2009-08-18 851 if (!(file->f_mode & FMODE_READ))
28d7a6ae92c099d Graff Yang 2009-08-18 852 return -EACCES;
28d7a6ae92c099d Graff Yang 2009-08-18 853
^1da177e4c3f415 Linus Torvalds 2005-04-16 854 if (flags & MAP_SHARED) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 855 /* do checks for writing, appending and locking */
^1da177e4c3f415 Linus Torvalds 2005-04-16 856 if ((prot & PROT_WRITE) &&
^1da177e4c3f415 Linus Torvalds 2005-04-16 857 !(file->f_mode & FMODE_WRITE))
^1da177e4c3f415 Linus Torvalds 2005-04-16 858 return -EACCES;
^1da177e4c3f415 Linus Torvalds 2005-04-16 859
496ad9aa8ef4480 Al Viro 2013-01-23 860 if (IS_APPEND(file_inode(file)) &&
^1da177e4c3f415 Linus Torvalds 2005-04-16 861 (file->f_mode & FMODE_WRITE))
^1da177e4c3f415 Linus Torvalds 2005-04-16 862 return -EACCES;
^1da177e4c3f415 Linus Torvalds 2005-04-16 863
d7a06983a01a336 Jeff Layton 2014-03-10 864 if (locks_verify_locked(file))
^1da177e4c3f415 Linus Torvalds 2005-04-16 865 return -EAGAIN;
^1da177e4c3f415 Linus Torvalds 2005-04-16 866
b4caecd48005fbe Christoph Hellwig 2015-01-14 867 if (!(capabilities & NOMMU_MAP_DIRECT))
^1da177e4c3f415 Linus Torvalds 2005-04-16 868 return -ENODEV;
^1da177e4c3f415 Linus Torvalds 2005-04-16 869
^1da177e4c3f415 Linus Torvalds 2005-04-16 870 /* we mustn't privatise shared mappings */
b4caecd48005fbe Christoph Hellwig 2015-01-14 871 capabilities &= ~NOMMU_MAP_COPY;
ac7149045d9fcca Choi Gi-yong 2014-04-07 872 } else {
^1da177e4c3f415 Linus Torvalds 2005-04-16 873 /* we're going to read the file into private memory we
^1da177e4c3f415 Linus Torvalds 2005-04-16 874 * allocate */
b4caecd48005fbe Christoph Hellwig 2015-01-14 875 if (!(capabilities & NOMMU_MAP_COPY))
^1da177e4c3f415 Linus Torvalds 2005-04-16 876 return -ENODEV;
^1da177e4c3f415 Linus Torvalds 2005-04-16 877
^1da177e4c3f415 Linus Torvalds 2005-04-16 878 /* we don't permit a private writable mapping to be
^1da177e4c3f415 Linus Torvalds 2005-04-16 879 * shared with the backing device */
^1da177e4c3f415 Linus Torvalds 2005-04-16 880 if (prot & PROT_WRITE)
b4caecd48005fbe Christoph Hellwig 2015-01-14 881 capabilities &= ~NOMMU_MAP_DIRECT;
^1da177e4c3f415 Linus Torvalds 2005-04-16 882 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 883
b4caecd48005fbe Christoph Hellwig 2015-01-14 884 if (capabilities & NOMMU_MAP_DIRECT) {
b4caecd48005fbe Christoph Hellwig 2015-01-14 885 if (((prot & PROT_READ) && !(capabilities & NOMMU_MAP_READ)) ||
b4caecd48005fbe Christoph Hellwig 2015-01-14 886 ((prot & PROT_WRITE) && !(capabilities & NOMMU_MAP_WRITE)) ||
b4caecd48005fbe Christoph Hellwig 2015-01-14 887 ((prot & PROT_EXEC) && !(capabilities & NOMMU_MAP_EXEC))
3c7b204547bc3d3 Bernd Schmidt 2010-05-25 888 ) {
b4caecd48005fbe Christoph Hellwig 2015-01-14 889 capabilities &= ~NOMMU_MAP_DIRECT;
3c7b204547bc3d3 Bernd Schmidt 2010-05-25 890 if (flags & MAP_SHARED) {
22cc877b32202b6 Leon Romanovsky 2015-06-24 891 pr_warn("MAP_SHARED not completely supported on !MMU\n");
3c7b204547bc3d3 Bernd Schmidt 2010-05-25 892 return -EINVAL;
3c7b204547bc3d3 Bernd Schmidt 2010-05-25 893 }
3c7b204547bc3d3 Bernd Schmidt 2010-05-25 894 }
3c7b204547bc3d3 Bernd Schmidt 2010-05-25 895 }
3c7b204547bc3d3 Bernd Schmidt 2010-05-25 896
^1da177e4c3f415 Linus Torvalds 2005-04-16 897 /* handle executable mappings and implied executable
^1da177e4c3f415 Linus Torvalds 2005-04-16 898 * mappings */
90f8572b0f021fd Eric W. Biederman 2015-06-29 899 if (path_noexec(&file->f_path)) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 900 if (prot & PROT_EXEC)
^1da177e4c3f415 Linus Torvalds 2005-04-16 901 return -EPERM;
ac7149045d9fcca Choi Gi-yong 2014-04-07 902 } else if ((prot & PROT_READ) && !(prot & PROT_EXEC)) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 903 /* handle implication of PROT_EXEC by PROT_READ */
^1da177e4c3f415 Linus Torvalds 2005-04-16 904 if (current->personality & READ_IMPLIES_EXEC) {
b4caecd48005fbe Christoph Hellwig 2015-01-14 905 if (capabilities & NOMMU_MAP_EXEC)
^1da177e4c3f415 Linus Torvalds 2005-04-16 906 prot |= PROT_EXEC;
^1da177e4c3f415 Linus Torvalds 2005-04-16 907 }
ac7149045d9fcca Choi Gi-yong 2014-04-07 908 } else if ((prot & PROT_READ) &&
^1da177e4c3f415 Linus Torvalds 2005-04-16 909 (prot & PROT_EXEC) &&
b4caecd48005fbe Christoph Hellwig 2015-01-14 910 !(capabilities & NOMMU_MAP_EXEC)
^1da177e4c3f415 Linus Torvalds 2005-04-16 911 ) {
^1da177e4c3f415 Linus Torvalds 2005-04-16 912 /* backing file is not executable, try to copy */
b4caecd48005fbe Christoph Hellwig 2015-01-14 913 capabilities &= ~NOMMU_MAP_DIRECT;
^1da177e4c3f415 Linus Torvalds 2005-04-16 914 }
ac7149045d9fcca Choi Gi-yong 2014-04-07 915 } else {
^1da177e4c3f415 Linus Torvalds 2005-04-16 916 /* anonymous mappings are always memory backed and can be
^1da177e4c3f415 Linus Torvalds 2005-04-16 917 * privately mapped
^1da177e4c3f415 Linus Torvalds 2005-04-16 918 */
b4caecd48005fbe Christoph Hellwig 2015-01-14 919 capabilities = NOMMU_MAP_COPY;
^1da177e4c3f415 Linus Torvalds 2005-04-16 920
^1da177e4c3f415 Linus Torvalds 2005-04-16 921 /* handle PROT_EXEC implication by PROT_READ */
^1da177e4c3f415 Linus Torvalds 2005-04-16 922 if ((prot & PROT_READ) &&
^1da177e4c3f415 Linus Torvalds 2005-04-16 923 (current->personality & READ_IMPLIES_EXEC))
^1da177e4c3f415 Linus Torvalds 2005-04-16 @924 prot |= PROT_EXEC;
^1da177e4c3f415 Linus Torvalds 2005-04-16 925 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 926
^1da177e4c3f415 Linus Torvalds 2005-04-16 927 /* allow the security API to have its say */
e5467859f7f79b6 Al Viro 2012-05-30 928 ret = security_mmap_addr(addr);
^1da177e4c3f415 Linus Torvalds 2005-04-16 929 if (ret < 0)
^1da177e4c3f415 Linus Torvalds 2005-04-16 930 return ret;
^1da177e4c3f415 Linus Torvalds 2005-04-16 931
^1da177e4c3f415 Linus Torvalds 2005-04-16 932 /* looks okay */
^1da177e4c3f415 Linus Torvalds 2005-04-16 933 *_capabilities = capabilities;
^1da177e4c3f415 Linus Torvalds 2005-04-16 934 return 0;
^1da177e4c3f415 Linus Torvalds 2005-04-16 935 }
^1da177e4c3f415 Linus Torvalds 2005-04-16 936
:::::: The code at line 924 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2
:::::: TO: Linus Torvalds <torvalds(a)ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds(a)ppc970.osdl.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
arch/powerpc/kexec/file_load_64.c:981 setup_new_fdt_ppc64() error: we previously assumed 'rmem' could be null (see line 977)
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
TO: Hari Bathini <hbathini(a)linux.ibm.com>
CC: Michael Ellerman <mpe(a)ellerman.id.au>
CC: Thiago Jung Bauermann <bauerman(a)linux.ibm.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 07e0887302450a62f51dba72df6afb5fabb23d1c
commit: 6ecd0163d36049b5f2435a8658f1320c9f3f2924 powerpc/kexec_file: Add appropriate regions for memory reserve map
date: 3 months ago
:::::: branch date: 20 hours ago
:::::: commit date: 3 months ago
config: powerpc64-randconfig-m031-20201028 (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
arch/powerpc/kexec/file_load_64.c:981 setup_new_fdt_ppc64() error: we previously assumed 'rmem' could be null (see line 977)
Old smatch warnings:
arch/powerpc/kexec/file_load_64.c:203 get_crash_memory_ranges() error: uninitialized symbol 'ret'.
vim +/rmem +981 arch/powerpc/kexec/file_load_64.c
19031275a58812 Hari Bathini 2020-07-29 911
19031275a58812 Hari Bathini 2020-07-29 912 /**
19031275a58812 Hari Bathini 2020-07-29 913 * setup_new_fdt_ppc64 - Update the flattend device-tree of the kernel
19031275a58812 Hari Bathini 2020-07-29 914 * being loaded.
19031275a58812 Hari Bathini 2020-07-29 915 * @image: kexec image being loaded.
19031275a58812 Hari Bathini 2020-07-29 916 * @fdt: Flattened device tree for the next kernel.
19031275a58812 Hari Bathini 2020-07-29 917 * @initrd_load_addr: Address where the next initrd will be loaded.
19031275a58812 Hari Bathini 2020-07-29 918 * @initrd_len: Size of the next initrd, or 0 if there will be none.
19031275a58812 Hari Bathini 2020-07-29 919 * @cmdline: Command line for the next kernel, or NULL if there will
19031275a58812 Hari Bathini 2020-07-29 920 * be none.
19031275a58812 Hari Bathini 2020-07-29 921 *
19031275a58812 Hari Bathini 2020-07-29 922 * Returns 0 on success, negative errno on error.
19031275a58812 Hari Bathini 2020-07-29 923 */
19031275a58812 Hari Bathini 2020-07-29 924 int setup_new_fdt_ppc64(const struct kimage *image, void *fdt,
19031275a58812 Hari Bathini 2020-07-29 925 unsigned long initrd_load_addr,
19031275a58812 Hari Bathini 2020-07-29 926 unsigned long initrd_len, const char *cmdline)
19031275a58812 Hari Bathini 2020-07-29 927 {
6ecd0163d36049 Hari Bathini 2020-07-29 928 struct crash_mem *umem = NULL, *rmem = NULL;
6ecd0163d36049 Hari Bathini 2020-07-29 929 int i, nr_ranges, ret;
7c64e21a1c5a5b Hari Bathini 2020-07-29 930
7c64e21a1c5a5b Hari Bathini 2020-07-29 931 ret = setup_new_fdt(image, fdt, initrd_load_addr, initrd_len, cmdline);
7c64e21a1c5a5b Hari Bathini 2020-07-29 932 if (ret)
7c64e21a1c5a5b Hari Bathini 2020-07-29 933 goto out;
7c64e21a1c5a5b Hari Bathini 2020-07-29 934
7c64e21a1c5a5b Hari Bathini 2020-07-29 935 /*
7c64e21a1c5a5b Hari Bathini 2020-07-29 936 * Restrict memory usage for kdump kernel by setting up
1a1cf93c200581 Hari Bathini 2020-07-29 937 * usable memory ranges and memory reserve map.
7c64e21a1c5a5b Hari Bathini 2020-07-29 938 */
7c64e21a1c5a5b Hari Bathini 2020-07-29 939 if (image->type == KEXEC_TYPE_CRASH) {
7c64e21a1c5a5b Hari Bathini 2020-07-29 940 ret = get_usable_memory_ranges(&umem);
7c64e21a1c5a5b Hari Bathini 2020-07-29 941 if (ret)
7c64e21a1c5a5b Hari Bathini 2020-07-29 942 goto out;
7c64e21a1c5a5b Hari Bathini 2020-07-29 943
7c64e21a1c5a5b Hari Bathini 2020-07-29 944 ret = update_usable_mem_fdt(fdt, umem);
7c64e21a1c5a5b Hari Bathini 2020-07-29 945 if (ret) {
7c64e21a1c5a5b Hari Bathini 2020-07-29 946 pr_err("Error setting up usable-memory property for kdump kernel\n");
7c64e21a1c5a5b Hari Bathini 2020-07-29 947 goto out;
7c64e21a1c5a5b Hari Bathini 2020-07-29 948 }
7c64e21a1c5a5b Hari Bathini 2020-07-29 949
1a1cf93c200581 Hari Bathini 2020-07-29 950 /*
1a1cf93c200581 Hari Bathini 2020-07-29 951 * Ensure we don't touch crashed kernel's memory except the
1a1cf93c200581 Hari Bathini 2020-07-29 952 * first 64K of RAM, which will be backed up.
1a1cf93c200581 Hari Bathini 2020-07-29 953 */
1a1cf93c200581 Hari Bathini 2020-07-29 954 ret = fdt_add_mem_rsv(fdt, BACKUP_SRC_END + 1,
1a1cf93c200581 Hari Bathini 2020-07-29 955 crashk_res.start - BACKUP_SRC_SIZE);
7c64e21a1c5a5b Hari Bathini 2020-07-29 956 if (ret) {
7c64e21a1c5a5b Hari Bathini 2020-07-29 957 pr_err("Error reserving crash memory: %s\n",
7c64e21a1c5a5b Hari Bathini 2020-07-29 958 fdt_strerror(ret));
7c64e21a1c5a5b Hari Bathini 2020-07-29 959 goto out;
7c64e21a1c5a5b Hari Bathini 2020-07-29 960 }
1a1cf93c200581 Hari Bathini 2020-07-29 961
1a1cf93c200581 Hari Bathini 2020-07-29 962 /* Ensure backup region is not used by kdump/capture kernel */
1a1cf93c200581 Hari Bathini 2020-07-29 963 ret = fdt_add_mem_rsv(fdt, image->arch.backup_start,
1a1cf93c200581 Hari Bathini 2020-07-29 964 BACKUP_SRC_SIZE);
1a1cf93c200581 Hari Bathini 2020-07-29 965 if (ret) {
1a1cf93c200581 Hari Bathini 2020-07-29 966 pr_err("Error reserving memory for backup: %s\n",
1a1cf93c200581 Hari Bathini 2020-07-29 967 fdt_strerror(ret));
1a1cf93c200581 Hari Bathini 2020-07-29 968 goto out;
1a1cf93c200581 Hari Bathini 2020-07-29 969 }
7c64e21a1c5a5b Hari Bathini 2020-07-29 970 }
7c64e21a1c5a5b Hari Bathini 2020-07-29 971
6ecd0163d36049 Hari Bathini 2020-07-29 972 /* Update memory reserve map */
6ecd0163d36049 Hari Bathini 2020-07-29 973 ret = get_reserved_memory_ranges(&rmem);
6ecd0163d36049 Hari Bathini 2020-07-29 974 if (ret)
6ecd0163d36049 Hari Bathini 2020-07-29 975 goto out;
6ecd0163d36049 Hari Bathini 2020-07-29 976
6ecd0163d36049 Hari Bathini 2020-07-29 @977 nr_ranges = rmem ? rmem->nr_ranges : 0;
6ecd0163d36049 Hari Bathini 2020-07-29 978 for (i = 0; i < nr_ranges; i++) {
6ecd0163d36049 Hari Bathini 2020-07-29 979 u64 base, size;
6ecd0163d36049 Hari Bathini 2020-07-29 980
6ecd0163d36049 Hari Bathini 2020-07-29 @981 base = rmem->ranges[i].start;
6ecd0163d36049 Hari Bathini 2020-07-29 982 size = rmem->ranges[i].end - base + 1;
6ecd0163d36049 Hari Bathini 2020-07-29 983 ret = fdt_add_mem_rsv(fdt, base, size);
6ecd0163d36049 Hari Bathini 2020-07-29 984 if (ret) {
6ecd0163d36049 Hari Bathini 2020-07-29 985 pr_err("Error updating memory reserve map: %s\n",
6ecd0163d36049 Hari Bathini 2020-07-29 986 fdt_strerror(ret));
6ecd0163d36049 Hari Bathini 2020-07-29 987 goto out;
6ecd0163d36049 Hari Bathini 2020-07-29 988 }
6ecd0163d36049 Hari Bathini 2020-07-29 989 }
6ecd0163d36049 Hari Bathini 2020-07-29 990
7c64e21a1c5a5b Hari Bathini 2020-07-29 991 out:
6ecd0163d36049 Hari Bathini 2020-07-29 992 kfree(rmem);
7c64e21a1c5a5b Hari Bathini 2020-07-29 993 kfree(umem);
7c64e21a1c5a5b Hari Bathini 2020-07-29 994 return ret;
19031275a58812 Hari Bathini 2020-07-29 995 }
19031275a58812 Hari Bathini 2020-07-29 996
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH RFC leds + net-next 2/7] leds: trigger: netdev: simplify the driver by using bit field members
by kernel test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20201030114435.20169-3-kabel(a)kernel.org>
References: <20201030114435.20169-3-kabel(a)kernel.org>
TO: "Marek Behún" <kabel(a)kernel.org>
Hi "Marek,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on cd29296fdfca919590e4004a7e4905544f4c4a32]
url: https://github.com/0day-ci/linux/commits/Marek-Beh-n/netdev-trigger-offlo...
base: cd29296fdfca919590e4004a7e4905544f4c4a32
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: i386-randconfig-m021-20201030 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/leds/trigger/ledtrig-netdev.c:169 netdev_led_attr_show() error: uninitialized symbol 'val'.
vim +/val +169 drivers/leds/trigger/ledtrig-netdev.c
06f502f57d0d772 Ben Whitten 2017-12-10 147
06f502f57d0d772 Ben Whitten 2017-12-10 148 static ssize_t netdev_led_attr_show(struct device *dev, char *buf,
06f502f57d0d772 Ben Whitten 2017-12-10 149 enum netdev_led_attr attr)
06f502f57d0d772 Ben Whitten 2017-12-10 150 {
f8112a1de1a728f Uwe Kleine-König 2018-07-02 151 struct led_netdev_data *trigger_data = led_trigger_get_drvdata(dev);
b83abc371664b0d Marek Behún 2020-10-30 152 int val;
06f502f57d0d772 Ben Whitten 2017-12-10 153
06f502f57d0d772 Ben Whitten 2017-12-10 154 switch (attr) {
06f502f57d0d772 Ben Whitten 2017-12-10 155 case NETDEV_ATTR_LINK:
b83abc371664b0d Marek Behún 2020-10-30 156 val = trigger_data->link;
06f502f57d0d772 Ben Whitten 2017-12-10 157 break;
06f502f57d0d772 Ben Whitten 2017-12-10 158 case NETDEV_ATTR_TX:
b83abc371664b0d Marek Behún 2020-10-30 159 val = trigger_data->tx;
06f502f57d0d772 Ben Whitten 2017-12-10 160 break;
06f502f57d0d772 Ben Whitten 2017-12-10 161 case NETDEV_ATTR_RX:
b83abc371664b0d Marek Behún 2020-10-30 162 val = trigger_data->rx;
06f502f57d0d772 Ben Whitten 2017-12-10 163 break;
06f502f57d0d772 Ben Whitten 2017-12-10 164 default:
b83abc371664b0d Marek Behún 2020-10-30 165 /* unreachable */
b83abc371664b0d Marek Behún 2020-10-30 166 break;
06f502f57d0d772 Ben Whitten 2017-12-10 167 }
06f502f57d0d772 Ben Whitten 2017-12-10 168
b83abc371664b0d Marek Behún 2020-10-30 @169 return sprintf(buf, "%u\n", val);
06f502f57d0d772 Ben Whitten 2017-12-10 170 }
06f502f57d0d772 Ben Whitten 2017-12-10 171
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[linux-next:master 465/2472] drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c:511:39-44: WARNING: conversion to bool not needed here
by kernel test robot
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm(a)kvack.org>
TO: Huang Rui <ray.huang(a)amd.com>
CC: Alex Deucher <alexander.deucher(a)amd.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 4e78c578cb987725eef1cec7d11b6437109e9a49
commit: 4d8d75a45c7ce7f6a0b9dff510be5be8e34febb4 [465/2472] drm/amdgpu: add mmhub v2.3 for vangogh (v4)
:::::: branch date: 10 hours ago
:::::: commit date: 4 weeks ago
config: x86_64-randconfig-c002-20201030 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c:511:39-44: WARNING: conversion to bool not needed here
drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c:513:39-44: WARNING: conversion to bool not needed here
Please review and possibly fold the followup patch.
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months