drivers/firmware/cirrus/cs_dsp.c:1211:2: warning: Value stored to 'adsp1_sizes' is never read [clang-analyzer-deadcode.DeadStores]
by kernel test robot
CC: llvm(a)lists.linux.dev
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Simon Trimmer <simont(a)opensource.cirrus.com>
CC: Mark Brown <broonie(a)kernel.org>
CC: Charles Keepax <ckeepax(a)opensource.cirrus.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e729dbe8ea1c6145ae7b9efd6a00a5613746d3b0
commit: f6bc909e7673c30abcbdb329e7d0aa2e83c103d7 firmware: cs_dsp: add driver to support firmware loading on Cirrus Logic DSPs
date: 6 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 6 months ago
config: mips-randconfig-c004-20220331 (https://download.01.org/0day-ci/archive/20220401/202204010650.0w4OEiqY-lk...)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 0f6d9501cf49ce02937099350d08f20c4af86f3d)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
# 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 f6bc909e7673c30abcbdb329e7d0aa2e83c103d7
# save the config file to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
^
include/linux/uaccess.h:193:2: note: Returning zero (loaded from 'n'), which participates in a condition later
return n;
^~~~~~~~
drivers/hwtracing/stm/core.c:736:6: note: Returning from 'copy_from_user'
if (copy_from_user(&size, arg, sizeof(size)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hwtracing/stm/core.c:736:2: note: Taking false branch
if (copy_from_user(&size, arg, sizeof(size)))
^
drivers/hwtracing/stm/core.c:739:11: note: The left operand of '<' is a garbage value
if (size < sizeof(*id) || size >= PATH_MAX + sizeof(*id))
~~~~ ^
drivers/hwtracing/stm/core.c:821:10: warning: 5th function call argument is an uninitialized value [clang-analyzer-core.CallAndMessage]
err = stm_data->set_options(stm_data,
^
drivers/hwtracing/stm/core.c:803:2: note: 'options' declared without an initial value
u64 options;
^~~~~~~~~~~
drivers/hwtracing/stm/core.c:805:2: note: Control jumps to 'case 2148017410:' at line 816
switch (cmd) {
^
drivers/hwtracing/stm/core.c:817:7: note: Calling 'copy_from_user'
if (copy_from_user(&options, (u64 __user *)arg, sizeof(u64)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:191:2: note: Taking true branch
if (likely(check_copy_size(to, n, false)))
^
include/linux/uaccess.h:192:7: note: Calling '_copy_from_user'
n = _copy_from_user(to, from, n);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:157:7: note: Calling 'should_fail_usercopy'
if (!should_fail_usercopy() && likely(access_ok(from, n))) {
^~~~~~~~~~~~~~~~~~~~~~
include/linux/fault-inject-usercopy.h:18:49: note: Returning zero, which participates in a condition later
static inline bool should_fail_usercopy(void) { return false; }
^~~~~~~~~~~~
include/linux/uaccess.h:157:7: note: Returning from 'should_fail_usercopy'
if (!should_fail_usercopy() && likely(access_ok(from, n))) {
^~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:157:6: note: Left side of '&&' is true
if (!should_fail_usercopy() && likely(access_ok(from, n))) {
^
include/linux/uaccess.h:157:2: note: Taking true branch
if (!should_fail_usercopy() && likely(access_ok(from, n))) {
^
include/linux/uaccess.h:159:9: note: Calling 'raw_copy_from_user'
res = raw_copy_from_user(to, from, n);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/include/asm/uaccess.h:455:2: note: Returning without writing to '*to'
return __cu_len_r;
^
include/linux/uaccess.h:159:9: note: Returning from 'raw_copy_from_user'
res = raw_copy_from_user(to, from, n);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:161:6: note: Assuming 'res' is 0, which participates in a condition later
if (unlikely(res))
^
include/linux/compiler.h:78:40: note: expanded from macro 'unlikely'
# define unlikely(x) __builtin_expect(!!(x), 0)
^~~~
include/linux/uaccess.h:161:2: note: Taking false branch
if (unlikely(res))
^
include/linux/uaccess.h:163:2: note: Returning without writing to '*to'
return res;
^
include/linux/uaccess.h:163:2: note: Returning zero (loaded from 'res'), which participates in a condition later
return res;
^~~~~~~~~~
include/linux/uaccess.h:192:7: note: Returning from '_copy_from_user'
n = _copy_from_user(to, from, n);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/uaccess.h:193:2: note: Returning without writing to '*to'
return n;
^
include/linux/uaccess.h:193:2: note: Returning zero (loaded from 'n'), which participates in a condition later
return n;
^~~~~~~~
drivers/hwtracing/stm/core.c:817:7: note: Returning from 'copy_from_user'
if (copy_from_user(&options, (u64 __user *)arg, sizeof(u64)))
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/hwtracing/stm/core.c:817:3: note: Taking false branch
if (copy_from_user(&options, (u64 __user *)arg, sizeof(u64)))
^
drivers/hwtracing/stm/core.c:820:7: note: Assuming field 'set_options' is non-null
if (stm_data->set_options)
^~~~~~~~~~~~~~~~~~~~~
drivers/hwtracing/stm/core.c:820:3: note: Taking true branch
if (stm_data->set_options)
^
drivers/hwtracing/stm/core.c:821:10: note: 5th function call argument is an uninitialized value
err = stm_data->set_options(stm_data,
^
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
4 warnings generated.
Suppressed 4 warnings (4 in non-user code).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
9 warnings generated.
>> drivers/firmware/cirrus/cs_dsp.c:1211:2: warning: Value stored to 'adsp1_sizes' is never read [clang-analyzer-deadcode.DeadStores]
adsp1_sizes = (void *)&firmware->data[pos];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/cirrus/cs_dsp.c:1211:2: note: Value stored to 'adsp1_sizes' is never read
adsp1_sizes = (void *)&firmware->data[pos];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/firmware/cirrus/cs_dsp.c:1227:2: warning: Value stored to 'adsp2_sizes' is never read [clang-analyzer-deadcode.DeadStores]
adsp2_sizes = (void *)&firmware->data[pos];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/cirrus/cs_dsp.c:1227:2: note: Value stored to 'adsp2_sizes' is never read
adsp2_sizes = (void *)&firmware->data[pos];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> drivers/firmware/cirrus/cs_dsp.c:1312:2: warning: Value stored to 'footer' is never read [clang-analyzer-deadcode.DeadStores]
footer = (void *)&firmware->data[pos];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/cirrus/cs_dsp.c:1312:2: note: Value stored to 'footer' is never read
footer = (void *)&firmware->data[pos];
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/list.h:135:13: warning: Use of memory after it is freed [clang-analyzer-unix.Malloc]
__list_del(entry->prev, entry->next);
^
drivers/firmware/cirrus/cs_dsp.c:2759:2: note: Loop condition is true. Entering loop body
while (!list_empty(&dsp->ctl_list)) {
^
drivers/firmware/cirrus/cs_dsp.c:2760:9: note: Left side of '&&' is false
ctl = list_first_entry(&dsp->ctl_list, struct cs_dsp_coeff_ctl, list);
^
include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
list_entry((ptr)->next, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/firmware/cirrus/cs_dsp.c:2760:9: note: Taking false branch
ctl = list_first_entry(&dsp->ctl_list, struct cs_dsp_coeff_ctl, list);
^
include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
list_entry((ptr)->next, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:302:3: note: expanded from macro '__compiletime_assert'
if (!(condition)) \
^
drivers/firmware/cirrus/cs_dsp.c:2760:9: note: Loop condition is false. Exiting loop
ctl = list_first_entry(&dsp->ctl_list, struct cs_dsp_coeff_ctl, list);
^
include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
list_entry((ptr)->next, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
include/linux/compiler_types.h:322:2: note: expanded from macro 'compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
^
include/linux/compiler_types.h:310:2: note: expanded from macro '_compiletime_assert'
__compiletime_assert(condition, msg, prefix, suffix)
^
include/linux/compiler_types.h:300:2: note: expanded from macro '__compiletime_assert'
do { \
^
drivers/firmware/cirrus/cs_dsp.c:2762:7: note: Assuming field 'control_remove' is null
if (dsp->client_ops->control_remove)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/cirrus/cs_dsp.c:2762:3: note: Taking false branch
if (dsp->client_ops->control_remove)
^
drivers/firmware/cirrus/cs_dsp.c:2766:3: note: Calling 'cs_dsp_free_ctl_blk'
cs_dsp_free_ctl_blk(ctl);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/cirrus/cs_dsp.c:907:2: note: Memory is released
kfree(ctl);
^~~~~~~~~~
drivers/firmware/cirrus/cs_dsp.c:2766:3: note: Returning; memory was released
cs_dsp_free_ctl_blk(ctl);
^~~~~~~~~~~~~~~~~~~~~~~~
drivers/firmware/cirrus/cs_dsp.c:2759:2: note: Loop condition is true. Entering loop body
while (!list_empty(&dsp->ctl_list)) {
^
drivers/firmware/cirrus/cs_dsp.c:2760:9: note: Left side of '&&' is false
ctl = list_first_entry(&dsp->ctl_list, struct cs_dsp_coeff_ctl, list);
^
include/linux/list.h:522:2: note: expanded from macro 'list_first_entry'
list_entry((ptr)->next, type, member)
^
include/linux/list.h:511:2: note: expanded from macro 'list_entry'
container_of(ptr, type, member)
^
include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^
drivers/firmware/cirrus/cs_dsp.c:2760:9: note: Taking false branch
ctl = list_first_entry(&dsp->ctl_list, struct cs_dsp_coeff_ctl, list);
^
vim +/adsp1_sizes +1211 drivers/firmware/cirrus/cs_dsp.c
f6bc909e7673c3 Simon Trimmer 2021-09-13 1203
f6bc909e7673c3 Simon Trimmer 2021-09-13 1204 static unsigned int cs_dsp_adsp1_parse_sizes(struct cs_dsp *dsp,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1205 const char * const file,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1206 unsigned int pos,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1207 const struct firmware *firmware)
f6bc909e7673c3 Simon Trimmer 2021-09-13 1208 {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1209 const struct wmfw_adsp1_sizes *adsp1_sizes;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1210
f6bc909e7673c3 Simon Trimmer 2021-09-13 @1211 adsp1_sizes = (void *)&firmware->data[pos];
f6bc909e7673c3 Simon Trimmer 2021-09-13 1212
f6bc909e7673c3 Simon Trimmer 2021-09-13 1213 cs_dsp_dbg(dsp, "%s: %d DM, %d PM, %d ZM\n", file,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1214 le32_to_cpu(adsp1_sizes->dm), le32_to_cpu(adsp1_sizes->pm),
f6bc909e7673c3 Simon Trimmer 2021-09-13 1215 le32_to_cpu(adsp1_sizes->zm));
f6bc909e7673c3 Simon Trimmer 2021-09-13 1216
f6bc909e7673c3 Simon Trimmer 2021-09-13 1217 return pos + sizeof(*adsp1_sizes);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1218 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1219
f6bc909e7673c3 Simon Trimmer 2021-09-13 1220 static unsigned int cs_dsp_adsp2_parse_sizes(struct cs_dsp *dsp,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1221 const char * const file,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1222 unsigned int pos,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1223 const struct firmware *firmware)
f6bc909e7673c3 Simon Trimmer 2021-09-13 1224 {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1225 const struct wmfw_adsp2_sizes *adsp2_sizes;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1226
f6bc909e7673c3 Simon Trimmer 2021-09-13 @1227 adsp2_sizes = (void *)&firmware->data[pos];
f6bc909e7673c3 Simon Trimmer 2021-09-13 1228
f6bc909e7673c3 Simon Trimmer 2021-09-13 1229 cs_dsp_dbg(dsp, "%s: %d XM, %d YM %d PM, %d ZM\n", file,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1230 le32_to_cpu(adsp2_sizes->xm), le32_to_cpu(adsp2_sizes->ym),
f6bc909e7673c3 Simon Trimmer 2021-09-13 1231 le32_to_cpu(adsp2_sizes->pm), le32_to_cpu(adsp2_sizes->zm));
f6bc909e7673c3 Simon Trimmer 2021-09-13 1232
f6bc909e7673c3 Simon Trimmer 2021-09-13 1233 return pos + sizeof(*adsp2_sizes);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1234 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1235
f6bc909e7673c3 Simon Trimmer 2021-09-13 1236 static bool cs_dsp_validate_version(struct cs_dsp *dsp, unsigned int version)
f6bc909e7673c3 Simon Trimmer 2021-09-13 1237 {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1238 switch (version) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1239 case 0:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1240 cs_dsp_warn(dsp, "Deprecated file format %d\n", version);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1241 return true;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1242 case 1:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1243 case 2:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1244 return true;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1245 default:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1246 return false;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1247 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1248 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1249
f6bc909e7673c3 Simon Trimmer 2021-09-13 1250 static bool cs_dsp_halo_validate_version(struct cs_dsp *dsp, unsigned int version)
f6bc909e7673c3 Simon Trimmer 2021-09-13 1251 {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1252 switch (version) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1253 case 3:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1254 return true;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1255 default:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1256 return false;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1257 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1258 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1259
f6bc909e7673c3 Simon Trimmer 2021-09-13 1260 static int cs_dsp_load(struct cs_dsp *dsp, const struct firmware *firmware,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1261 const char *file)
f6bc909e7673c3 Simon Trimmer 2021-09-13 1262 {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1263 LIST_HEAD(buf_list);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1264 struct regmap *regmap = dsp->regmap;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1265 unsigned int pos = 0;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1266 const struct wmfw_header *header;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1267 const struct wmfw_adsp1_sizes *adsp1_sizes;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1268 const struct wmfw_footer *footer;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1269 const struct wmfw_region *region;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1270 const struct cs_dsp_region *mem;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1271 const char *region_name;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1272 char *text = NULL;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1273 struct cs_dsp_buf *buf;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1274 unsigned int reg;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1275 int regions = 0;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1276 int ret, offset, type;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1277
f6bc909e7673c3 Simon Trimmer 2021-09-13 1278 ret = -EINVAL;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1279
f6bc909e7673c3 Simon Trimmer 2021-09-13 1280 pos = sizeof(*header) + sizeof(*adsp1_sizes) + sizeof(*footer);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1281 if (pos >= firmware->size) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1282 cs_dsp_err(dsp, "%s: file too short, %zu bytes\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1283 file, firmware->size);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1284 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1285 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1286
f6bc909e7673c3 Simon Trimmer 2021-09-13 1287 header = (void *)&firmware->data[0];
f6bc909e7673c3 Simon Trimmer 2021-09-13 1288
f6bc909e7673c3 Simon Trimmer 2021-09-13 1289 if (memcmp(&header->magic[0], "WMFW", 4) != 0) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1290 cs_dsp_err(dsp, "%s: invalid magic\n", file);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1291 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1292 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1293
f6bc909e7673c3 Simon Trimmer 2021-09-13 1294 if (!dsp->ops->validate_version(dsp, header->ver)) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1295 cs_dsp_err(dsp, "%s: unknown file format %d\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1296 file, header->ver);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1297 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1298 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1299
f6bc909e7673c3 Simon Trimmer 2021-09-13 1300 cs_dsp_info(dsp, "Firmware version: %d\n", header->ver);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1301 dsp->fw_ver = header->ver;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1302
f6bc909e7673c3 Simon Trimmer 2021-09-13 1303 if (header->core != dsp->type) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1304 cs_dsp_err(dsp, "%s: invalid core %d != %d\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1305 file, header->core, dsp->type);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1306 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1307 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1308
f6bc909e7673c3 Simon Trimmer 2021-09-13 1309 pos = sizeof(*header);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1310 pos = dsp->ops->parse_sizes(dsp, file, pos, firmware);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1311
f6bc909e7673c3 Simon Trimmer 2021-09-13 @1312 footer = (void *)&firmware->data[pos];
f6bc909e7673c3 Simon Trimmer 2021-09-13 1313 pos += sizeof(*footer);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1314
f6bc909e7673c3 Simon Trimmer 2021-09-13 1315 if (le32_to_cpu(header->len) != pos) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1316 cs_dsp_err(dsp, "%s: unexpected header length %d\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1317 file, le32_to_cpu(header->len));
f6bc909e7673c3 Simon Trimmer 2021-09-13 1318 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1319 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1320
f6bc909e7673c3 Simon Trimmer 2021-09-13 1321 cs_dsp_dbg(dsp, "%s: timestamp %llu\n", file,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1322 le64_to_cpu(footer->timestamp));
f6bc909e7673c3 Simon Trimmer 2021-09-13 1323
f6bc909e7673c3 Simon Trimmer 2021-09-13 1324 while (pos < firmware->size &&
f6bc909e7673c3 Simon Trimmer 2021-09-13 1325 sizeof(*region) < firmware->size - pos) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1326 region = (void *)&(firmware->data[pos]);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1327 region_name = "Unknown";
f6bc909e7673c3 Simon Trimmer 2021-09-13 1328 reg = 0;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1329 text = NULL;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1330 offset = le32_to_cpu(region->offset) & 0xffffff;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1331 type = be32_to_cpu(region->type) & 0xff;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1332
f6bc909e7673c3 Simon Trimmer 2021-09-13 1333 switch (type) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1334 case WMFW_NAME_TEXT:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1335 region_name = "Firmware name";
f6bc909e7673c3 Simon Trimmer 2021-09-13 1336 text = kzalloc(le32_to_cpu(region->len) + 1,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1337 GFP_KERNEL);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1338 break;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1339 case WMFW_ALGORITHM_DATA:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1340 region_name = "Algorithm";
f6bc909e7673c3 Simon Trimmer 2021-09-13 1341 ret = cs_dsp_parse_coeff(dsp, region);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1342 if (ret != 0)
f6bc909e7673c3 Simon Trimmer 2021-09-13 1343 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1344 break;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1345 case WMFW_INFO_TEXT:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1346 region_name = "Information";
f6bc909e7673c3 Simon Trimmer 2021-09-13 1347 text = kzalloc(le32_to_cpu(region->len) + 1,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1348 GFP_KERNEL);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1349 break;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1350 case WMFW_ABSOLUTE:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1351 region_name = "Absolute";
f6bc909e7673c3 Simon Trimmer 2021-09-13 1352 reg = offset;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1353 break;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1354 case WMFW_ADSP1_PM:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1355 case WMFW_ADSP1_DM:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1356 case WMFW_ADSP2_XM:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1357 case WMFW_ADSP2_YM:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1358 case WMFW_ADSP1_ZM:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1359 case WMFW_HALO_PM_PACKED:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1360 case WMFW_HALO_XM_PACKED:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1361 case WMFW_HALO_YM_PACKED:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1362 mem = cs_dsp_find_region(dsp, type);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1363 if (!mem) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1364 cs_dsp_err(dsp, "No region of type: %x\n", type);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1365 ret = -EINVAL;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1366 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1367 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1368
f6bc909e7673c3 Simon Trimmer 2021-09-13 1369 region_name = cs_dsp_mem_region_name(type);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1370 reg = dsp->ops->region_to_reg(mem, offset);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1371 break;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1372 default:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1373 cs_dsp_warn(dsp,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1374 "%s.%d: Unknown region type %x at %d(%x)\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1375 file, regions, type, pos, pos);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1376 break;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1377 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1378
f6bc909e7673c3 Simon Trimmer 2021-09-13 1379 cs_dsp_dbg(dsp, "%s.%d: %d bytes at %d in %s\n", file,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1380 regions, le32_to_cpu(region->len), offset,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1381 region_name);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1382
f6bc909e7673c3 Simon Trimmer 2021-09-13 1383 if (le32_to_cpu(region->len) >
f6bc909e7673c3 Simon Trimmer 2021-09-13 1384 firmware->size - pos - sizeof(*region)) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1385 cs_dsp_err(dsp,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1386 "%s.%d: %s region len %d bytes exceeds file length %zu\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1387 file, regions, region_name,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1388 le32_to_cpu(region->len), firmware->size);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1389 ret = -EINVAL;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1390 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1391 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1392
f6bc909e7673c3 Simon Trimmer 2021-09-13 1393 if (text) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1394 memcpy(text, region->data, le32_to_cpu(region->len));
f6bc909e7673c3 Simon Trimmer 2021-09-13 1395 cs_dsp_info(dsp, "%s: %s\n", file, text);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1396 kfree(text);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1397 text = NULL;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1398 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1399
f6bc909e7673c3 Simon Trimmer 2021-09-13 1400 if (reg) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1401 buf = cs_dsp_buf_alloc(region->data,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1402 le32_to_cpu(region->len),
f6bc909e7673c3 Simon Trimmer 2021-09-13 1403 &buf_list);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1404 if (!buf) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1405 cs_dsp_err(dsp, "Out of memory\n");
f6bc909e7673c3 Simon Trimmer 2021-09-13 1406 ret = -ENOMEM;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1407 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1408 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1409
f6bc909e7673c3 Simon Trimmer 2021-09-13 1410 ret = regmap_raw_write_async(regmap, reg, buf->buf,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1411 le32_to_cpu(region->len));
f6bc909e7673c3 Simon Trimmer 2021-09-13 1412 if (ret != 0) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1413 cs_dsp_err(dsp,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1414 "%s.%d: Failed to write %d bytes at %d in %s: %d\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1415 file, regions,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1416 le32_to_cpu(region->len), offset,
f6bc909e7673c3 Simon Trimmer 2021-09-13 1417 region_name, ret);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1418 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1419 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1420 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1421
f6bc909e7673c3 Simon Trimmer 2021-09-13 1422 pos += le32_to_cpu(region->len) + sizeof(*region);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1423 regions++;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1424 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1425
f6bc909e7673c3 Simon Trimmer 2021-09-13 1426 ret = regmap_async_complete(regmap);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1427 if (ret != 0) {
f6bc909e7673c3 Simon Trimmer 2021-09-13 1428 cs_dsp_err(dsp, "Failed to complete async write: %d\n", ret);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1429 goto out_fw;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1430 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1431
f6bc909e7673c3 Simon Trimmer 2021-09-13 1432 if (pos > firmware->size)
f6bc909e7673c3 Simon Trimmer 2021-09-13 1433 cs_dsp_warn(dsp, "%s.%d: %zu bytes at end of file\n",
f6bc909e7673c3 Simon Trimmer 2021-09-13 1434 file, regions, pos - firmware->size);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1435
f6bc909e7673c3 Simon Trimmer 2021-09-13 1436 cs_dsp_debugfs_save_wmfwname(dsp, file);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1437
f6bc909e7673c3 Simon Trimmer 2021-09-13 1438 out_fw:
f6bc909e7673c3 Simon Trimmer 2021-09-13 1439 regmap_async_complete(regmap);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1440 cs_dsp_buf_free(&buf_list);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1441 kfree(text);
f6bc909e7673c3 Simon Trimmer 2021-09-13 1442
f6bc909e7673c3 Simon Trimmer 2021-09-13 1443 return ret;
f6bc909e7673c3 Simon Trimmer 2021-09-13 1444 }
f6bc909e7673c3 Simon Trimmer 2021-09-13 1445
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
drivers/gpio/gpio-sim.c:839:2: warning: There is an unknown macro here somewhere. Configuration is required. If fwnode_for_each_child_node is a macro then please configure it. [unknownMacro]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Bartosz Golaszewski <brgl(a)bgdev.pl>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: cb8c474e79be458f58e9df073f51ca159f3a2aa0 gpio: sim: new testing module
date: 3 months ago
:::::: branch date: 23 hours ago
:::::: commit date: 3 months ago
compiler: ia64-linux-gcc (GCC) 11.2.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)
>> drivers/gpio/gpiolib-acpi.c:252:2: warning: There is an unknown macro here somewhere. Configuration is required. If list_for_each_entry is a macro then please configure it. [unknownMacro]
list_for_each_entry(event, &acpi_gpio->events, node)
^
--
>> drivers/gpio/gpio-sim.c:839:2: warning: There is an unknown macro here somewhere. Configuration is required. If fwnode_for_each_child_node is a macro then please configure it. [unknownMacro]
fwnode_for_each_child_node(swnode, child)
^
vim +839 drivers/gpio/gpio-sim.c
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 834
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 835 static void gpio_sim_remove_swnode_recursive(struct fwnode_handle *swnode)
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 836 {
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 837 struct fwnode_handle *child;
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 838
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 @839 fwnode_for_each_child_node(swnode, child)
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 840 fwnode_remove_software_node(child);
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 841
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 842 fwnode_remove_software_node(swnode);
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 843 }
cb8c474e79be45 Bartosz Golaszewski 2021-12-07 844
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
kernel/bpf/btf.c:6357:1: warning: There is an unknown macro here somewhere. Configuration is required. If BTF_ID_LIST_GLOBAL is a macro then please configure it. [unknownMacro]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Song Liu <songliubraving(a)fb.com>
CC: Alexei Starovoitov <ast(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: e729dbe8ea1c6145ae7b9efd6a00a5613746d3b0
commit: d19ddb476a539fd78ad1028ae13bb38506286931 bpf: Introduce btf_tracing_ids
date: 5 months ago
:::::: branch date: 2 hours ago
:::::: commit date: 5 months ago
compiler: or1k-linux-gcc (GCC) 11.2.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
cppcheck warnings: (new ones prefixed by >>)
>> net/core/rtnetlink.c:5220:9: warning: Local variable 'err' shadows outer variable [shadowVariable]
int err;
^
net/core/rtnetlink.c:5120:6: note: Shadowed declaration
int err;
^
net/core/rtnetlink.c:5220:9: note: Shadow variable
int err;
^
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> net/core/rtnetlink.c:4846:6: warning: Redundant initialization for 'err'. The initialized value is overwritten before it is read. [redundantInitialization]
err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0, 0);
^
net/core/rtnetlink.c:4835:10: note: err is initialized
int err = -EOPNOTSUPP;
^
net/core/rtnetlink.c:4846:6: note: err is overwritten
err = dev->netdev_ops->ndo_bridge_getlink(skb, 0, 0, dev, 0, 0);
^
>> net/core/rtnetlink.c:2238:52: warning: Parameter 'tb' can be declared with const [constParameter]
static int rtnl_ensure_unique_netns(struct nlattr *tb[],
^
--
>> kernel/bpf/btf.c:6357:1: warning: There is an unknown macro here somewhere. Configuration is required. If BTF_ID_LIST_GLOBAL is a macro then please configure it. [unknownMacro]
BTF_ID_LIST_GLOBAL(btf_tracing_ids, MAX_BTF_TRACING_TYPE)
^
--
>> net/core/dev.c:1651:2: warning: There is an unknown macro here somewhere. Configuration is required. If netdev_for_each_lower_dev is a macro then please configure it. [unknownMacro]
netdev_for_each_lower_dev(dev, lower_dev, iter)
^
vim +6357 kernel/bpf/btf.c
eb529c5b10b940 Daniel Xu 2021-08-25 6356
d19ddb476a539f Song Liu 2021-11-12 @6357 BTF_ID_LIST_GLOBAL(btf_tracing_ids, MAX_BTF_TRACING_TYPE)
d19ddb476a539f Song Liu 2021-11-12 6358 #define BTF_TRACING_TYPE(name, type) BTF_ID(struct, type)
d19ddb476a539f Song Liu 2021-11-12 6359 BTF_TRACING_TYPE_xxx
d19ddb476a539f Song Liu 2021-11-12 6360 #undef BTF_TRACING_TYPE
14f267d95fe4b0 Kumar Kartikeya Dwivedi 2021-10-02 6361
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
fs/erofs/zdata.c:767 z_erofs_do_read_page() error: we previously assumed 'fe->cl' could be null (see line 666)
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Gao Xiang <hsiangkao(a)linux.alibaba.com>
CC: Yue Hu <huyue2(a)coolpad.com>
CC: Chao Yu <yuchao0(a)huawei.com>, Chao Yu <chao(a)kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 5c6dcc57e2e50553405f2cf8b949f99b8820a685 erofs: get rid of `struct z_erofs_collector'
date: 2 weeks ago
:::::: branch date: 22 hours ago
:::::: commit date: 2 weeks ago
config: riscv-randconfig-m031-20220327 (https://download.01.org/0day-ci/archive/20220401/202204010444.7WZ3LNx4-lk...)
compiler: riscv32-linux-gcc (GCC) 11.2.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:
fs/erofs/zdata.c:767 z_erofs_do_read_page() error: we previously assumed 'fe->cl' could be null (see line 666)
Old smatch warnings:
fs/erofs/zdata.c:471 z_erofs_register_collection() warn: passing a valid pointer to 'PTR_ERR'
fs/erofs/zdata.c:1244 jobqueueset_init() warn: maybe use && instead of &
vim +767 fs/erofs/zdata.c
92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 639
97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 640 static int z_erofs_do_read_page(struct z_erofs_decompress_frontend *fe,
eaa9172ad988b3 fs/erofs/zdata.c Gao Xiang 2021-10-22 641 struct page *page, struct page **pagepool)
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 642 {
97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 643 struct inode *const inode = fe->inode;
bda17a4577da72 fs/erofs/zdata.c Gao Xiang 2019-10-08 644 struct erofs_sb_info *const sbi = EROFS_I_SB(inode);
3b423417d0d1d5 drivers/staging/erofs/unzip_vle.c Chao Yu 2019-01-15 645 struct erofs_map_blocks *const map = &fe->map;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 646 const loff_t offset = page_offset(page);
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 647 bool tight = true;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 648
92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 649 enum z_erofs_cache_alloctype cache_strategy;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 650 enum z_erofs_page_type page_type;
7dd68b147d60e5 drivers/staging/erofs/unzip_vle.c Thomas Weißschuh 2018-09-10 651 unsigned int cur, end, spiltted, index;
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 652 int err = 0;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 653
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 654 /* register locked file pages as online pages in pack */
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 655 z_erofs_onlinepage_init(page);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 656
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 657 spiltted = 0;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 658 end = PAGE_SIZE;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 659 repeat:
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 660 cur = end - 1;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 661
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 662 /* lucky, within the range of the current map_blocks */
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 663 if (offset + cur >= map->m_la &&
1e5ceeab692958 drivers/staging/erofs/unzip_vle.c Gao Xiang 2019-02-27 664 offset + cur < map->m_la + map->m_llen) {
97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 665 /* didn't get a valid collection previously (very rare) */
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 @666 if (!fe->cl)
1e5ceeab692958 drivers/staging/erofs/unzip_vle.c Gao Xiang 2019-02-27 667 goto restart_now;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 668 goto hitted;
1e5ceeab692958 drivers/staging/erofs/unzip_vle.c Gao Xiang 2019-02-27 669 }
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 670
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 671 /* go ahead the next map_blocks */
4f761fa253b49f fs/erofs/zdata.c Gao Xiang 2019-09-04 672 erofs_dbg("%s: [out-of-range] pos %llu", __func__, offset + cur);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 673
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 674 if (z_erofs_collector_end(fe))
f0c519fc2679ca drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-11-23 675 fe->backmost = false;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 676
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 677 map->m_la = offset + cur;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 678 map->m_llen = 0;
97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 679 err = z_erofs_map_blocks_iter(inode, map, 0);
8d8a09b093d707 fs/erofs/zdata.c Gao Xiang 2019-08-30 680 if (err)
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 681 goto err_out;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 682
1e5ceeab692958 drivers/staging/erofs/unzip_vle.c Gao Xiang 2019-02-27 683 restart_now:
8d8a09b093d707 fs/erofs/zdata.c Gao Xiang 2019-08-30 684 if (!(map->m_flags & EROFS_MAP_MAPPED))
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 685 goto hitted;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 686
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 687 err = z_erofs_collector_begin(fe, inode, map);
8d8a09b093d707 fs/erofs/zdata.c Gao Xiang 2019-08-30 688 if (err)
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 689 goto err_out;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 690
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 691 if (z_erofs_is_inline_pcluster(fe->pcl)) {
09c543798c3cde fs/erofs/zdata.c Gao Xiang 2022-01-02 692 void *mp;
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 693
09c543798c3cde fs/erofs/zdata.c Gao Xiang 2022-01-02 694 mp = erofs_read_metabuf(&fe->map.buf, inode->i_sb,
09c543798c3cde fs/erofs/zdata.c Gao Xiang 2022-01-02 695 erofs_blknr(map->m_pa), EROFS_NO_KMAP);
09c543798c3cde fs/erofs/zdata.c Gao Xiang 2022-01-02 696 if (IS_ERR(mp)) {
09c543798c3cde fs/erofs/zdata.c Gao Xiang 2022-01-02 697 err = PTR_ERR(mp);
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 698 erofs_err(inode->i_sb,
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 699 "failed to get inline page, err %d", err);
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 700 goto err_out;
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 701 }
09c543798c3cde fs/erofs/zdata.c Gao Xiang 2022-01-02 702 get_page(fe->map.buf.page);
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 703 WRITE_ONCE(fe->pcl->compressed_pages[0], fe->map.buf.page);
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 704 fe->mode = COLLECT_PRIMARY_FOLLOWED_NOINPLACE;
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 705 } else {
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 706 /* preload all compressed pages (can change mode if needed) */
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 707 if (should_alloc_managed_pages(fe, sbi->opt.cache_strategy,
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 708 map->m_la))
1825c8d7ce93c4 fs/erofs/zdata.c Gao Xiang 2020-12-09 709 cache_strategy = TRYALLOC;
92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 710 else
92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 711 cache_strategy = DONTALLOC;
92e6efd566c4a1 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-12-08 712
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 713 preload_compressed_pages(fe, MNGD_MAPPING(sbi),
1825c8d7ce93c4 fs/erofs/zdata.c Gao Xiang 2020-12-09 714 cache_strategy, pagepool);
cecf864d3d76d5 fs/erofs/zdata.c Yue Hu 2021-12-29 715 }
105d4ad857dcbf drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 716
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 717 hitted:
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 718 /*
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 719 * Ensure the current partial page belongs to this submit chain rather
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 720 * than other concurrent submit chains or the noio(bypass) chain since
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 721 * those chains are handled asynchronously thus the page cannot be used
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 722 * for inplace I/O or pagevec (should be processed in strict order.)
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 723 */
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 724 tight &= (fe->mode >= COLLECT_PRIMARY_HOOKED &&
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 725 fe->mode != COLLECT_PRIMARY_FOLLOWED_NOINPLACE);
dc76ea8c1087b5 fs/erofs/zdata.c Gao Xiang 2019-09-22 726
7dd68b147d60e5 drivers/staging/erofs/unzip_vle.c Thomas Weißschuh 2018-09-10 727 cur = end - min_t(unsigned int, offset + end - map->m_la, end);
8d8a09b093d707 fs/erofs/zdata.c Gao Xiang 2019-08-30 728 if (!(map->m_flags & EROFS_MAP_MAPPED)) {
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 729 zero_user_segment(page, cur, end);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 730 goto next_part;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 731 }
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 732
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 733 /* let's derive page type */
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 734 page_type = cur ? Z_EROFS_VLE_PAGE_TYPE_HEAD :
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 735 (!spiltted ? Z_EROFS_PAGE_TYPE_EXCLUSIVE :
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 736 (tight ? Z_EROFS_PAGE_TYPE_EXCLUSIVE :
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 737 Z_EROFS_VLE_PAGE_TYPE_TAIL_SHARED));
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 738
a112152f6f3a2a drivers/staging/erofs/unzip_vle.c Gao Xiang 2019-02-27 739 if (cur)
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 740 tight &= (fe->mode >= COLLECT_PRIMARY_FOLLOWED);
a112152f6f3a2a drivers/staging/erofs/unzip_vle.c Gao Xiang 2019-02-27 741
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 742 retry:
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 743 err = z_erofs_attach_page(fe, page, page_type,
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 744 fe->mode >= COLLECT_PRIMARY_FOLLOWED);
6aaa7b0664e688 fs/erofs/zdata.c Gao Xiang 2020-12-08 745 /* should allocate an additional short-lived page for pagevec */
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 746 if (err == -EAGAIN) {
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 747 struct page *const newpage =
e3f78d5e7e6b08 fs/erofs/zdata.c Chao Yu 2020-09-17 748 alloc_page(GFP_NOFS | __GFP_NOFAIL);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 749
6aaa7b0664e688 fs/erofs/zdata.c Gao Xiang 2020-12-08 750 set_page_private(newpage, Z_EROFS_SHORTLIVED_PAGE);
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 751 err = z_erofs_attach_page(fe, newpage,
86432a6dca9bed fs/erofs/zdata.c Gao Xiang 2021-11-04 752 Z_EROFS_PAGE_TYPE_EXCLUSIVE, true);
8d8a09b093d707 fs/erofs/zdata.c Gao Xiang 2019-08-30 753 if (!err)
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 754 goto retry;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 755 }
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 756
8d8a09b093d707 fs/erofs/zdata.c Gao Xiang 2019-08-30 757 if (err)
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 758 goto err_out;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 759
97e86a858bc360 drivers/staging/erofs/zdata.c Gao Xiang 2019-07-31 760 index = page->index - (map->m_la >> PAGE_SHIFT);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 761
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 762 z_erofs_onlinepage_fixup(page, index, true);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 763
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 764 /* bump up the number of spiltted parts of a page */
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 765 ++spiltted;
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 766 /* also update nr_pages */
5c6dcc57e2e505 fs/erofs/zdata.c Gao Xiang 2022-03-02 @767 fe->cl->nr_pages = max_t(pgoff_t, fe->cl->nr_pages, index + 1);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 768 next_part:
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 769 /* can be used for verification */
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 770 map->m_llen = offset + cur - map->m_la;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 771
2bc7596438aba6 drivers/staging/erofs/unzip_vle.c Kristaps Čivkulis 2018-08-05 772 end = cur;
2bc7596438aba6 drivers/staging/erofs/unzip_vle.c Kristaps Čivkulis 2018-08-05 773 if (end > 0)
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 774 goto repeat;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 775
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 776 out:
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 777 z_erofs_onlinepage_endio(page);
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 778
4f761fa253b49f fs/erofs/zdata.c Gao Xiang 2019-09-04 779 erofs_dbg("%s, finish page: %pK spiltted: %u map->m_llen %llu",
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 780 __func__, page, spiltted, map->m_llen);
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 781 return err;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 782
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 783 /* if some error occurred while processing this page */
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 784 err_out:
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 785 SetPageError(page);
1e05ff36e6921c drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-09-18 786 goto out;
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 787 }
3883a79abd0227 drivers/staging/erofs/unzip_vle.c Gao Xiang 2018-07-26 788
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
fs/btrfs/disk-io.c:2263:2: warning: There is an unknown macro here somewhere. Configuration is required. If rbtree_postorder_for_each_entry_safe is a macro then please configure it. [unknownMacro]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Josef Bacik <josef(a)toxicpanda.com>
CC: David Sterba <dsterba(a)suse.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: abed4aaae4f71a7bcdbe90a65319b6e772a2689d btrfs: track the csum, extent, and free space trees in a rb tree
date: 3 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 3 months ago
compiler: ia64-linux-gcc (GCC) 11.2.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)
>> fs/btrfs/disk-io.c:2263:2: warning: There is an unknown macro here somewhere. Configuration is required. If rbtree_postorder_for_each_entry_safe is a macro then please configure it. [unknownMacro]
rbtree_postorder_for_each_entry_safe(root, tmp,
^
>> fs/btrfs/volumes.c:1181:2: warning: There is an unknown macro here somewhere. Configuration is required. If list_for_each_entry_safe is a macro then please configure it. [unknownMacro]
list_for_each_entry_safe(device, tmp, &fs_devices->devices, dev_list)
^
vim +2263 fs/btrfs/disk-io.c
2e9f5954978cd5 Rashika 2013-10-31 2258
abed4aaae4f71a Josef Bacik 2021-11-05 2259 static void free_global_root_pointers(struct btrfs_fs_info *fs_info)
abed4aaae4f71a Josef Bacik 2021-11-05 2260 {
abed4aaae4f71a Josef Bacik 2021-11-05 2261 struct btrfs_root *root, *tmp;
abed4aaae4f71a Josef Bacik 2021-11-05 2262
abed4aaae4f71a Josef Bacik 2021-11-05 @2263 rbtree_postorder_for_each_entry_safe(root, tmp,
abed4aaae4f71a Josef Bacik 2021-11-05 2264 &fs_info->global_root_tree,
abed4aaae4f71a Josef Bacik 2021-11-05 2265 rb_node)
abed4aaae4f71a Josef Bacik 2021-11-05 2266 free_root_extent_buffers(root);
abed4aaae4f71a Josef Bacik 2021-11-05 2267 }
abed4aaae4f71a Josef Bacik 2021-11-05 2268
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
arch/x86/boot/compressed/../string.h:15:23: warning: '__builtin_memcpy' reading 52 bytes from a region of size 0
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Arvind Sankar <nivedita(a)alum.mit.edu>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 394b19d6cb58ae292c0e1ad6b893fed8ece477ce x86/boot/compressed: Use builtin mem functions for decompressor
date: 1 year, 7 months ago
:::::: branch date: 21 hours ago
:::::: commit date: 1 year, 7 months ago
config: i386-randconfig-c001 (https://download.01.org/0day-ci/archive/20220401/202204010318.cvt0HPzm-lk...)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.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://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 394b19d6cb58ae292c0e1ad6b893fed8ece477ce
# save the config file to linux build tree
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from arch/x86/boot/compressed/misc.c:18:
In function 'parse_elf',
inlined from 'extract_kernel' at arch/x86/boot/compressed/misc.c:442:2:
>> arch/x86/boot/compressed/../string.h:15:23: warning: '__builtin_memcpy' reading 52 bytes from a region of size 0 [-Wstringop-overread]
15 | #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/boot/compressed/misc.c:283:9: note: in expansion of macro 'memcpy'
283 | memcpy(&ehdr, output, sizeof(ehdr));
| ^~~~~~
vim +/__builtin_memcpy +15 arch/x86/boot/compressed/../string.h
c041b5ad8640dd Vivek Goyal 2014-03-18 13
394b19d6cb58ae Arvind Sankar 2020-08-04 14 /* Access builtin version by default. */
c041b5ad8640dd Vivek Goyal 2014-03-18 @15 #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
c041b5ad8640dd Vivek Goyal 2014-03-18 16 #define memset(d,c,l) __builtin_memset(d,c,l)
fb4cac573ef6dc Vivek Goyal 2014-03-18 17 #define memcmp __builtin_memcmp
c041b5ad8640dd Vivek Goyal 2014-03-18 18
:::::: The code at line 15 was first introduced by commit
:::::: c041b5ad8640dd89ccf1411cd2636ef7c1cfee92 x86, boot: Create a separate string.h file to provide standard string functions
:::::: TO: Vivek Goyal <vgoyal(a)redhat.com>
:::::: CC: H. Peter Anvin <hpa(a)linux.intel.com>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
mm/slab_common.c:443:24: warning: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list [uninitvar]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Vlastimil Babka <vbabka(a)suse.cz>
CC: Roman Gushchin <guro(a)fb.com>
CC: Hyeonggon Yoo <42.hyeyoo(a)gmail.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 401fb12c68c257b9c9116b1475c0ac26b646fcc0 mm/sl*b: Differentiate struct slab fields by sl*b implementations
date: 3 months ago
:::::: branch date: 19 hours ago
:::::: commit date: 3 months ago
compiler: or1k-linux-gcc (GCC) 11.2.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/slab_common.c:187:48: warning: Parameter 'ctor' can be declared with const [constParameter]
slab_flags_t flags, const char *name, void (*ctor)(void *))
^
>> mm/slab_common.c:443:24: warning: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list [uninitvar]
debugfs_slab_release(s);
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:437:16: note: Assuming condition is false
if (list_empty(&to_destroy))
^
mm/slab_common.c:443:24: note: Uninitialized variables: s.object_size, s.size, s.align, s.flags, s.useroffset, s.usersize, s.name, s.refcount, s.ctor, s.list
debugfs_slab_release(s);
^
vim +443 mm/slab_common.c
3965fc36522446 Vladimir Davydov 2014-01-23 418
657dc2f9722092 Tejun Heo 2017-02-22 419 static void slab_caches_to_rcu_destroy_workfn(struct work_struct *work)
d5b3cf7139b877 Vladimir Davydov 2015-02-10 420 {
657dc2f9722092 Tejun Heo 2017-02-22 421 LIST_HEAD(to_destroy);
657dc2f9722092 Tejun Heo 2017-02-22 422 struct kmem_cache *s, *s2;
d5b3cf7139b877 Vladimir Davydov 2015-02-10 423
657dc2f9722092 Tejun Heo 2017-02-22 424 /*
5f0d5a3ae7cff0 Paul E. McKenney 2017-01-18 425 * On destruction, SLAB_TYPESAFE_BY_RCU kmem_caches are put on the
657dc2f9722092 Tejun Heo 2017-02-22 426 * @slab_caches_to_rcu_destroy list. The slab pages are freed
081a06fa299066 Randy Dunlap 2020-08-11 427 * through RCU and the associated kmem_cache are dereferenced
657dc2f9722092 Tejun Heo 2017-02-22 428 * while freeing the pages, so the kmem_caches should be freed only
657dc2f9722092 Tejun Heo 2017-02-22 429 * after the pending RCU operations are finished. As rcu_barrier()
657dc2f9722092 Tejun Heo 2017-02-22 430 * is a pretty slow operation, we batch all pending destructions
657dc2f9722092 Tejun Heo 2017-02-22 431 * asynchronously.
657dc2f9722092 Tejun Heo 2017-02-22 432 */
657dc2f9722092 Tejun Heo 2017-02-22 433 mutex_lock(&slab_mutex);
657dc2f9722092 Tejun Heo 2017-02-22 434 list_splice_init(&slab_caches_to_rcu_destroy, &to_destroy);
657dc2f9722092 Tejun Heo 2017-02-22 435 mutex_unlock(&slab_mutex);
d5b3cf7139b877 Vladimir Davydov 2015-02-10 436
657dc2f9722092 Tejun Heo 2017-02-22 437 if (list_empty(&to_destroy))
657dc2f9722092 Tejun Heo 2017-02-22 438 return;
657dc2f9722092 Tejun Heo 2017-02-22 439
657dc2f9722092 Tejun Heo 2017-02-22 440 rcu_barrier();
657dc2f9722092 Tejun Heo 2017-02-22 441
657dc2f9722092 Tejun Heo 2017-02-22 442 list_for_each_entry_safe(s, s2, &to_destroy, list) {
64dd68497be76a Faiyaz Mohammed 2021-06-28 @443 debugfs_slab_release(s);
d3fb45f370d927 Alexander Potapenko 2021-02-25 444 kfence_shutdown_cache(s);
657dc2f9722092 Tejun Heo 2017-02-22 445 #ifdef SLAB_SUPPORTS_SYSFS
657dc2f9722092 Tejun Heo 2017-02-22 446 sysfs_slab_release(s);
657dc2f9722092 Tejun Heo 2017-02-22 447 #else
657dc2f9722092 Tejun Heo 2017-02-22 448 slab_kmem_cache_release(s);
657dc2f9722092 Tejun Heo 2017-02-22 449 #endif
657dc2f9722092 Tejun Heo 2017-02-22 450 }
d5b3cf7139b877 Vladimir Davydov 2015-02-10 451 }
d5b3cf7139b877 Vladimir Davydov 2015-02-10 452
:::::: The code at line 443 was first introduced by commit
:::::: 64dd68497be76ab4e237cca06f5324e220d0f050 mm: slub: move sysfs slab alloc/free interfaces to debugfs
:::::: TO: Faiyaz Mohammed <faiyazm(a)codeaurora.org>
:::::: CC: Linus Torvalds <torvalds(a)linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
drivers/hid/hid-core.c:1767:2: warning: There is an unknown macro here somewhere. Configuration is required. If list_for_each_entry is a macro then please configure it. [unknownMacro]
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Benjamin Tissoires <benjamin.tissoires(a)redhat.com>
CC: Jiri Kosina <jkosina(a)suse.cz>
CC: Ping Cheng <ping.cheng(a)wacom.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 787af64d05cd528aac9ad16752d11bb1c6061bb9
commit: 22f4b026c3ddd4b26c5baa202bd3ee38feaa2e9a HID: compute an ordered list of input fields to process
date: 4 weeks ago
:::::: branch date: 16 hours ago
:::::: commit date: 4 weeks ago
compiler: or1k-linux-gcc (GCC) 11.2.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)
>> drivers/hid/hid-core.c:1767:2: warning: There is an unknown macro here somewhere. Configuration is required. If list_for_each_entry is a macro then please configure it. [unknownMacro]
list_for_each_entry(report, &report_enum->report_list, list)
^
vim +1767 drivers/hid/hid-core.c
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1761
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1762 static void hid_process_ordering(struct hid_device *hid)
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1763 {
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1764 struct hid_report *report;
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1765 struct hid_report_enum *report_enum = &hid->report_enum[HID_INPUT_REPORT];
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1766
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 @1767 list_for_each_entry(report, &report_enum->report_list, list)
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1768 hid_report_process_ordering(hid, report);
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1769 }
22f4b026c3ddd4 Benjamin Tissoires 2022-02-03 1770
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
Re: [RESEND][PATCH v3 2/2] serial: 8250: Add proper clock handling for OxSemi PCIe devices
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
In-Reply-To: <alpine.DEB.2.21.2203310123450.44113(a)angie.orcam.me.uk>
References: <alpine.DEB.2.21.2203310123450.44113(a)angie.orcam.me.uk>
TO: "Maciej W. Rozycki" <macro(a)orcam.me.uk>
TO: "Greg Kroah-Hartman" <gregkh(a)linuxfoundation.org>
TO: Jiri Slaby <jirislaby(a)kernel.org>
CC: Andy Shevchenko <andy.shevchenko(a)gmail.com>
CC: linux-serial(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
Hi "Maciej,
I love your patch! Perhaps something to improve:
[auto build test WARNING on tty/tty-testing]
[also build test WARNING on usb/usb-testing helgaas-pci/next v5.17 next-20220331]
[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/intel-lab-lkp/linux/commits/Maciej-W-Rozycki/serial-82...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: x86_64-randconfig-m001 (https://download.01.org/0day-ci/archive/20220331/202203312211.ZJqjArhw-lk...)
compiler: gcc-11 (Debian 11.2.0-19) 11.2.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/tty/serial/8250/8250_pci.c:1171 pci_oxsemi_tornado_get_divisor() error: uninitialized symbol 'tcr'.
drivers/tty/serial/8250/8250_pci.c:1172 pci_oxsemi_tornado_get_divisor() error: uninitialized symbol 'quot'.
drivers/tty/serial/8250/8250_pci.c:1180 pci_oxsemi_tornado_get_divisor() error: uninitialized symbol 'cpr'.
Old smatch warnings:
drivers/tty/serial/8250/8250_pci.c:1176 pci_oxsemi_tornado_get_divisor() error: uninitialized symbol 'quot'.
drivers/tty/serial/8250/8250_pci.c:1190 pci_oxsemi_tornado_get_divisor() error: uninitialized symbol 'cpr'.
vim +/tcr +1171 drivers/tty/serial/8250/8250_pci.c
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1049
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1050 /*
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1051 * Determine the oversampling rate, the clock prescaler, and the clock
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1052 * divisor for the requested baud rate. The clock rate is 62.5 MHz,
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1053 * which is four times the baud base, and the prescaler increments in
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1054 * steps of 1/8. Therefore to make calculations on integers we need
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1055 * to use a scaled clock rate, which is the baud base multiplied by 32
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1056 * (or our assumed UART clock rate multiplied by 2).
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1057 *
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1058 * The allowed oversampling rates are from 4 up to 16 inclusive (values
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1059 * from 0 to 3 inclusive map to 16). Likewise the clock prescaler allows
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1060 * values between 1.000 and 63.875 inclusive (operation for values from
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1061 * 0.000 to 0.875 has not been specified). The clock divisor is the usual
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1062 * unsigned 16-bit integer.
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1063 *
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1064 * For the most accurate baud rate we use a table of predetermined
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1065 * oversampling rates and clock prescalers that records all possible
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1066 * products of the two parameters in the range from 4 up to 255 inclusive,
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1067 * and additionally 335 for the 1500000bps rate, with the prescaler scaled
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1068 * by 8. The table is sorted by the decreasing value of the oversampling
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1069 * rate and ties are resolved by sorting by the decreasing value of the
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1070 * product. This way preference is given to higher oversampling rates.
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1071 *
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1072 * We iterate over the table and choose the product of an oversampling
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1073 * rate and a clock prescaler that gives the lowest integer division
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1074 * result deviation, or if an exact integer divider is found we stop
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1075 * looking for it right away. We do some fixup if the resulting clock
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1076 * divisor required would be out of its unsigned 16-bit integer range.
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1077 *
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1078 * Finally we abuse the supposed fractional part returned to encode the
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1079 * 4-bit value of the oversampling rate and the 9-bit value of the clock
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1080 * prescaler which will end up in the TCR and CPR/CPR2 registers.
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1081 */
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1082 static unsigned int pci_oxsemi_tornado_get_divisor(struct uart_port *port,
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1083 unsigned int baud,
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1084 unsigned int *frac)
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1085 {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1086 static u8 p[][2] = {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1087 { 16, 14, }, { 16, 13, }, { 16, 12, }, { 16, 11, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1088 { 16, 10, }, { 16, 9, }, { 16, 8, }, { 15, 17, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1089 { 15, 16, }, { 15, 15, }, { 15, 14, }, { 15, 13, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1090 { 15, 12, }, { 15, 11, }, { 15, 10, }, { 15, 9, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1091 { 15, 8, }, { 14, 18, }, { 14, 17, }, { 14, 14, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1092 { 14, 13, }, { 14, 12, }, { 14, 11, }, { 14, 10, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1093 { 14, 9, }, { 14, 8, }, { 13, 19, }, { 13, 18, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1094 { 13, 17, }, { 13, 13, }, { 13, 12, }, { 13, 11, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1095 { 13, 10, }, { 13, 9, }, { 13, 8, }, { 12, 19, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1096 { 12, 18, }, { 12, 17, }, { 12, 11, }, { 12, 9, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1097 { 12, 8, }, { 11, 23, }, { 11, 22, }, { 11, 21, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1098 { 11, 20, }, { 11, 19, }, { 11, 18, }, { 11, 17, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1099 { 11, 11, }, { 11, 10, }, { 11, 9, }, { 11, 8, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1100 { 10, 25, }, { 10, 23, }, { 10, 20, }, { 10, 19, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1101 { 10, 17, }, { 10, 10, }, { 10, 9, }, { 10, 8, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1102 { 9, 27, }, { 9, 23, }, { 9, 21, }, { 9, 19, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1103 { 9, 18, }, { 9, 17, }, { 9, 9, }, { 9, 8, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1104 { 8, 31, }, { 8, 29, }, { 8, 23, }, { 8, 19, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1105 { 8, 17, }, { 8, 8, }, { 7, 35, }, { 7, 31, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1106 { 7, 29, }, { 7, 25, }, { 7, 23, }, { 7, 21, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1107 { 7, 19, }, { 7, 17, }, { 7, 15, }, { 7, 14, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1108 { 7, 13, }, { 7, 12, }, { 7, 11, }, { 7, 10, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1109 { 7, 9, }, { 7, 8, }, { 6, 41, }, { 6, 37, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1110 { 6, 31, }, { 6, 29, }, { 6, 23, }, { 6, 19, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1111 { 6, 17, }, { 6, 13, }, { 6, 11, }, { 6, 10, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1112 { 6, 9, }, { 6, 8, }, { 5, 67, }, { 5, 47, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1113 { 5, 43, }, { 5, 41, }, { 5, 37, }, { 5, 31, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1114 { 5, 29, }, { 5, 25, }, { 5, 23, }, { 5, 19, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1115 { 5, 17, }, { 5, 15, }, { 5, 13, }, { 5, 11, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1116 { 5, 10, }, { 5, 9, }, { 5, 8, }, { 4, 61, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1117 { 4, 59, }, { 4, 53, }, { 4, 47, }, { 4, 43, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1118 { 4, 41, }, { 4, 37, }, { 4, 31, }, { 4, 29, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1119 { 4, 23, }, { 4, 19, }, { 4, 17, }, { 4, 13, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1120 { 4, 9, }, { 4, 8, },
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1121 };
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1122 /* Scale the quotient for comparison to get the fractional part. */
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1123 const unsigned int quot_scale = 65536;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1124 unsigned int sclk = port->uartclk * 2;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1125 unsigned int sdiv = (sclk + (baud / 2)) / baud;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1126 unsigned int best_squot;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1127 unsigned int squot;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1128 unsigned int quot;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1129 u16 cpr;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1130 u8 tcr;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1131 int i;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1132
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1133 /* Old custom speed handling. */
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1134 if (baud == 38400 && (port->flags & UPF_SPD_MASK) == UPF_SPD_CUST) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1135 unsigned int cust_div = port->custom_divisor;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1136
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1137 quot = cust_div & UART_DIV_MAX;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1138 tcr = (cust_div >> 16) & OXSEMI_TORNADO_TCR_MASK;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1139 cpr = (cust_div >> 20) & OXSEMI_TORNADO_CPR_MASK;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1140 if (cpr < OXSEMI_TORNADO_CPR_MIN)
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1141 cpr = OXSEMI_TORNADO_CPR_DEF;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1142 } else {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1143 best_squot = quot_scale;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1144 for (i = 0; i < ARRAY_SIZE(p); i++) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1145 unsigned int spre;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1146 unsigned int srem;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1147 u8 cp;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1148 u8 tc;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1149
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1150 tc = p[i][0];
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1151 cp = p[i][1];
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1152 spre = tc * cp;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1153
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1154 srem = sdiv % spre;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1155 if (srem > spre / 2)
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1156 srem = spre - srem;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1157 squot = (srem * quot_scale + spre / 2) / spre;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1158
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1159 if (srem == 0) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1160 tcr = tc;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1161 cpr = cp;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1162 quot = sdiv / spre;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1163 break;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1164 } else if (squot < best_squot) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1165 best_squot = squot;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1166 tcr = tc;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1167 cpr = cp;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1168 quot = (sdiv + spre / 2) / spre;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1169 }
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1170 }
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 @1171 while (tcr <= (OXSEMI_TORNADO_TCR_MASK + 1) >> 1 &&
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 @1172 quot % 2 == 0) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1173 quot >>= 1;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1174 tcr <<= 1;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1175 }
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1176 while (quot > UART_DIV_MAX) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1177 if (tcr <= (OXSEMI_TORNADO_TCR_MASK + 1) >> 1) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1178 quot >>= 1;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1179 tcr <<= 1;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 @1180 } else if (cpr <= OXSEMI_TORNADO_CPR_MASK >> 1) {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1181 quot >>= 1;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1182 cpr <<= 1;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1183 } else {
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1184 quot = quot * cpr / OXSEMI_TORNADO_CPR_MASK;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1185 cpr = OXSEMI_TORNADO_CPR_MASK;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1186 }
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1187 }
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1188 }
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1189
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1190 *frac = (cpr << 8) | (tcr & OXSEMI_TORNADO_TCR_MASK);
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1191 return quot;
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1192 }
b3a554d50d82ad Maciej W. Rozycki 2022-03-31 1193
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months
[sailus-media-tree:master 28/56] drivers/media/v4l2-core/v4l2-subdev.c:875 __v4l2_subdev_state_alloc() warn: Please consider using kvcalloc instead
by kernel test robot
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Tomi Valkeinen <tomi.valkeinen(a)ideasonboard.com>
CC: Sakari Ailus <sakari.ailus(a)linux.intel.com>
CC: Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
CC: Hans Verkuil <hverkuil(a)xs4all.nl>
CC: Jacopo Mondi <jacopo(a)jmondi.org>
tree: git://linuxtv.org/sailus/media_tree.git master
head: 2052fcce377325e5662418ec65a1fabe59e4cfbf
commit: 38a25fa468f080196b04a18edf9fd173ceaf6466 [28/56] media: subdev: rename subdev-state alloc & free
:::::: branch date: 27 hours ago
:::::: commit date: 8 days ago
config: powerpc64-randconfig-m031-20220330 (https://download.01.org/0day-ci/archive/20220331/202203312125.S4P9LSqS-lk...)
compiler: powerpc64-linux-gcc (GCC) 11.2.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/v4l2-core/v4l2-subdev.c:875 __v4l2_subdev_state_alloc() warn: Please consider using kvcalloc instead
vim +875 drivers/media/v4l2-core/v4l2-subdev.c
9b02cbb3ede89b Laurent Pinchart 2015-04-24 864
38a25fa468f080 Tomi Valkeinen 2022-03-01 865 struct v4l2_subdev_state *__v4l2_subdev_state_alloc(struct v4l2_subdev *sd)
9b02cbb3ede89b Laurent Pinchart 2015-04-24 866 {
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 867 struct v4l2_subdev_state *state;
9b02cbb3ede89b Laurent Pinchart 2015-04-24 868 int ret;
9b02cbb3ede89b Laurent Pinchart 2015-04-24 869
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 870 state = kzalloc(sizeof(*state), GFP_KERNEL);
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 871 if (!state)
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 872 return ERR_PTR(-ENOMEM);
9b02cbb3ede89b Laurent Pinchart 2015-04-24 873
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 874 if (sd->entity.num_pads) {
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 @875 state->pads = kvmalloc_array(sd->entity.num_pads,
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 876 sizeof(*state->pads),
758d90e161382c Tomasz Figa 2017-06-19 877 GFP_KERNEL | __GFP_ZERO);
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 878 if (!state->pads) {
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 879 ret = -ENOMEM;
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 880 goto err;
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 881 }
9b02cbb3ede89b Laurent Pinchart 2015-04-24 882 }
9b02cbb3ede89b Laurent Pinchart 2015-04-24 883
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 884 ret = v4l2_subdev_call(sd, pad, init_cfg, state);
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 885 if (ret < 0 && ret != -ENOIOCTLCMD)
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 886 goto err;
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 887
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 888 return state;
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 889
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 890 err:
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 891 if (state && state->pads)
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 892 kvfree(state->pads);
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 893
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 894 kfree(state);
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 895
0d346d2a6f54f0 Tomi Valkeinen 2021-06-10 896 return ERR_PTR(ret);
9b02cbb3ede89b Laurent Pinchart 2015-04-24 897 }
38a25fa468f080 Tomi Valkeinen 2022-03-01 898 EXPORT_SYMBOL_GPL(__v4l2_subdev_state_alloc);
9b02cbb3ede89b Laurent Pinchart 2015-04-24 899
:::::: The code at line 875 was first introduced by commit
:::::: 0d346d2a6f54f06f36b224fd27cd6eafe8c83be9 media: v4l2-subdev: add subdev-wide state struct
:::::: TO: Tomi Valkeinen <tomi.valkeinen(a)ideasonboard.com>
:::::: CC: Mauro Carvalho Chehab <mchehab+huawei(a)kernel.org>
--
0-DAY CI Kernel Test Service
https://01.org/lkp
3 months