Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7668965ybi; Mon, 22 Jul 2019 18:09:48 -0700 (PDT) X-Google-Smtp-Source: APXvYqyIJ0HGVaT1NcSnshf2MszcPdl3My/ba8B85B1HEMrdZbbJlLAD3CpbTs08mrrM1NBo/5V8 X-Received: by 2002:a62:63c7:: with SMTP id x190mr2912225pfb.181.1563844188763; Mon, 22 Jul 2019 18:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563844188; cv=none; d=google.com; s=arc-20160816; b=ezZmXV4F+ni26b/YMvac7rNOnol85r/rB5c90UOEWMLtLDlKLKndMb2hlWkAwyAFd0 gtoQJjqX7XHjjGE6OBkc8bR/FtSSNduIY60fA5cSyEvdOLmlXw+iojzY+0VZShTUlEh+ UuuBab2nh8LYNut3+Db3n6LUy2U7GcA0eks3i2x7DwlhSX0cvPr8FqH1AZvH3QhAZWog mHy6Q8fLear331O8k7dFsp4zZjfbPY0k/lsL41vJI6KO8br7XsmP5Vp4QLSCSUHqnkTW YeiNb94UcVq3c01pp2q/AdY9UatjkdVNe/YqvgdeQSdDDqymoH2N/tuIqt4y0+iH0Ugk XLLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=YnbwJkAwP6AnnEWCSTodgdkjen1LnubBN/JZs3xJcJw=; b=dyrP2zo7tXSOgi8GRg15I3KyqRo+wCFpqILb/rILh9XijxB4a7/3AHyqJp66GtJwZB U2oqUFGYU83+0Rm6g6ZQ8hyYol+wplzf9Z/cGIDvGXoJ46+swNebECnHzf/l7S055ccR Bvrc09BXhri6ACwsr3MIHLHrMM6xM+r2VFSvRR2bYSCFlofAJg22rfb1nDk3p050U6vv uLauKsCu9SORMEVvv3GjQ/KqGg3ez3WcRnmhZ78f8/6zcqcrfbf8v7NVeQpChxuAm13C 3Bj82X51q7Vnr8fMK7/zu24PjZn3B06xQsCvyAHTpaHhUCRos+/eK03y36eMZmR/tw2W AB0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vhTa47Ce; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8si13730834pjp.61.2019.07.22.18.09.32; Mon, 22 Jul 2019 18:09:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vhTa47Ce; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728895AbfGVS3c (ORCPT + 99 others); Mon, 22 Jul 2019 14:29:32 -0400 Received: from mail.kernel.org ([198.145.29.99]:36014 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726291AbfGVS3b (ORCPT ); Mon, 22 Jul 2019 14:29:31 -0400 Received: from localhost (unknown [69.71.4.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B079C21901; Mon, 22 Jul 2019 18:29:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563820170; bh=+hifrCpXNdFDmg+2TTik5WppGirIpU+5Uvg26SzjKVE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=vhTa47Ce9ebRm+v7XyDzUzwiDS0FQgPMYhqKwa9e9Z4mpUb10rR+yojuJNMWvy1TQ MsFuzBhgW67dm/N4kDZz4s+8RJPUtNax345vprI4ifpLfuDqsnmMzen4WCxkPSDygW XbQ2jEfqPZ1eCmlLmVf182HY8+oQceSB7grwkJgo= Date: Mon, 22 Jul 2019 13:29:29 -0500 From: Bjorn Helgaas To: "Rafael J. Wysocki" Cc: Kelsey Skunberg , "Rafael J. Wysocki" , Len Brown , ACPI Devel Mailing List , Linux Kernel Mailing List , skhan@linuxfoundation.org, linux-kernel-mentees@lists.linuxfoundation.org, bjorn@helgaas.com, Tony Luck , Borislav Petkov Subject: Re: [PATCH 1/3] ACPI: Remove acpi_has_method() call from acpi_adxl.c Message-ID: <20190722182929.GA203187@google.com> References: <20190722023530.67676-1-skunberg.kelsey@gmail.com> <20190722023530.67676-2-skunberg.kelsey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [+cc Tony (original author), Borislav (merged original patch)] On Mon, Jul 22, 2019 at 10:31:11AM +0200, Rafael J. Wysocki wrote: > On Mon, Jul 22, 2019 at 4:36 AM Kelsey Skunberg > wrote: > > > > acpi_check_dsm() will already return an error if the DSM method does not > > exist. Checking if the DSM method exists before the acpi_check_dsm() call > > is not needed. Remove acpi_has_method() call to avoid additional work. > > > > Signed-off-by: Kelsey Skunberg > > --- > > drivers/acpi/acpi_adxl.c | 5 ----- > > 1 file changed, 5 deletions(-) > > > > diff --git a/drivers/acpi/acpi_adxl.c b/drivers/acpi/acpi_adxl.c > > index 13c8f7b50c46..89aac15663fd 100644 > > --- a/drivers/acpi/acpi_adxl.c > > +++ b/drivers/acpi/acpi_adxl.c > > @@ -148,11 +148,6 @@ static int __init adxl_init(void) > > return -ENODEV; > > } > > > > - if (!acpi_has_method(handle, "_DSM")) { > > - pr_info("No DSM method\n"); > > And why is printing the message not useful? > > > - return -ENODEV; > > - } > > - > > if (!acpi_check_dsm(handle, &adxl_guid, ADXL_REVISION, > > ADXL_IDX_GET_ADDR_PARAMS | > > ADXL_IDX_FORWARD_TRANSLATE)) { The next line of context (not included in the patch): pr_info("DSM method does not support forward translate\n"); IMHO kernel messages that are just a constant string, with no context or variable part (device ID, path, error code, etc) are questionable in general. Is there any dev_printk()-like thing that takes an acpi_handle? Seems like that would be useful for cases like this. This message *does* include an "ADXL: " prefix (from the pr_fmt definition), and from reading the code you can see that the only possible method is "\_SB.ADXL._DSM". There's nothing an end user can do with these messages, so I suspect their value is for debugging during platform bringup, and it would be sufficient to drop the first one (as Kelsey's patch does) and change the second one like this: - pr_info("DSM method does not support forward translate\n"); + pr_info("%s DSM missing or does not support forward translate\n", + path);