From patchwork Thu Jun 13 01:55:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 166714 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp993976ilk; Thu, 13 Jun 2019 09:55:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZSm+E12ennAudznXAHWga6pjNW7EgwhAH5pRO9z/pGxDIOpe9zddzvIZP+b9Yq37GdXKU X-Received: by 2002:a17:902:7d86:: with SMTP id a6mr64534280plm.199.1560444951134; Thu, 13 Jun 2019 09:55:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560444951; cv=none; d=google.com; s=arc-20160816; b=cTOEwL+nn14gZ0kzn9l8m7UUgblKUuHoRUFa0Lo5ah/3WGethOj4j0/H3sjlti8NaU nuWjU+LG5psnkyEFqi/fKXIdjSDnRvgozH7WUoQRSB54J9tZ9SgFVJchZtRyRiV0BPDH hoBcQ5y+CoGAtEczuasx9A/KdLWkWk8tDJ9HWCRnMa8Ba3U4uhdjrlm9G45uJI8FYK3Z l0HuwRIRHGJ/SJckVrKqURCNJKiqlCp3m5024j6R3GbcAYWl8wjAHiGK6K60Vdjt6bAi hIxt9uJCXf+ASOBCFEvPLqAOjc+TS9tCXpxJwAvU2WQVISVSlcXL62f3Rw9coatgA0AO ntdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=pt+Nr64T0NPrCAcdTorRfTpUgTXiQs3U70zfvyWcj80=; b=wjLrQXCxh+LKkdMi+zljdba2g87jjEaHZfSL+S6ydRpxhF/UDvpCRoIfJEoAi8J/BO shK8LwUR0p/dPk8+dWRDqE8gVsBwkkXVPBx1vncz9NxFJM1l2QHXm9XhDs/hRiZqF5PA IYR5hZOJ9SPJBNdOY+CXPNR2xXgDNgpyARaglVGKkVi2yCrI01sKkutrxZlE7LqMLPrI BGW6Etpee2j9bVFuRCUNGjqMBhBhwWyDftyOPKsucjlA51n+oqBZgl67jQgdhsl9ZqAq Pq9lbOiBWiwyu7q6BdOW87FbeIbGg16WjD87nXM26te6SEYGg9se636qdQI38m0Z+NjT 6SkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=DkY1vevy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si98774pfc.158.2019.06.13.09.55.50; Thu, 13 Jun 2019 09:55:51 -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=@nifty.com header.s=dec2015msa header.b=DkY1vevy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730196AbfFMQzu (ORCPT + 24 others); Thu, 13 Jun 2019 12:55:50 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:39796 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729987AbfFMB4D (ORCPT ); Wed, 12 Jun 2019 21:56:03 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x5D1tauk028457; Thu, 13 Jun 2019 10:55:36 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x5D1tauk028457 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1560390936; bh=pt+Nr64T0NPrCAcdTorRfTpUgTXiQs3U70zfvyWcj80=; h=From:To:Cc:Subject:Date:From; b=DkY1vevyYgmJYUcdyPap7f3JBGtDDwKAZ/T9Kk1KM2D9m6+7n8+c6hcASnD9UK+XP sPpOkhJtm9MH8GURhyTKynRJk8cSIYauztgvWH+JXtGCkAhnxxg8k/os/Lylq2sNcj SgdL5sH05qqOLg3jJUrZMNTCg0JxWNOgYO89jQ+p2R4WwJkXD4rtBNDKMOFtAGnedn KCSlPL58ZHNT0xp3Gomz2mB1kn3F7Ym+pQDjaqJ2vpaG3jW6ekz1SoGg+Scz2uW2H8 QvxaunFuhiBaceGmlfa5WuvwawWn0dZ6Gqb/fqdEFN5UDCjX9E1eXLOTB1lEaBy+YD At7SpFraePWMA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-gpio@vger.kernel.org, Linus Walleij Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 1/2] pinctrl: remove unneeded #ifdef around declarations Date: Thu, 13 Jun 2019 10:55:31 +0900 Message-Id: <20190613015532.19685-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org What is the point in surrounding the whole of declarations with ifdef like this? #ifdef CONFIG_FOO int foo(void); #endif If CONFIG_FOO is not defined, all callers of foo() will fail with implicit declaration errors since the top Makefile adds -Werror-implicit-function-declaration to KBUILD_CFLAGS. This breaks the build earlier when you are doing something wrong. That's it. Anyway, it will fail to link since the definition of foo() is not compiled. In summary, these ifdef are unneeded. Signed-off-by: Masahiro Yamada --- include/linux/pinctrl/pinconf-generic.h | 20 ++++++-------------- include/linux/pinctrl/pinconf.h | 4 ---- include/linux/pinctrl/pinctrl.h | 4 ---- include/linux/pinctrl/pinmux.h | 4 ---- 4 files changed, 6 insertions(+), 26 deletions(-) -- 2.17.1 diff --git a/include/linux/pinctrl/pinconf-generic.h b/include/linux/pinctrl/pinconf-generic.h index 6f260c1d3467..b55231993d24 100644 --- a/include/linux/pinctrl/pinconf-generic.h +++ b/include/linux/pinctrl/pinconf-generic.h @@ -11,6 +11,12 @@ #ifndef __LINUX_PINCTRL_PINCONF_GENERIC_H #define __LINUX_PINCTRL_PINCONF_GENERIC_H +#include +#include + +struct pinctrl_dev; +struct pinctrl_map; + /** * enum pin_config_param - possible pin configuration parameters * @PIN_CONFIG_BIAS_BUS_HOLD: the pin will be set to weakly latch so that it @@ -155,9 +161,6 @@ static inline unsigned long pinconf_to_config_packed(enum pin_config_param param return PIN_CONF_PACKED(param, argument); } -#ifdef CONFIG_GENERIC_PINCONF - -#ifdef CONFIG_DEBUG_FS #define PCONFDUMP(a, b, c, d) { \ .param = a, .display = b, .format = c, .has_arg = d \ } @@ -168,14 +171,6 @@ struct pin_config_item { const char * const format; bool has_arg; }; -#endif /* CONFIG_DEBUG_FS */ - -#ifdef CONFIG_OF - -#include -#include -struct pinctrl_dev; -struct pinctrl_map; struct pinconf_generic_params { const char * const property; @@ -220,8 +215,5 @@ static inline int pinconf_generic_dt_node_to_map_all( return pinconf_generic_dt_node_to_map(pctldev, np_config, map, num_maps, PIN_MAP_TYPE_INVALID); } -#endif - -#endif /* CONFIG_GENERIC_PINCONF */ #endif /* __LINUX_PINCTRL_PINCONF_GENERIC_H */ diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h index 514414a5ad01..eb16a1e0bcfa 100644 --- a/include/linux/pinctrl/pinconf.h +++ b/include/linux/pinctrl/pinconf.h @@ -11,8 +11,6 @@ #ifndef __LINUX_PINCTRL_PINCONF_H #define __LINUX_PINCTRL_PINCONF_H -#ifdef CONFIG_PINCONF - struct pinctrl_dev; struct seq_file; @@ -64,6 +62,4 @@ struct pinconf_ops { unsigned long config); }; -#endif - #endif /* __LINUX_PINCTRL_PINCONF_H */ diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index 34b10d112be6..c6159f041f4e 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -11,8 +11,6 @@ #ifndef __LINUX_PINCTRL_PINCTRL_H #define __LINUX_PINCTRL_PINCTRL_H -#ifdef CONFIG_PINCTRL - #include #include #include @@ -197,6 +195,4 @@ extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev); extern const char *pinctrl_dev_get_devname(struct pinctrl_dev *pctldev); extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev); -#endif /* !CONFIG_PINCTRL */ - #endif /* __LINUX_PINCTRL_PINCTRL_H */ diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h index e873ed97d79e..9a647fa5c8f1 100644 --- a/include/linux/pinctrl/pinmux.h +++ b/include/linux/pinctrl/pinmux.h @@ -15,8 +15,6 @@ #include #include -#ifdef CONFIG_PINMUX - struct pinctrl_dev; /** @@ -84,6 +82,4 @@ struct pinmux_ops { bool strict; }; -#endif /* CONFIG_PINMUX */ - #endif /* __LINUX_PINCTRL_PINMUX_H */ From patchwork Thu Jun 13 01:55:32 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 166715 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp994006ilk; Thu, 13 Jun 2019 09:55:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgrvp8m0oJ+rx+Qr/Q+lDouLIFxr7cU40vjMb3Tg1EQsd+cNWnYIgfZh4ffozJ47IqXPkB X-Received: by 2002:a17:90a:9bca:: with SMTP id b10mr6570369pjw.90.1560444953447; Thu, 13 Jun 2019 09:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560444953; cv=none; d=google.com; s=arc-20160816; b=tUllBVxz631tZnFf0R37LnAsCP0DhyytyDFoWzZuPKgcuh4LMFyZVClA2Moi0577v8 x9wzurg3+P7XDOr8D01e/2fYFhUC1lgSXOH1IWNyURq3dcqGM0BRkqY8xCOop7Z1JsYN qCnU9FGkDJ2RjimL7Rb+fXh+bd8zxWyWsqQHi9KPuS1zjvdhEKx7rc2Yx3f/fAG+pW+5 onWq9fF9w+yuHvkBWp5uNt3ADnHJxFCieHLQtB/O2AcTU+HmJSwRrHw5ufoMZJMb83XK 06bfzYuEfuhLtiJz6YcLq6z0uHWDCqZXmx8SmxRxyB78Q9eJrQKbUwEeoVuKUKnHMZFC vrPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=ScZXfHA5I2OdP0oKcfk/XaGT5+lYTeZZPKTtupuCqFo=; b=wC1S4QSxH1vY15fTs2BeNoFICX15I3tJ+7xny1qQDcqrweFtMdBFFGYcZuE6hflG1H kIYijDOqAw3q4ZJsQ+vB3TDhfrL635rnlmN2xHy/JjuJrhWE0A8tSc8zrVnsmV9IO/f2 w1W+KeYp7NPkQ/EtP28Sh2KDvDI55ktFrQM3UOBlGLGiN89ZzCAkwVggf4I/LJLuMEoR y/3A18LGRxqQIRGS1xVUrxPMZc3wxOYw+lMpZGo9E9KQnaHgCNcmrC6or0ZnxPYp98OZ 9nQbK6yNzZ/Vy2QwwoXC1yWNivyk+403xbAw8N9smuIswi3DxbEVc2M57Ncw0c+MqvKW U9cQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wGOQC5Uf; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i6si98774pfc.158.2019.06.13.09.55.53; Thu, 13 Jun 2019 09:55:53 -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=@nifty.com header.s=dec2015msa header.b=wGOQC5Uf; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730209AbfFMQzw (ORCPT + 24 others); Thu, 13 Jun 2019 12:55:52 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:39797 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729991AbfFMB4C (ORCPT ); Wed, 12 Jun 2019 21:56:02 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id x5D1taul028457; Thu, 13 Jun 2019 10:55:37 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com x5D1taul028457 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1560390937; bh=ScZXfHA5I2OdP0oKcfk/XaGT5+lYTeZZPKTtupuCqFo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wGOQC5UfgE5jFShf/DcKOesKN/tflZU+OFAXLnTpi2DK00LmTchvDpv9kXYrRypvh /MMn7w8kTUE69p/3XoqZQUwi7r74i72GoCRsHTFW4ZMzUyYOyXPfZElDDAda9f6JCd X2N85gojmHqJQy6CBoYXnooIwQWAF6Y+6oJBEfr14Fs1VYWYJF28nhT88YodynHUvd Lt/n7kuuFz92eSzfnufINmBoXWu5rNrS05pn4shVrEIrJJRMHJ10yMDpGCoNMKxJQU FB8yDffdHwxSJXDVBLE5xWDr2YXwAI4T1Yy06O2jfK+SsMCNVApDJXcxqGuuO3n3vx 2nghYO0T9EwTg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-gpio@vger.kernel.org, Linus Walleij Cc: Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 2/2] pinctrl: make pinconf.h self-contained Date: Thu, 13 Jun 2019 10:55:32 +0900 Message-Id: <20190613015532.19685-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190613015532.19685-1-yamada.masahiro@socionext.com> References: <20190613015532.19685-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This header uses 'bool', but it does not include any header by itself. So, it could cause unknown type name error, depending on the header include order, although probably has been included by someone else. Include to make it self-contained. Signed-off-by: Masahiro Yamada --- include/linux/pinctrl/pinconf.h | 2 ++ 1 file changed, 2 insertions(+) -- 2.17.1 diff --git a/include/linux/pinctrl/pinconf.h b/include/linux/pinctrl/pinconf.h index eb16a1e0bcfa..f8a8215e9021 100644 --- a/include/linux/pinctrl/pinconf.h +++ b/include/linux/pinctrl/pinconf.h @@ -11,6 +11,8 @@ #ifndef __LINUX_PINCTRL_PINCONF_H #define __LINUX_PINCTRL_PINCONF_H +#include + struct pinctrl_dev; struct seq_file;