Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754281AbbHEURz (ORCPT ); Wed, 5 Aug 2015 16:17:55 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:57980 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753799AbbHEURx (ORCPT ); Wed, 5 Aug 2015 16:17:53 -0400 Date: Wed, 5 Aug 2015 02:38:00 -0700 From: Darren Hart To: Azael Avalos Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/5] toshiba_acpi: Remove "*not supported" feature prints Message-ID: <20150805093800.GA12131@vmdeb7> References: <1438401496-27744-1-git-send-email-coproscefalo@gmail.com> <1438401496-27744-3-git-send-email-coproscefalo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1438401496-27744-3-git-send-email-coproscefalo@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2079 Lines: 50 On Fri, Jul 31, 2015 at 09:58:13PM -0600, Azael Avalos wrote: > Currently the driver prints "*not supported" if any of the features > queried are in fact not supported, let us print the available > features instead. > > This patch removes all instances pr_info printing "*not supported", > and add a new function called "print_supported_features", which will > print the available laptop features. > > Signed-off-by: Azael Avalos > --- > drivers/platform/x86/toshiba_acpi.c | 72 +++++++++++++++++++++++-------------- > 1 file changed, 46 insertions(+), 26 deletions(-) > > diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c > index d983dc4..66b596a 100644 > --- a/drivers/platform/x86/toshiba_acpi.c > +++ b/drivers/platform/x86/toshiba_acpi.c > @@ -459,7 +459,7 @@ static void toshiba_illumination_available(struct toshiba_acpi_dev *dev) > if (ACPI_FAILURE(status)) > pr_err("ACPI call to query Illumination support failed\n"); > else if (out[0] == TOS_NOT_SUPPORTED) > - pr_info("Illumination device not available\n"); > + return; > else if (out[0] == TOS_SUCCESS) > dev->illumination_supported = 1; > } > @@ -483,7 +483,6 @@ static void toshiba_illumination_set(struct led_classdev *cdev, > pr_err("ACPI call for illumination failed\n"); > return; > } else if (result == TOS_NOT_SUPPORTED) { > - pr_info("Illumination not supported\n"); > return; > } I mentioned this in the previous review. For several of these, we have an if statement that checks for a condition, and then returns, which is exactly what would happen if we didn't have the if statement at all. If the context is important, a comment should be sufficient. Is there a compelling reason to add the redundant check? -- Darren Hart Intel Open Source Technology Center -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/