From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AF9DFC3A59B for ; Fri, 30 Aug 2019 18:17:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D9B02342F for ; Fri, 30 Aug 2019 18:17:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727791AbfH3SRE (ORCPT ); Fri, 30 Aug 2019 14:17:04 -0400 Received: from mga05.intel.com ([192.55.52.43]:7946 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727246AbfH3SRD (ORCPT ); Fri, 30 Aug 2019 14:17:03 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Aug 2019 11:17:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,447,1559545200"; d="scan'208";a="382093729" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga006.fm.intel.com with ESMTP; 30 Aug 2019 11:17:00 -0700 Received: from andy by smile with local (Exim 4.92.1) (envelope-from ) id 1i3lSF-0002tl-7k; Fri, 30 Aug 2019 21:16:59 +0300 Date: Fri, 30 Aug 2019 21:16:59 +0300 From: Andy Shevchenko To: Peter Cai Cc: Mika Westerberg , Linus Walleij , Bartosz Golaszewski , Bastien Nocera , Dmitry Torokhov , "Rafael J. Wysocki" , Len Brown , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org Subject: Re: [PATCH 2/2] touchscreen: goodix: define GPIO mapping for GPD P2 Max Message-ID: <20190830181659.GO2680@smile.fi.intel.com> References: <20190830000024.20384-1-peter@typeblog.net> <20190830000024.20384-2-peter@typeblog.net> <20190830115505.GX2680@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org On Fri, Aug 30, 2019 at 11:15:27PM +0800, Peter Cai wrote: > On Fri, Aug 30, 2019, 7:55 PM Andy Shevchenko < > andriy.shevchenko@linux.intel.com> wrote: > > I guess most of these #ifdef:s makes code less readable for exchange of > saving > few bytes in the module footprint. > > Well since they can only be used when ACPI is supported > (devm_acpi_dev_add_driver_gpios does not exist without ACPI defined, thus > the last guard must exist), This is not correct. > if they were not guarded then we would be left > with a bunch of unused variables warnings when building without ACPI which > doesn't seem good. Good / no-good is only matter of few dozens of bytes here and there to be saved. > Should we use __maybe_unused here instead of #ifdef guards? No, it won't make sense, because the structures will be part of _add_driver_gpio() call, due to which compiler likely can't recognize unused structures. However, you may try with warnings enabled `make W=1`. > > Comma at the end? > > I was trying to follow the style of this driver but it doesn't seem to be > really consistent within itself. Another dmi_system_id definition in the > same file mixed both styles so I was kind of confused. I see. So, this is for Dmitry's preferences. -- With Best Regards, Andy Shevchenko