Changeset 83062ff in mainline for uspace/drv/bus/usb/usbmast/scsi_ms.c


Ignore:
Timestamp:
2014-09-12T05:30:31Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fa65df1
Parents:
c53b58e
Message:

usbmast: bit more cleanup and some const love

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmast/scsi_ms.c

    rc53b58e r83062ff  
    394394int usbmast_sync_cache(usbmast_fun_t *mfun, uint64_t ba, size_t nblocks)
    395395{
    396         scsi_cmd_t cmd;
    397         scsi_cdb_sync_cache_10_t cdb;
    398         int rc;
    399 
    400396        if (ba > UINT32_MAX)
    401397                return ELIMIT;
     
    404400                return ELIMIT;
    405401
    406         memset(&cdb, 0, sizeof(cdb));
    407         cdb.op_code = SCSI_CMD_SYNC_CACHE_10;
    408         cdb.lba = host2uint32_t_be(ba);
    409         cdb.numlb = host2uint16_t_be(nblocks);
    410 
    411         memset(&cmd, 0, sizeof(cmd));
    412         cmd.cdb = &cdb;
    413         cmd.cdb_size = sizeof(cdb);
    414 
    415         rc = usbmast_run_cmd(mfun, &cmd);
     402        const scsi_cdb_sync_cache_10_t cdb = {
     403                .op_code = SCSI_CMD_SYNC_CACHE_10,
     404                .lba = host2uint32_t_be(ba),
     405                .numlb = host2uint16_t_be(nblocks),
     406        };
     407
     408        scsi_cmd_t cmd = {
     409                .cdb = &cdb,
     410                .cdb_size = sizeof(cdb),
     411        };
     412
     413        const int rc = usbmast_run_cmd(mfun, &cmd);
    416414
    417415        if (rc != EOK) {
Note: See TracChangeset for help on using the changeset viewer.