Date: Sun, 30 Apr 2023 06:57:45 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: d9a8025f4849 - stable/13 - uhid_snes: Remove USB_ST_TRANSFERRED handling for the status request. Message-ID: <202304300657.33U6vjqk071380@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d9a8025f484984a2165767762648f668b869f49f commit d9a8025f484984a2165767762648f668b869f49f Author: John Baldwin <jhb@FreeBSD.org> AuthorDate: 2022-04-18 19:27:48 +0000 Commit: Hans Petter Selasky <hselasky@FreeBSD.org> CommitDate: 2023-04-30 06:56:15 +0000 uhid_snes: Remove USB_ST_TRANSFERRED handling for the status request. The result of the request computed in new_status was never returned to the caller leaving new_status as a set-but-unused variable. Removing new_status leaves sc->previous_status as a write-only variable. Removing sc->previous_status leaves current_status as a write-only variable, so it collapses down to removing the entire USB_ST_TRANSFERRED case. Arguably, all of the support for UHID_SNES_STATUS_DT_RD should be removed as it doesn't return anything to the caller. If the request should be fixed instead then this commit should be reverted and new_status should be returned to whoever submitted the request. Differential Revision: https://reviews.freebsd.org/D34840 (cherry picked from commit 540ac338d5575131d134d2c033f31b5d6d576c68) --- sys/dev/usb/input/uhid_snes.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sys/dev/usb/input/uhid_snes.c b/sys/dev/usb/input/uhid_snes.c index 9bce3d10941f..d786b0e1f257 100644 --- a/sys/dev/usb/input/uhid_snes.c +++ b/sys/dev/usb/input/uhid_snes.c @@ -94,7 +94,6 @@ struct uhid_snes_softc { int sc_fflags; struct usb_fifo *sc_fifo_open[2]; uint8_t sc_zero_length_packets; - uint8_t sc_previous_status; uint8_t sc_iid; uint8_t sc_oid; uint8_t sc_fid; @@ -498,7 +497,6 @@ uhid_snes_status_callback(struct usb_xfer *transfer, usb_error_t error) struct uhid_snes_softc *sc = usbd_xfer_softc(transfer); struct usb_device_request req; struct usb_page_cache *pc; - uint8_t current_status, new_status; switch (USB_GET_STATE(transfer)) { case USB_ST_SETUP: @@ -517,13 +515,6 @@ uhid_snes_status_callback(struct usb_xfer *transfer, usb_error_t error) usbd_transfer_submit(transfer); break; - case USB_ST_TRANSFERRED: - pc = usbd_xfer_get_frame(transfer, 1); - usbd_copy_out(pc, 0, ¤t_status, 1); - new_status = current_status & ~sc->sc_previous_status; - sc->sc_previous_status = current_status; - break; - default: break; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202304300657.33U6vjqk071380>