From nobody Thu Dec 30 19:22:33 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 51AA3191F603; Thu, 30 Dec 2021 19:22:35 +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 4JPypL2Rgxz3Bnm; Thu, 30 Dec 2021 19:22:33 +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 C2F411DF5A; Thu, 30 Dec 2021 19:22:33 +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 1BUJMXpR017260; Thu, 30 Dec 2021 19:22:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1BUJMXaw017259; Thu, 30 Dec 2021 19:22:33 GMT (envelope-from git) Date: Thu, 30 Dec 2021 19:22:33 GMT Message-Id: <202112301922.1BUJMXaw017259@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 2c6ebb783462 - stable/13 - 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 2c6ebb783462a2776823fc4c629c98c657014108 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1640892154; 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=9bnKgNnZg26A1Cf0oJVMZo0LcANKAW6skJb1czEtoUI=; b=f958zB2nDe86iqc35nuuADgweKd9NffFETNPkQZd7pmAcgM43l+kT9IaQo1gd4SlfO2Mn9 WKzsVSK7H2YamjmPf1lmvEVJq2r2rg/7ueTLhzt7qipmOr2X0Ni8/ncDYAYK+UgDTZ0oog NcAxVb7vw+0Lu2KVCvykzUS9Fd/VRXpmzD4qXqwSzfh7sc4L6zEbPEaG3H5osmma/vBCEG U1quYKADENY5yXI9/48FlbGZxECNQANez31jGroI3C49/lAaOalDufCixR8i+dyQirL4Ge nyciyWlCQdQk2mTAJ6OFm5UHY++hPZKnrJ5bPzFDKYC2QpxVBs1vivvZdEklQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1640892154; a=rsa-sha256; cv=none; b=SB6OjGP+HLPC1irZKyUkYmRiip12Tmh+lKtHO2q1MHcHRWXbcU5kXXKe30G+RUTCNPUua+ 34qATLX1t74epWIJ3yVzte6qoZCh8YA7vm0pRiIWD+hZHEjYDOD3x8yoHbLMtT0Qv/S8eU GqM+MELmL1gjNFypUj6xW+bqOz1Dkt39R7mL/F+Ec8FjI18MByYZYsE7lMWr+jhAy+K4Cu aoFKwGrsjn7+iMS69IcT0w2VOA2sejMIWrLUIutGf0FBnJBQwSdEmjQujk0OGVIOKMOYEY vgC+RVkUwtWp6IGEHX4gqlLvXZQ1Gb0zypI0QCjYFbY566lTCH/UPBdRti+w6w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=2c6ebb783462a2776823fc4c629c98c657014108 commit 2c6ebb783462a2776823fc4c629c98c657014108 Author: Bjoern A. Zeeb AuthorDate: 2021-11-24 21:28:46 +0000 Commit: Bjoern A. Zeeb CommitDate: 2021-12-30 18:25:28 +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 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D33107 (cherry picked from commit 943df073a348bcb1e701c3677536f913761d4123) --- 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); } /*------------------------------------------------------------------------*