From nobody Wed Nov 24 21:38:59 2021 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id AA92218AF85D; Wed, 24 Nov 2021 21:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HzvXN1P04z4VWf; Wed, 24 Nov 2021 21:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 0FE24116FA; Wed, 24 Nov 2021 21:39:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1AOLcxDA036733; Wed, 24 Nov 2021 21:38:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOLcxss036732; Wed, 24 Nov 2021 21:38:59 GMT (envelope-from git) Date: Wed, 24 Nov 2021 21:38:59 GMT Message-Id: <202111242138.1AOLcxss036732@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 943df073a348 - main - LinuxKPI: USB return possible error from suspend/resume List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 943df073a348bcb1e701c3677536f913761d4123 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637789940; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=6v8tiEeEtPdt4HXFdqBi/aAtBKDvE33H55r0BWGcHWQ=; b=V/RBxubZFoq30nmycAczpG3ujhgv5Cp2DcdhJ3C6bwHFpAhWkNq+CF7Ffs/SEveCUApJkC tQh9t9g0qofKNnqp/4cG3m1XBJh1G5CBj66uQl+UGGnTQrDxlQ0HWQpe3jCzv4btq7CQ5g Up+1Ab0DZUXzpzUNGUHvAreKV7RguCK9DiTjgTPo+iuBW1oPz1FwB5ipyZgGydOSVcbJ9u TLQwsmwgKWbU1RQ7CZVTB9MrBL9BDWAWAKqtUgtepgHmOwVQj3WGWZIpMkAiJpfEEENGdh KWrGw3QEtOYMAqpv1zeFYxo9qMNFXCmjoUVhoPlhruGh13k73rlmvani2XTdyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637789940; a=rsa-sha256; cv=none; b=e35+RZtSbb4SnHyks86EXV2aLt0TbK+0Y92nIUUh8hW5lFBCnOGngqE/V0jxQT2ap0LG3S 504vJtIULtqRyIuac7qySJf1/crQhxFQp6t+JVzKFMZWcQVxqoYmJiHVw2qofZkhSJ0QnW LgjduGEYpkbqI8Hp4ews70xBs772vvBSAGe8P15K28JF650Qvr/5g6ynKZQ9e/vlRqVg38 oVFGRHz0odRhRI06sgZbmJC6eRhsccugEaEE07FSHguuvXxghu2AL+qbx7jW28i926Mi2p 7VBtMiqnN4gUzP1xQkpt8QipXVJ8+D+GRmHmx4VclRrNL7MDbtSpqgdXAoKc+Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=943df073a348bcb1e701c3677536f913761d4123 commit 943df073a348bcb1e701c3677536f913761d4123 Author: Bjoern A. Zeeb AuthorDate: 2021-11-24 21:28:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-11-24 21:32:38 +0000 LinuxKPI: USB return possible error from suspend/resume USB suspend/resume cannot fail so we never returned the error which resulted in a -Wunused-but-set-variable warning. Initialize the return variable and return a possible error possibly triggering a printf upstream to at least have a trace of the problem. This also fixes the warning. Suggested by: hselasky Sponsored by: The FreeBSD Foundation MFC after: 10 days Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D33107 --- sys/compat/linuxkpi/common/src/linux_usb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_usb.c b/sys/compat/linuxkpi/common/src/linux_usb.c index 11f400bc2c52..72aa561fcfbb 100644 --- a/sys/compat/linuxkpi/common/src/linux_usb.c +++ b/sys/compat/linuxkpi/common/src/linux_usb.c @@ -343,10 +343,10 @@ usb_linux_suspend(device_t dev) struct usb_driver *udrv = usb_linux_get_usb_driver(sc); int err; - if (udrv && udrv->suspend) { + err = 0; + if (udrv && udrv->suspend) err = (udrv->suspend) (sc->sc_ui, 0); - } - return (0); + return (-err); } /*------------------------------------------------------------------------* @@ -361,10 +361,10 @@ usb_linux_resume(device_t dev) struct usb_driver *udrv = usb_linux_get_usb_driver(sc); int err; - if (udrv && udrv->resume) { + err = 0; + if (udrv && udrv->resume) err = (udrv->resume) (sc->sc_ui); - } - return (0); + return (-err); } /*------------------------------------------------------------------------*