[spice-gtk,v2,13/33] fixup! usb-redir: add files for SCSI and USB MSC implementation

Submitted by Frediano Ziglio on Aug. 9, 2019, 2:26 p.m.

Details

Message ID 20190809142651.2967-14-fziglio@redhat.com
State Superseded
Headers show
Series "CD emulation follow ups" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Aug. 9, 2019, 2:26 p.m.
Make some parameter constant.
Make clear they don't change the passed value
---
 src/cd-scsi.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/cd-scsi.c b/src/cd-scsi.c
index 9c5616b0..dbb78e54 100644
--- a/src/cd-scsi.c
+++ b/src/cd-scsi.c
@@ -432,12 +432,12 @@  void cd_scsi_target_free(CdScsiTarget *scsi_target)
 
 /* SCSI Device */
 
-static inline gboolean cd_scsi_target_lun_legal(CdScsiTarget *st, uint32_t lun)
+static inline gboolean cd_scsi_target_lun_legal(const CdScsiTarget *st, uint32_t lun)
 {
     return (lun < st->max_luns) ? TRUE : FALSE;
 }
 
-static inline gboolean cd_scsi_target_lun_realized(CdScsiTarget *st, uint32_t lun)
+static inline gboolean cd_scsi_target_lun_realized(const CdScsiTarget *st, uint32_t lun)
 {
     return (st->num_luns == 0 || !st->units[lun].realized) ? FALSE : TRUE;
 }
@@ -741,7 +741,7 @@  static void strpadcpy(char *buf, int buf_size, const char *str, char pad)
 
 /* SCSI CDB */
 
-static int scsi_cdb_length(uint8_t *cdb)
+static int scsi_cdb_length(const uint8_t *cdb)
 {
     int cdb_len;
 
@@ -765,7 +765,7 @@  static int scsi_cdb_length(uint8_t *cdb)
     return cdb_len;
 }
 
-static uint64_t scsi_cdb_lba(uint8_t *cdb, int cdb_len)
+static uint64_t scsi_cdb_lba(const uint8_t *cdb, int cdb_len)
 {
     uint64_t lba;
 
@@ -798,7 +798,7 @@  static uint64_t scsi_cdb_lba(uint8_t *cdb, int cdb_len)
     return lba;
 }
 
-static uint32_t scsi_cdb_xfer_length(uint8_t *cdb, int cdb_len)
+static uint32_t scsi_cdb_xfer_length(const uint8_t *cdb, int cdb_len)
 {
     uint32_t len;