From patchwork Wed Sep 25 10:02:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 174351 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp409795ill; Wed, 25 Sep 2019 03:02:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuJBBysk0Ale+pdZnpcy+oVcZgEOZdcBC/6kjjFQJwyGXDn1g5O73EkP2euyikPcGHDWdZ X-Received: by 2002:a2e:810e:: with SMTP id d14mr5600864ljg.160.1569405769946; Wed, 25 Sep 2019 03:02:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569405769; cv=none; d=google.com; s=arc-20160816; b=rzeZBn9Hw1oXSKtsBqrhqeFWKmKJ2k583lf+5kTZCftCpxCexlluj3uLSceDoQXbQh YQRakuZufMMG/3VqZmA0hC8Q56kYvwvfcTxuIcBLLIn4hTVysAOhaGijmAf1CSlbpVA0 zdh/QBvoYoOAqwaGS8SLEgves8Np1hte+62u1QLDKGl6Bgq02I/XeLXSVwW8ZVntBfZN WGXHbQP5cEbwMGMVXFsEfb+4exyQtNsFctHk4PA7p3ZJ8+7F1CnmShhC7u4cZkDI1+Rn CR9T3lYAT5J0t48mVZDyYwthrex5SjfSv+WyRV0yOJ8jEpckvoL8Im2/VpN/siirUZDG mIwg== 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; bh=PfNn/W0PmjQ9bUUZ6dAEkvRvRPYcOrbr2656dQFRs6Q=; b=0zReqG5xlPxdRAIzDyFmjnFluuQvivkr4KVcYH33wg8w8TyJW1b/g52KhkDCSAhBb9 sIaKkyMsRH2HQnlWIen1LDy3WmB1E1p0eCgK5VW/ImxuSNnckDLBVjNIabTLHqbIcuVp H4/6lQt8bBwt7iH6D3HJKfXRphUZsibeUUT03x5eyKRJr/tAyCVwxwwsPVJHFwz127nA QFXHgGe8m3MrzX286NbOCalIFE6tzA5I0Mj+tRCOu4JF1yjn4faILqj+aZEVsDFsVAoN BIsag11yajiveF0UxTPyVTv1GzAarXUExj5Sy2Bb8LcZ67eZZJkINjGWQDOBUTDOQrZT X3FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=JarDPZ4d; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id va7si2477221ejb.4.2019.09.25.03.02.49; Wed, 25 Sep 2019 03:02:49 -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=@linaro.org header.s=google header.b=JarDPZ4d; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387758AbfIYKCs (ORCPT + 26 others); Wed, 25 Sep 2019 06:02:48 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:34388 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730072AbfIYKCs (ORCPT ); Wed, 25 Sep 2019 06:02:48 -0400 Received: by mail-pl1-f194.google.com with SMTP id k7so1614136pll.1 for ; Wed, 25 Sep 2019 03:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=PfNn/W0PmjQ9bUUZ6dAEkvRvRPYcOrbr2656dQFRs6Q=; b=JarDPZ4d06l2rW7Tu+eOhbKXjmaAqntGdoyAud9fRFwzpo4YMJtFxlV5eduVtlyARe B4i1ZZZWGSLwcag8ovQS3K8AykaAoeVKdcMVP8lW4wk+sd9bpmrorRr+I69d90dBmVVM jzw+zP+XH/1pDAwdv1JU0R+mFF9R3e0UzCWvyvvd0Lm1XA2u1XakxrnFeJ9Y8oTkt7Gy qHEzZWlpC16y4HdG2TsCm2RfHF8Tl9nme/f+P8hDJ8WR9R0TzdOIU/l+y5E/UWvNmM30 UFsizMezvTWeHjibmEMPCYQs7EiGmiLhIW3DJ84JZlDWxb4cl4zRtQaa7FmLvq+NcBkj 7t1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=PfNn/W0PmjQ9bUUZ6dAEkvRvRPYcOrbr2656dQFRs6Q=; b=pJekaMdx4KGeZZO2qaNrJhnU8BwHnSb6h0hCNqiEERMRS9faeqey/KqSkP2o3mKZj5 SSHiILD6t2BZKAEAtr0oc224adeisLmzVJwC5mIHkmWJlCGe4Q401Zwb2aj8c0Y8A429 +aSKCoNTW21zwXu3dVQUjOriIoLx1qv7owXb5HnPFhg7FhmgF7qlr1gdkfh6acCIlwa7 LX3fHTjU6qT4xpPeVXx+vZfit6uC37jJoJSoHxja6sJSsHhA16qcwYlmX5PPzSr/IG3J 4pieHXBcVdCesd/bN7D0uRJcXmh9L7D4Os7TcazUE+mBKmBCr4rm7V37CPGhFSASJMhy dsAQ== X-Gm-Message-State: APjAAAW4Yg5n1YCBc8p+8yr88pVV+zkgD4dekgP858++YEARaEZDHa0Q MxUxhV3oxzBgfzn9GkGarC2ajQ== X-Received: by 2002:a17:902:a58a:: with SMTP id az10mr8426558plb.42.1569405767740; Wed, 25 Sep 2019 03:02:47 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id u31sm13973216pgn.93.2019.09.25.03.02.42 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Sep 2019 03:02:46 -0700 (PDT) From: Baolin Wang To: stable@vger.kernel.org, linus.walleij@linaro.org, natechancellor@gmail.com Cc: linux-gpio@vger.kernel.org, arnd@arndb.de, baolin.wang@linaro.org, orsonzhai@gmail.com, vincent.guittot@linaro.org, linux-kernel@vger.kernel.org Subject: [BACKPORT 4.14.y v3 2/3] pinctrl: sprd: Use define directive for sprd_pinconf_params values Date: Wed, 25 Sep 2019 18:02:24 +0800 Message-Id: <93a07f8a37d17bdfbda6bcc9fdb5032a724d5f10.1569405445.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Chancellor [Upstream commit 957063c924736d4341e5d588757b9f31e8f6fa24] Clang warns when one enumerated type is implicitly converted to another: drivers/pinctrl/sprd/pinctrl-sprd.c:845:19: warning: implicit conversion from enumeration type 'enum sprd_pinconf_params' to different enumeration type 'enum pin_config_param' [-Wenum-conversion] {"sprd,control", SPRD_PIN_CONFIG_CONTROL, 0}, ~ ^~~~~~~~~~~~~~~~~~~~~~~ drivers/pinctrl/sprd/pinctrl-sprd.c:846:22: warning: implicit conversion from enumeration type 'enum sprd_pinconf_params' to different enumeration type 'enum pin_config_param' [-Wenum-conversion] {"sprd,sleep-mode", SPRD_PIN_CONFIG_SLEEP_MODE, 0}, ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~ It is expected that pinctrl drivers can extend pin_config_param because of the gap between PIN_CONFIG_END and PIN_CONFIG_MAX so this conversion isn't an issue. Most drivers that take advantage of this define the PIN_CONFIG variables as constants, rather than enumerated values. Do the same thing here so that Clang no longer warns. Link: https://github.com/ClangBuiltLinux/linux/issues/138 Signed-off-by: Nathan Chancellor Reviewed-by: Baolin Wang Signed-off-by: Linus Walleij Signed-off-by: Baolin Wang --- drivers/pinctrl/sprd/pinctrl-sprd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) -- 1.7.9.5 diff --git a/drivers/pinctrl/sprd/pinctrl-sprd.c b/drivers/pinctrl/sprd/pinctrl-sprd.c index 6352991..83958bd 100644 --- a/drivers/pinctrl/sprd/pinctrl-sprd.c +++ b/drivers/pinctrl/sprd/pinctrl-sprd.c @@ -159,10 +159,8 @@ struct sprd_pinctrl { struct sprd_pinctrl_soc_info *info; }; -enum sprd_pinconf_params { - SPRD_PIN_CONFIG_CONTROL = PIN_CONFIG_END + 1, - SPRD_PIN_CONFIG_SLEEP_MODE = PIN_CONFIG_END + 2, -}; +#define SPRD_PIN_CONFIG_CONTROL (PIN_CONFIG_END + 1) +#define SPRD_PIN_CONFIG_SLEEP_MODE (PIN_CONFIG_END + 2) static int sprd_pinctrl_get_id_by_name(struct sprd_pinctrl *sprd_pctl, const char *name)