diff --git a/scst/src/dev_handlers/scst_user.c b/scst/src/dev_handlers/scst_user.c index b83f4e354..a1e2aa628 100644 --- a/scst/src/dev_handlers/scst_user.c +++ b/scst/src/dev_handlers/scst_user.c @@ -2765,7 +2765,7 @@ static void dev_user_setup_functions(struct scst_user_dev *dev) static int dev_user_check_version(const struct scst_user_dev_desc *dev_desc) { - char str[max_t(int, sizeof(DEV_USER_VERSION)+1, 20)]; + char str[sizeof(DEV_USER_VERSION) > 20 ? sizeof(DEV_USER_VERSION) : 20]; int res = 0, rc; rc = copy_from_user(str, diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index d2f1c039e..372001871 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -1449,14 +1449,14 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd) if (cmd->tgtt->get_phys_transport_version != NULL) { uint16_t v = cmd->tgtt->get_phys_transport_version(cmd->tgt); if (v != 0) { - *((uint16_t *)&buf[58 + num]) = cpu_to_be16(v); + *((__be16 *)&buf[58 + num]) = cpu_to_be16(v); num += 2; } } /* SCSI transport */ if (cmd->tgtt->get_scsi_transport_version != NULL) { - *((uint16_t *)&buf[58 + num]) = + *((__be16 *)&buf[58 + num]) = cpu_to_be16(cmd->tgtt->get_scsi_transport_version(cmd->tgt)); num += 2; } @@ -1468,7 +1468,7 @@ static void vdisk_exec_inquiry(struct scst_cmd *cmd) /* Device command set */ if (virt_dev->command_set_version != 0) { - *((uint16_t *)&buf[58 + num]) = + *((__be16 *)&buf[58 + num]) = cpu_to_be16(virt_dev->command_set_version); num += 2; }