Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp1082275ybe; Mon, 2 Sep 2019 14:09:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqxsUpOPL2nOZyrpJXCgn3eD9PpYIFXFVIs0KnLkB7jtPosemr1hvOgphP5ilLB6m76j739I X-Received: by 2002:a62:1511:: with SMTP id 17mr9518543pfv.119.1567458573670; Mon, 02 Sep 2019 14:09:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567458573; cv=none; d=google.com; s=arc-20160816; b=i855lCDMRs7CaZBqQS4rReqREqYLt7cd3s24OEya6hC49HbzHEya/fDamzcKL6kaaO IgXMD2QGk6k7FMx23SV5od4GMo9LQSRN8uxOo+FUdZd7anjBLW5GFa5+10dDZW8Y2YvI f/xu1TMwbrV6APBN9UZsYGuNTrGefLP6Onzons7Hdp4Lnt6Jq/7/AjmEmU/GHzEouOYg IT6PdfQXD5oVi0rF0lO+tcR/q7+dRuwyozmOVg5cMRio3581RClFreMkcG9oafjnX3IH XnURksA5Dfhnc88x0SvXe4kGeEPmIRc0dOiVki0zr4hHhpRLcVSqZAT1d2DXsjHYgrD6 VYTg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=huTQD+G6wSs8hXbu4stIdO9xW+9jjAIMQ/j2IBKOSLs=; b=SQ9WxQwyRe5vtRcXPQbwUdCuRxspUbmH7aoHJ5x+QffuzYixUacXzz7UpEiFzDsCjA XU+acpYYKzv7158u0oSrjBUAWTMoYf9Xju2MtF59NHMXfnlJMEs33ZCLt0UwcsZrXSLD fByOlb5y39eyUvJiWYu6y90CDcJuOCaJGQOu9elpxcDdHlSh+2KH6FvsiU+YtOvXjT9v 0Ku9mF6CxX+Xr4/wmcS9fkksLnVTVSOxLDoqqby0zBNrayxfjhxK2vwojolsHHWjZyD8 Xy52uVoBTgBTvoXaK/5Gncrxz6JeEFjzMkQHUu2aY/4lns4nmNyMFKro4pijjYaVR4PX WlZg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (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 l40si12696092plb.205.2019.09.02.14.09.18; Mon, 02 Sep 2019 14:09:33 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727499AbfIBVIV (ORCPT + 99 others); Mon, 2 Sep 2019 17:08:21 -0400 Received: from mail-ot1-f67.google.com ([209.85.210.67]:35669 "EHLO mail-ot1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726964AbfIBVIU (ORCPT ); Mon, 2 Sep 2019 17:08:20 -0400 Received: by mail-ot1-f67.google.com with SMTP id 100so14719013otn.2; Mon, 02 Sep 2019 14:08:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=huTQD+G6wSs8hXbu4stIdO9xW+9jjAIMQ/j2IBKOSLs=; b=kGdy5a6AxvT29kVSZ2Kida0dWzlyvLm2AgBkZrYN9pf7HnDv9MfF345a+0CKCigvWF CL1bNb8UEGH3t3ws7yGOul2dULhL3pS7ar+AiP3+x0p4oDRTngpwPOv5IVz+/CYiJOAx fY2Z2JUgCvs7HiQLDLSzMlBEBK95cG2gt3OnQMP7a+8sKU3vnvPuHS3UgzW9c1X/vNSd Bi39o+TKfx1+fltm4JGm3yZ7OzMo0B9K8L5AKm2mgYZ3AA2+IH2BYHP7Xz7Jk+eax+dK 0w6g7FSG38HxRssA7lEMRA4o6cpBpZs28wKiYpZO/wM787ILchCaQJ805OuTghwHzvMn wacw== X-Gm-Message-State: APjAAAXLxzdB5swd05MTJqInq8SQCSgIM3hFSrkFATmawv8Ny7j+qTog UhN1UZ2SdtbwqCCK9ZGINA4xg6364tcjiaMojAI= X-Received: by 2002:a05:6830:154:: with SMTP id j20mr26200025otp.266.1567458499533; Mon, 02 Sep 2019 14:08:19 -0700 (PDT) MIME-Version: 1.0 References: <20190722023530.67676-1-skunberg.kelsey@gmail.com> <20190722023530.67676-2-skunberg.kelsey@gmail.com> <20190722182929.GA203187@google.com> In-Reply-To: <20190722182929.GA203187@google.com> From: "Rafael J. Wysocki" Date: Mon, 2 Sep 2019 23:08:08 +0200 Message-ID: Subject: Re: [PATCH 1/3] ACPI: Remove acpi_has_method() call from acpi_adxl.c To: Bjorn Helgaas Cc: "Rafael J. Wysocki" , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Sorry for the delayed reply. On Mon, Jul 22, 2019 at 8:29 PM Bjorn Helgaas wrote: > > [+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); You have a point, but then I would expect the changelog to mention that. As it stands, the patch does more than the changelog says, which isn't nice.