scsi: hisi_sas: Change the type of some numbers to unsigned
authorXiang Chen <chenxiang66@hisilicon.com>
Wed, 29 May 2019 09:58:45 +0000 (17:58 +0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 18 Jun 2019 23:46:24 +0000 (19:46 -0400)
It reports a error as follows from some tools at two places in our code:
runtime error: left shift of 4 by 29 places cannot be represented in type
'int' So change the type of the two numbers to unsigned to avoid the error.

Signed-off-by: Xiang Chen <chenxiang66@hisilicon.com>
Signed-off-by: John Garry <john.garry@huawei.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

index 3efb1e7..492ada6 100644 (file)
@@ -1344,7 +1344,7 @@ static void prep_ata_v3_hw(struct hisi_hba *hisi_hba,
        if (parent_dev && DEV_IS_EXPANDER(parent_dev->dev_type))
                hdr->dw0 |= cpu_to_le32(3 << CMD_HDR_CMD_OFF);
        else
-               hdr->dw0 |= cpu_to_le32(4 << CMD_HDR_CMD_OFF);
+               hdr->dw0 |= cpu_to_le32(4U << CMD_HDR_CMD_OFF);
 
        switch (task->data_dir) {
        case DMA_TO_DEVICE:
@@ -1412,7 +1412,7 @@ static void prep_abort_v3_hw(struct hisi_hba *hisi_hba,
        struct hisi_sas_port *port = slot->port;
 
        /* dw0 */
-       hdr->dw0 = cpu_to_le32((5 << CMD_HDR_CMD_OFF) | /*abort*/
+       hdr->dw0 = cpu_to_le32((5U << CMD_HDR_CMD_OFF) | /*abort*/
                               (port->id << CMD_HDR_PORT_OFF) |
                                   (dev_is_sata(dev)
                                        << CMD_HDR_ABORT_DEVICE_TYPE_OFF) |