[PATCH spice-gtk 25/44] fixup! usb-redir: add files for SCSI and USB MSC implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reuse MIN macro from GLib.
---
 src/cd-usb-bulk-msd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/cd-usb-bulk-msd.c b/src/cd-usb-bulk-msd.c
index bb49e0d4..843f4f2e 100644
--- a/src/cd-usb-bulk-msd.c
+++ b/src/cd-usb-bulk-msd.c
@@ -354,7 +354,7 @@ static void usb_cd_send_data_in(UsbCdBulkMsdDevice *cd, uint32_t max_len)
     CdScsiRequest *scsi_req = &usb_req->scsi_req;
     uint8_t *buf = ((uint8_t *)scsi_req->buf) + usb_req->xfer_len;
     uint32_t avail_len = usb_req->scsi_in_len - usb_req->xfer_len;
-    uint32_t send_len = (avail_len <= max_len) ? avail_len : max_len;
+    uint32_t send_len = MIN(avail_len, max_len);
 
     SPICE_DEBUG("Data-in cmd tag 0x%x, remains %" G_GUINT32_FORMAT
                 ", requested %" G_GUINT32_FORMAT ", send %" G_GUINT32_FORMAT,
-- 
2.20.1

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux Virtualization]     [Linux Virtualization]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]