tree:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8...
review-hans
head: 0f1f7f22f384f34b2f0800a3734aa0fc83eafff2
commit: c167b9c7e3d6131b4a4865c112a3dbc86d2e997d [10/93] platform/surface: Add Surface
Aggregator subsystem
config: i386-randconfig-s002-20210211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-215-g0fb77bb6-dirty
#
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8...
git remote add linux-platform-drivers-x86
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x8...
git fetch --no-tags linux-platform-drivers-x86 review-hans
git checkout c167b9c7e3d6131b4a4865c112a3dbc86d2e997d
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
> drivers/platform/surface/aggregator/ssh_packet_layer.c:1413:44:
sparse: sparse: restricted __le16 degrades to integer
vim +1413 drivers/platform/surface/aggregator/ssh_packet_layer.c
1343
1344 static size_t ssh_ptl_rx_eval(struct ssh_ptl *ptl, struct ssam_span *source)
1345 {
1346 struct ssh_frame *frame;
1347 struct ssam_span payload;
1348 struct ssam_span aligned;
1349 bool syn_found;
1350 int status;
1351
1352 /* Find SYN. */
1353 syn_found = sshp_find_syn(source, &aligned);
1354
1355 if (unlikely(aligned.ptr - source->ptr) > 0) {
1356 ptl_warn(ptl, "rx: parser: invalid start of frame, skipping\n");
1357
1358 /*
1359 * Notes:
1360 * - This might send multiple NAKs in case the communication
1361 * starts with an invalid SYN and is broken down into multiple
1362 * pieces. This should generally be handled fine, we just
1363 * might receive duplicate data in this case, which is
1364 * detected when handling data frames.
1365 * - This path will also be executed on invalid CRCs: When an
1366 * invalid CRC is encountered, the code below will skip data
1367 * until directly after the SYN. This causes the search for
1368 * the next SYN, which is generally not placed directly after
1369 * the last one.
1370 *
1371 * Open question: Should we send this in case of invalid
1372 * payload CRCs if the frame-type is non-sequential (current
1373 * implementation) or should we drop that frame without
1374 * telling the EC?
1375 */
1376 ssh_ptl_send_nak(ptl);
1377 }
1378
1379 if (unlikely(!syn_found))
1380 return aligned.ptr - source->ptr;
1381
1382 /* Parse and validate frame. */
1383 status = sshp_parse_frame(&ptl->serdev->dev, &aligned, &frame,
&payload,
1384 SSH_PTL_RX_BUF_LEN);
1385 if (status) /* Invalid frame: skip to next SYN. */
1386 return aligned.ptr - source->ptr + sizeof(u16);
1387 if (!frame) /* Not enough data. */
1388 return aligned.ptr - source->ptr;
1389
1390 switch (frame->type) {
1391 case SSH_FRAME_TYPE_ACK:
1392 ssh_ptl_acknowledge(ptl, frame->seq);
1393 break;
1394
1395 case SSH_FRAME_TYPE_NAK:
1396 ssh_ptl_resubmit_pending(ptl);
1397 break;
1398
1399 case SSH_FRAME_TYPE_DATA_SEQ:
1400 ssh_ptl_send_ack(ptl, frame->seq);
1401 fallthrough;
1402
1403 case SSH_FRAME_TYPE_DATA_NSQ:
1404 ssh_ptl_rx_dataframe(ptl, frame, &payload);
1405 break;
1406
1407 default:
1408 ptl_warn(ptl, "ptl: received frame with unknown type %#04x\n",
1409 frame->type);
1410 break;
1411 }
1412
1413 return aligned.ptr - source->ptr +
SSH_MESSAGE_LENGTH(frame->len);
1414 }
1415
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org