diff options
author | Bjoern A. Zeeb <bz@FreeBSD.org> | 2021-11-24 21:20:52 +0000 |
---|---|---|
committer | Bjoern A. Zeeb <bz@FreeBSD.org> | 2021-11-24 21:32:38 +0000 |
commit | 7043359ce3c1e56ed55c8b41867a14a418511a05 (patch) | |
tree | 676603c22292207c6486f88f2bf4e6bb16a7257d | |
parent | 873606999f880afbc9b9eae85ee7737aead57b83 (diff) | |
download | src-7043359ce3c1e56ed55c8b41867a14a418511a05.tar.gz src-7043359ce3c1e56ed55c8b41867a14a418511a05.zip |
LinuxKPI: fix -Wunused-but-set-variable warnings
Handle write-only variables by removing the unused return value from void
functions or removing the unused variables entirely.
Sponsored by: The FreeBSD Foundation
MFC after: 10 days
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D33107
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_firmware.c | 3 | ||||
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_pci.c | 4 | ||||
-rw-r--r-- | sys/compat/linuxkpi/common/src/linux_usb.c | 8 |
3 files changed, 4 insertions, 11 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_firmware.c b/sys/compat/linuxkpi/common/src/linux_firmware.c index d779b509105e..47cccd42da20 100644 --- a/sys/compat/linuxkpi/common/src/linux_firmware.c +++ b/sys/compat/linuxkpi/common/src/linux_firmware.c @@ -150,7 +150,6 @@ lkpi_fw_task(void *ctx, int pending) { struct lkpi_fw_task *lfwt; const struct linuxkpi_firmware *fw; - int error; KASSERT(ctx != NULL && pending == 1, ("%s: lfwt %p, pending %d\n", __func__, ctx, pending)); @@ -159,7 +158,7 @@ lkpi_fw_task(void *ctx, int pending) if (lfwt->cont == NULL) goto out; - error = _linuxkpi_request_firmware(lfwt->fw_name, &fw, lfwt->dev, + _linuxkpi_request_firmware(lfwt->fw_name, &fw, lfwt->dev, lfwt->gfp, true, true); /* diff --git a/sys/compat/linuxkpi/common/src/linux_pci.c b/sys/compat/linuxkpi/common/src/linux_pci.c index 8ec6a5af2140..bf28c10fbf96 100644 --- a/sys/compat/linuxkpi/common/src/linux_pci.c +++ b/sys/compat/linuxkpi/common/src/linux_pci.c @@ -1063,11 +1063,9 @@ dma_pool_obj_import(void *arg, void **store, int count, int domain __unused, int flags) { struct dma_pool *pool = arg; - struct linux_dma_priv *priv; struct linux_dma_obj *obj; int error, i; - priv = pool->pool_device->dma_priv; for (i = 0; i < count; i++) { obj = uma_zalloc(linux_dma_obj_zone, flags); if (obj == NULL) @@ -1090,11 +1088,9 @@ static void dma_pool_obj_release(void *arg, void **store, int count) { struct dma_pool *pool = arg; - struct linux_dma_priv *priv; struct linux_dma_obj *obj; int i; - priv = pool->pool_device->dma_priv; for (i = 0; i < count; i++) { obj = store[i]; bus_dmamem_free(pool->pool_dmat, obj->vaddr, obj->dmamap); diff --git a/sys/compat/linuxkpi/common/src/linux_usb.c b/sys/compat/linuxkpi/common/src/linux_usb.c index e93559f95264..11f400bc2c52 100644 --- a/sys/compat/linuxkpi/common/src/linux_usb.c +++ b/sys/compat/linuxkpi/common/src/linux_usb.c @@ -1185,15 +1185,14 @@ usb_linux_free_device(struct usb_device *dev) { struct usb_host_endpoint *uhe; struct usb_host_endpoint *uhe_end; - int err; uhe = dev->linux_endpoint_start; uhe_end = dev->linux_endpoint_end; while (uhe != uhe_end) { - err = usb_setup_endpoint(dev, uhe, 0); + usb_setup_endpoint(dev, uhe, 0); uhe++; } - err = usb_setup_endpoint(dev, &dev->ep0, 0); + usb_setup_endpoint(dev, &dev->ep0, 0); free(dev->linux_endpoint_start, M_USBDEV); } @@ -1276,7 +1275,6 @@ usb_linux_cleanup_interface(struct usb_device *dev, struct usb_interface *iface) struct usb_host_interface *uhi_end; struct usb_host_endpoint *uhe; struct usb_host_endpoint *uhe_end; - int err; uhi = iface->altsetting; uhi_end = iface->altsetting + iface->num_altsetting; @@ -1284,7 +1282,7 @@ usb_linux_cleanup_interface(struct usb_device *dev, struct usb_interface *iface) uhe = uhi->endpoint; uhe_end = uhi->endpoint + uhi->desc.bNumEndpoints; while (uhe != uhe_end) { - err = usb_setup_endpoint(dev, uhe, 0); + usb_setup_endpoint(dev, uhe, 0); uhe++; } uhi++; |