From nobody Wed Nov 24 18:43:10 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 0477418A1622; Wed, 24 Nov 2021 18:43:12 +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 4HzqdW3H0Qz3tYw; Wed, 24 Nov 2021 18:43:11 +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 08DCA7387; Wed, 24 Nov 2021 18:43:11 +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 1AOIhA4C007936; Wed, 24 Nov 2021 18:43:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1AOIhAhI007935; Wed, 24 Nov 2021 18:43:10 GMT (envelope-from git) Date: Wed, 24 Nov 2021 18:43:10 GMT Message-Id: <202111241843.1AOIhAhI007935@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Marcin Wojtas Subject: git: d9ed1dcc5c68 - main - acpi: Fix error code returned in acpi_bus_get_prop 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: mw X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9ed1dcc5c6894e376e6e4ef6f2554dd056baf4e Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1637779391; 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=JkKNz2vQO6AtMXzHUGUfnzLhwDRKJso0vB5DpLVHev8=; b=OWq1czzU+x6NrppjvLUbwHu0DdsPSJNf7Y3DkoA4GToNaiC8/SvO9DhMOKRk0hXq4uhxEu R/ZeVOZMojftt0X3hDyRWuz0I7gfVnbjjVOZgmkBeFKqDsAAkoGOh2Vw2ypUJuTJW2O1dT 9G/fbVwq/LUBhCvApvgd5A27LhvE3N7/PnG648qUnREFNLzFJflRLL2Qr5amgOOwupwDQY pl32rr/mpF5bxb1MJKI/i+tRboSxlj9GK+l3Vs02dLzQcx55AquyzzOUEbOWfNCy591M+U 8DoRgAUmG4ZE5XCYNZF56nT8wDwQ43CZKGxF3K6yQhhW8ARNiTPAHO3ltabJ9Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1637779391; a=rsa-sha256; cv=none; b=golwDNr8RRADX7br+IMOJ+n4LRQZR+Vi/n69irzJy4Z4iFir7n+/qVeDsi77W2a+iL3evQ vko3DRZz2QCqtqSUdEweD7HAdpT12bBPotj5Yo+9CFv0NE4xa0naGFf740+h7gPg7NfHVL MHKuzv+54+/XcKw8COEp2vTNDQ/sFqAQ0zNLlvF0WoMCMSu9NdavzpXljiR9yahMCU+ozs yrWkB7UfR9472VuMuAkTPUnaqoGqgGml+vhBtL6yGrLfsY1KU3e3Ud+G73r4Gx56DLPIxU tEjd8+XZWaMiQRr5MHC5fkp47GjQTMilcGPW+92MIHtDF46p+raxJvIsV5lJHA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mw: URL: https://cgit.FreeBSD.org/src/commit/?id=d9ed1dcc5c6894e376e6e4ef6f2554dd056baf4e commit d9ed1dcc5c6894e376e6e4ef6f2554dd056baf4e Author: Bartlomiej Grzesik AuthorDate: 2021-11-22 14:05:57 +0000 Commit: Marcin Wojtas CommitDate: 2021-11-24 18:42:43 +0000 acpi: Fix error code returned in acpi_bus_get_prop ACPI implementation of device_get_property would return "-1" when property was found, but it's type wasn't supported. This causes device_has_property to return false in that scenario, which arguably could be considered as incorrect. Fix that by returning "0" in that case. Reviewed by: bz, mw Tested by: mw MFC after: 2 weeks Obtained from: Semihalf Differential Revision: https://reviews.freebsd.org/D33103 --- sys/dev/acpica/acpi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index 5d2b895bbe88..9b728b84bd12 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -1849,9 +1849,10 @@ acpi_bus_get_prop(device_t bus, device_t child, const char *propname, memcpy(propvalue, obj->Buffer.Pointer, MIN(size, obj->Buffer.Length)); return (obj->Buffer.Length); - } - return (-1); + default: + return (0); + } } int