[ambarus:spi-nor/next-otp-ammend-check-link-err 11/14] drivers/mtd/spi-nor/otp.c:171: undefined reference to `__moddi3'
by kernel test robot
tree: https://github.com/ambarus/linux-0day spi-nor/next-otp-ammend-check-link-err
head: bf51641a17e761b318f490fe04adc7f5359c0d37
commit: 6081b3c35765470cd8188c26cc2497c74bed9a87 [11/14] mtd: spi-nor: add OTP support
config: i386-randconfig-c021-20210330 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/ambarus/linux-0day/commit/6081b3c35765470cd8188c26cc24...
git remote add ambarus https://github.com/ambarus/linux-0day
git fetch --no-tags ambarus spi-nor/next-otp-ammend-check-link-err
git checkout 6081b3c35765470cd8188c26cc2497c74bed9a87
# 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 >>):
ld: drivers/mtd/spi-nor/otp.o: in function `spi_nor_mtd_otp_lock':
>> drivers/mtd/spi-nor/otp.c:171: undefined reference to `__moddi3'
ld: drivers/mtd/spi-nor/otp.o: in function `spi_nor_otp_offset_to_region':
>> drivers/mtd/spi-nor/otp.c:40: undefined reference to `__divdi3'
>> ld: drivers/mtd/spi-nor/otp.c:40: undefined reference to `__divdi3'
vim +171 drivers/mtd/spi-nor/otp.c
37
38 static unsigned int spi_nor_otp_offset_to_region(struct spi_nor *nor, loff_t ofs)
39 {
> 40 return ofs / spi_nor_otp_region_len(nor);
41 }
42
43 static int spi_nor_mtd_otp_info(struct mtd_info *mtd, size_t len,
44 size_t *retlen, struct otp_info *buf)
45 {
46 struct spi_nor *nor = mtd_to_spi_nor(mtd);
47 const struct spi_nor_otp_ops *ops = nor->params->otp.ops;
48 unsigned int n_regions = spi_nor_otp_n_regions(nor);
49 unsigned int i;
50 int ret, locked;
51
52 if (len < n_regions * sizeof(*buf))
53 return -ENOSPC;
54
55 ret = spi_nor_lock_and_prep(nor);
56 if (ret)
57 return ret;
58
59 for (i = 0; i < n_regions; i++) {
60 buf->start = spi_nor_otp_region_to_offset(nor, i);
61 buf->length = spi_nor_otp_region_len(nor);
62
63 locked = ops->is_locked(nor, i);
64 if (locked < 0) {
65 ret = locked;
66 goto out;
67 }
68
69 buf->locked = !!locked;
70 buf++;
71 }
72
73 *retlen = n_regions * sizeof(*buf);
74
75 out:
76 spi_nor_unlock_and_unprep(nor);
77
78 return ret;
79 }
80
81 static int spi_nor_mtd_otp_read_write(struct mtd_info *mtd, loff_t ofs,
82 size_t total_len, size_t *retlen,
83 u8 *buf, bool is_write)
84 {
85 struct spi_nor *nor = mtd_to_spi_nor(mtd);
86 const struct spi_nor_otp_ops *ops = nor->params->otp.ops;
87 const size_t rlen = spi_nor_otp_region_len(nor);
88 loff_t rstart, rofs;
89 unsigned int region;
90 size_t len;
91 int ret;
92
93 if (ofs < 0 || ofs >= spi_nor_otp_size(nor))
94 return 0;
95
96 ret = spi_nor_lock_and_prep(nor);
97 if (ret)
98 return ret;
99
100 /* don't access beyond the end */
101 total_len = min_t(size_t, total_len, spi_nor_otp_size(nor) - ofs);
102
103 *retlen = 0;
104 while (total_len) {
105 /*
106 * The OTP regions are mapped into a contiguous area starting
107 * at 0 as expected by the MTD layer. This will map the MTD
108 * file offsets to the address of an OTP region as used in the
109 * actual SPI commands.
110 */
111 region = spi_nor_otp_offset_to_region(nor, ofs);
112 rstart = spi_nor_otp_region_start(nor, region);
113
114 /*
115 * The size of a OTP region is expected to be a power of two,
116 * thus we can just mask the lower bits and get the offset into
117 * a region.
118 */
119 rofs = ofs & (rlen - 1);
120
121 /* don't access beyond one OTP region */
122 len = min_t(size_t, total_len, rlen - rofs);
123
124 if (is_write)
125 ret = ops->write(nor, rstart + rofs, len, buf);
126 else
127 ret = ops->read(nor, rstart + rofs, len, buf);
128 if (ret == 0)
129 ret = -EIO;
130 if (ret < 0)
131 goto out;
132
133 *retlen += ret;
134 ofs += ret;
135 buf += ret;
136 total_len -= ret;
137 }
138 ret = 0;
139
140 out:
141 spi_nor_unlock_and_unprep(nor);
142 return ret;
143 }
144
145 static int spi_nor_mtd_otp_read(struct mtd_info *mtd, loff_t from, size_t len,
146 size_t *retlen, u8 *buf)
147 {
148 return spi_nor_mtd_otp_read_write(mtd, from, len, retlen, buf, false);
149 }
150
151 static int spi_nor_mtd_otp_write(struct mtd_info *mtd, loff_t to, size_t len,
152 size_t *retlen, u8 *buf)
153 {
154 return spi_nor_mtd_otp_read_write(mtd, to, len, retlen, buf, true);
155 }
156
157 static int spi_nor_mtd_otp_lock(struct mtd_info *mtd, loff_t from, size_t len)
158 {
159 struct spi_nor *nor = mtd_to_spi_nor(mtd);
160 const struct spi_nor_otp_ops *ops = nor->params->otp.ops;
161 unsigned int region;
162 int ret;
163
164 if (from < 0 || (from + len) > spi_nor_otp_size(nor))
165 return -EINVAL;
166
167 /* the user has to explicitly ask for whole regions */
168 if (len % spi_nor_otp_region_len(nor))
169 return -EINVAL;
170
> 171 if (from % spi_nor_otp_region_len(nor))
172 return -EINVAL;
173
174 ret = spi_nor_lock_and_prep(nor);
175 if (ret)
176 return ret;
177
178 while (len) {
179 region = spi_nor_otp_offset_to_region(nor, from);
180 ret = ops->lock(nor, region);
181 if (ret)
182 goto out;
183
184 len -= spi_nor_otp_region_len(nor);
185 from += spi_nor_otp_region_len(nor);
186 }
187
188 out:
189 spi_nor_unlock_and_unprep(nor);
190
191 return ret;
192 }
193
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH nf-next 07/11] netfilter: nf_tables: use net_generic infra for transaction data
by kernel test robot
Hi Florian,
I love your patch! Perhaps something to improve:
[auto build test WARNING on nf-next/master]
url: https://github.com/0day-ci/linux/commits/Florian-Westphal/netfilter-reduc...
base: https://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next.git master
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-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
# https://github.com/0day-ci/linux/commit/8428bea184970c696c6648fc6a1101d84...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Florian-Westphal/netfilter-reduce-struct-net-size/20210401-041324
git checkout 8428bea184970c696c6648fc6a1101d846af5baa
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arc
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 >>):
net/netfilter/nf_tables_api.c: In function 'nf_tables_fill_table_info':
>> net/netfilter/nf_tables_api.c:732:26: warning: variable 'nft_net' set but not used [-Wunused-but-set-variable]
732 | struct nftables_pernet *nft_net;
| ^~~~~~~
vim +/nft_net +732 net/netfilter/nf_tables_api.c
727
728 static int nf_tables_fill_table_info(struct sk_buff *skb, struct net *net,
729 u32 portid, u32 seq, int event, u32 flags,
730 int family, const struct nft_table *table)
731 {
> 732 struct nftables_pernet *nft_net;
733 struct nlmsghdr *nlh;
734
735 event = nfnl_msg_type(NFNL_SUBSYS_NFTABLES, event);
736 nlh = nfnl_msg_put(skb, portid, seq, event, flags, family,
737 NFNETLINK_V0, nft_base_seq(net));
738 if (!nlh)
739 goto nla_put_failure;
740
741 nft_net = net_generic(net, nf_tables_net_id);
742
743 if (nla_put_string(skb, NFTA_TABLE_NAME, table->name) ||
744 nla_put_be32(skb, NFTA_TABLE_FLAGS, htonl(table->flags)) ||
745 nla_put_be32(skb, NFTA_TABLE_USE, htonl(table->use)) ||
746 nla_put_be64(skb, NFTA_TABLE_HANDLE, cpu_to_be64(table->handle),
747 NFTA_TABLE_PAD))
748 goto nla_put_failure;
749 if (nft_table_has_owner(table) &&
750 nla_put_be32(skb, NFTA_TABLE_OWNER, htonl(table->nlpid)))
751 goto nla_put_failure;
752
753 if (table->udata) {
754 if (nla_put(skb, NFTA_TABLE_USERDATA, table->udlen, table->udata))
755 goto nla_put_failure;
756 }
757
758 nlmsg_end(skb, nlh);
759 return 0;
760
761 nla_put_failure:
762 nlmsg_trim(skb, nlh);
763 return -1;
764 }
765
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH v4 2/2] Adding i2c-cp2615: i2c support for Silicon Labs' CP2615 Digital Audio Bridge
by kernel test robot
Hi "Bence,
I love your patch! Yet something to improve:
[auto build test ERROR on wsa/i2c/for-next]
[also build test ERROR on linux/master linus/master v5.12-rc5 next-20210331]
[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/Bence-Cs-k-s/Adding-i2c-cp2615-i...
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-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
# https://github.com/0day-ci/linux/commit/f7bd7e90cde56628778fb121154088af0...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Bence-Cs-k-s/Adding-i2c-cp2615-i2c-support-for-Silicon-Labs-CP2615-Digital-Audio/20210401-030413
git checkout f7bd7e90cde56628778fb121154088af095d3fa8
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
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/i2c/busses/i2c-cp2615.c:323:1: warning: data definition has no type or storage class
323 | MODULE_DEVICE_TABLE(usb, id_table);
| ^~~~~~~~~~~~~~~~~~~
>> drivers/i2c/busses/i2c-cp2615.c:323:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]
drivers/i2c/busses/i2c-cp2615.c:323:1: warning: parameter names (without types) in function declaration
In file included from include/linux/device.h:32,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/i2c/busses/i2c-cp2615.c:9:
include/linux/device/driver.h:263:1: warning: data definition has no type or storage class
263 | module_init(__driver##_init); \
| ^~~~~~~~~~~
include/linux/usb.h:1305:2: note: in expansion of macro 'module_driver'
1305 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: note: in expansion of macro 'module_usb_driver'
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
>> include/linux/device/driver.h:263:1: error: type defaults to 'int' in declaration of 'module_init' [-Werror=implicit-int]
263 | module_init(__driver##_init); \
| ^~~~~~~~~~~
include/linux/usb.h:1305:2: note: in expansion of macro 'module_driver'
1305 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: note: in expansion of macro 'module_usb_driver'
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: warning: parameter names (without types) in function declaration
In file included from include/linux/device.h:32,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/i2c/busses/i2c-cp2615.c:9:
include/linux/device/driver.h:268:1: warning: data definition has no type or storage class
268 | module_exit(__driver##_exit);
| ^~~~~~~~~~~
include/linux/usb.h:1305:2: note: in expansion of macro 'module_driver'
1305 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: note: in expansion of macro 'module_usb_driver'
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
>> include/linux/device/driver.h:268:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int]
268 | module_exit(__driver##_exit);
| ^~~~~~~~~~~
include/linux/usb.h:1305:2: note: in expansion of macro 'module_driver'
1305 | module_driver(__usb_driver, usb_register, \
| ^~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: note: in expansion of macro 'module_usb_driver'
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: warning: parameter names (without types) in function declaration
>> drivers/i2c/busses/i2c-cp2615.c:334:15: error: expected declaration specifiers or '...' before string constant
334 | MODULE_AUTHOR("Bence Csókás <bence98(a)sch.bme.hu>");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:335:20: error: expected declaration specifiers or '...' before string constant
335 | MODULE_DESCRIPTION("CP2615 I2C bus driver");
| ^~~~~~~~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:336:16: error: expected declaration specifiers or '...' before string constant
336 | MODULE_LICENSE("GPL");
| ^~~~~
In file included from include/linux/device.h:32,
from include/linux/acpi.h:15,
from include/linux/i2c.h:13,
from drivers/i2c/busses/i2c-cp2615.c:9:
drivers/i2c/busses/i2c-cp2615.c:332:19: warning: 'cp2615_i2c_driver_exit' defined but not used [-Wunused-function]
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/device/driver.h:264:20: note: in definition of macro 'module_driver'
264 | static void __exit __driver##_exit(void) \
| ^~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: note: in expansion of macro 'module_usb_driver'
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:19: warning: 'cp2615_i2c_driver_init' defined but not used [-Wunused-function]
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
include/linux/device/driver.h:259:19: note: in definition of macro 'module_driver'
259 | static int __init __driver##_init(void) \
| ^~~~~~~~
drivers/i2c/busses/i2c-cp2615.c:332:1: note: in expansion of macro 'module_usb_driver'
332 | module_usb_driver(cp2615_i2c_driver);
| ^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
Kconfig warnings: (for reference only)
WARNING: unmet direct dependencies detected for SND_ATMEL_SOC_PDC
Depends on SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && HAS_DMA
Selected by
- SND_ATMEL_SOC_SSC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC
- SND_ATMEL_SOC_SSC_PDC && SOUND && !UML && SND && SND_SOC && SND_ATMEL_SOC && ATMEL_SSC
vim +323 drivers/i2c/busses/i2c-cp2615.c
322
> 323 MODULE_DEVICE_TABLE(usb, id_table);
324
325 static struct usb_driver cp2615_i2c_driver = {
326 .name = "i2c-cp2615",
327 .probe = cp2615_i2c_probe,
328 .disconnect = cp2615_i2c_remove,
329 .id_table = id_table,
330 };
331
332 module_usb_driver(cp2615_i2c_driver);
333
> 334 MODULE_AUTHOR("Bence Csókás <bence98(a)sch.bme.hu>");
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month
Re: [PATCH] fix NULL pointer deference crash
by Dan Carpenter
Hi Hassan,
url: https://github.com/0day-ci/linux/commits/Hassan-Shahbazi/fix-NULL-pointer...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5e46d1b78a03d52306f21f77a4e4a144b6d31486
config: x86_64-randconfig-m001-20210330 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 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/video/fbdev/core/fbcon.c:1336 fbcon_cursor() warn: variable dereferenced before check 'ops' (see line 1324)
Old smatch warnings:
drivers/video/fbdev/core/fbcon.c:3028 fbcon_get_con2fb_map_ioctl() warn: potential spectre issue 'con2fb_map' [r]
vim +/ops +1336 drivers/video/fbdev/core/fbcon.c
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1318 static void fbcon_cursor(struct vc_data *vc, int mode)
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1319 {
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1320 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1321 struct fbcon_ops *ops = info->fbcon_par;
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1322 int c = scr_readw((u16 *) vc->vc_pos);
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1323
2a17d7e80f1df44 drivers/video/console/fbcon.c Scot Doyle 2015-08-04 @1324 ops->cur_blink_jiffies = msecs_to_jiffies(vc->vc_cur_blink_ms);
2a17d7e80f1df44 drivers/video/console/fbcon.c Scot Doyle 2015-08-04 1325
d1e2306681ad3cb drivers/video/console/fbcon.c Michal Januszewski 2007-05-08 1326 if (fbcon_is_inactive(vc, info) || vc->vc_deccm != 1)
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1327 return;
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1328
c0e4b3ad67997a6 drivers/video/fbdev/core/fbcon.c Jiri Slaby 2020-06-15 1329 if (vc->vc_cursor_type & CUR_SW)
acba9cd01974353 drivers/video/console/fbcon.c Antonino A. Daplas 2007-07-17 1330 fbcon_del_cursor_timer(info);
a5edce421848442 drivers/video/console/fbcon.c Thierry Reding 2015-05-21 1331 else
acba9cd01974353 drivers/video/console/fbcon.c Antonino A. Daplas 2007-07-17 1332 fbcon_add_cursor_timer(info);
acba9cd01974353 drivers/video/console/fbcon.c Antonino A. Daplas 2007-07-17 1333
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1334 ops->cursor_flash = (mode == CM_ERASE) ? 0 : 1;
^^^^^^^^^^^^^^^^^
Dereferenced
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1335
1d73453653c6d4f drivers/video/fbdev/core/fbcon.c Hassan Shahbazi 2021-03-31 @1336 if (ops && ops->cursor)
^^^
Checked too late
06a0df4d1b8b13b drivers/video/fbdev/core/fbcon.c Linus Torvalds 2020-09-08 1337 ops->cursor(vc, info, mode, get_color(vc, info, c, 1),
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1338 get_color(vc, info, c, 0));
^1da177e4c3f415 drivers/video/console/fbcon.c Linus Torvalds 2005-04-16 1339 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 1 month