From 91521a2dd27c57e3a739dbfbe63abfadc021a9c7 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 7 Sep 2010 07:30:28 +0000 Subject: [PATCH] Fixed sparse errors introduced in r2060. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2065 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/dev_handlers/scst_user.c | 2 +- scst/src/dev_handlers/scst_vdisk.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) 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; }