[openeuler:OLK-6.6 2135/2135] drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:1448:26: sparse: sparse: invalid assignment: |=

tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 020d455b1d7b83ce376f0c652850dd49f02f9e4c commit: cd982c1a99959671f5ea416edf968fccfd300108 [2135/2135] scsi: hisi_sas: Enable force phy when SATA disk directly connected config: loongarch-randconfig-r121-20250418 (https://download.01.org/0day-ci/archive/20250418/202504180825.AdhYDR7q-lkp@i...) compiler: loongarch64-linux-gcc (GCC) 14.2.0 reproduce: (https://download.01.org/0day-ci/archive/20250418/202504180825.AdhYDR7q-lkp@i...) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202504180825.AdhYDR7q-lkp@intel.com/ sparse warnings: (new ones prefixed by >>)
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:1448:26: sparse: sparse: invalid assignment: |= drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:1448:26: sparse: left side has type restricted __le32 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c:1448:26: sparse: right side has type unsigned int
vim +1448 drivers/scsi/hisi_sas/hisi_sas_v3_hw.c 1425 1426 static void prep_ata_v3_hw(struct hisi_hba *hisi_hba, 1427 struct hisi_sas_slot *slot) 1428 { 1429 struct sas_task *task = slot->task; 1430 struct domain_device *device = task->dev; 1431 struct domain_device *parent_dev = device->parent; 1432 struct hisi_sas_device *sas_dev = device->lldd_dev; 1433 struct hisi_sas_cmd_hdr *hdr = slot->cmd_hdr; 1434 struct asd_sas_port *sas_port = device->port; 1435 struct hisi_sas_port *port = to_hisi_sas_port(sas_port); 1436 u8 *buf_cmd; 1437 int has_data = 0, hdr_tag = 0; 1438 u32 dw1 = 0, dw2 = 0; 1439 1440 hdr->dw0 = cpu_to_le32(port->id << CMD_HDR_PORT_OFF); 1441 if (parent_dev && dev_is_expander(parent_dev->dev_type)) { 1442 hdr->dw0 |= cpu_to_le32(3 << CMD_HDR_CMD_OFF); 1443 } else { 1444 int phy_id = device->phy->identify.phy_identifier; 1445 1446 hdr->dw0 |= cpu_to_le32((1U << phy_id) 1447 << CMD_HDR_PHY_ID_OFF);
1448 hdr->dw0 |= CMD_HDR_FORCE_PHY_MSK; 1449 hdr->dw0 |= cpu_to_le32(4U << CMD_HDR_CMD_OFF); 1450 } 1451 1452 switch (task->data_dir) { 1453 case DMA_TO_DEVICE: 1454 has_data = 1; 1455 dw1 |= DIR_TO_DEVICE << CMD_HDR_DIR_OFF; 1456 break; 1457 case DMA_FROM_DEVICE: 1458 has_data = 1; 1459 dw1 |= DIR_TO_INI << CMD_HDR_DIR_OFF; 1460 break; 1461 default: 1462 dw1 &= ~CMD_HDR_DIR_MSK; 1463 } 1464 1465 if ((task->ata_task.fis.command == ATA_CMD_DEV_RESET) && 1466 (task->ata_task.fis.control & ATA_SRST)) 1467 dw1 |= 1 << CMD_HDR_RESET_OFF; 1468 1469 dw1 |= (hisi_sas_get_ata_protocol( 1470 &task->ata_task.fis, task->data_dir)) 1471 << CMD_HDR_FRAME_TYPE_OFF; 1472 dw1 |= sas_dev->device_id << CMD_HDR_DEV_ID_OFF; 1473 1474 if (FIS_CMD_IS_UNCONSTRAINED(task->ata_task.fis)) 1475 dw1 |= 1 << CMD_HDR_UNCON_CMD_OFF; 1476 1477 hdr->dw1 = cpu_to_le32(dw1); 1478 1479 /* dw2 */ 1480 if (task->ata_task.use_ncq) { 1481 struct ata_queued_cmd *qc = task->uldd_task; 1482 1483 hdr_tag = qc->tag; 1484 task->ata_task.fis.sector_count |= (u8) (hdr_tag << 3); 1485 dw2 |= hdr_tag << CMD_HDR_NCQ_TAG_OFF; 1486 } 1487 1488 dw2 |= (HISI_SAS_MAX_STP_RESP_SZ / 4) << CMD_HDR_CFL_OFF | 1489 2 << CMD_HDR_SG_MOD_OFF; 1490 hdr->dw2 = cpu_to_le32(dw2); 1491 1492 /* dw3 */ 1493 hdr->transfer_tags = cpu_to_le32(slot->idx); 1494 1495 if (has_data) 1496 prep_prd_sge_v3_hw(hisi_hba, slot, hdr, task->scatter, 1497 slot->n_elem); 1498 1499 hdr->data_transfer_len = cpu_to_le32(task->total_xfer_len); 1500 hdr->cmd_table_addr = cpu_to_le64(hisi_sas_cmd_hdr_addr_dma(slot)); 1501 hdr->sts_buffer_addr = cpu_to_le64(hisi_sas_status_buf_addr_dma(slot)); 1502 1503 buf_cmd = hisi_sas_cmd_hdr_addr_mem(slot); 1504 1505 if (likely(!task->ata_task.device_control_reg_update)) 1506 task->ata_task.fis.flags |= 0x80; /* C=1: update ATA cmd reg */ 1507 /* fill in command FIS */ 1508 memcpy(buf_cmd, &task->ata_task.fis, sizeof(struct host_to_dev_fis)); 1509 } 1510
-- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
participants (1)
-
kernel test robot