From patchwork Thu Nov 1 00:52:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Chancellor X-Patchwork-Id: 991775 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="lfrzm4PB"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 42lmsP0N8Fz9s8J for ; Thu, 1 Nov 2018 11:53:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726008AbeKAJxt (ORCPT ); Thu, 1 Nov 2018 05:53:49 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:33134 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbeKAJxt (ORCPT ); Thu, 1 Nov 2018 05:53:49 -0400 Received: by mail-wr1-f66.google.com with SMTP id u1-v6so18460873wrn.0; Wed, 31 Oct 2018 17:53:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=BxnkFIw1Q+i5FsURVac8qkSHIwEh/FivfEkua9BcaYQ=; b=lfrzm4PBamDlflpvUeEIKTKa2N0P0q2UXYVeQINe6l2Rwba4t5wCvbJvR2ivYVN4GM 3IfB6559wZUO6jiWBFudA/n+VPu0KwZmLDcZu9Lwcf5RMMqHjHr1zFcNBTg+1Sx5shCj VoXddsAQHvCkVR1oP+U/B7Pxc3g8QoR9290y9Ru1OU1a0/UvDbbjlyDwP3dguXY5hFsI nFOq3JwNuOZK3pKy3GxJMCFllP/IqJO69QI59h1gTzmRjJ7/9c3BwwK7vGfFNmTaJ7r0 k619lZaafiBg1gShppEPOHqo0sjCj6/K5Yq9k+fYb+6isMbWTapMbvih+LFftzWiFS+s spGQ== 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:mime-version :content-transfer-encoding; bh=BxnkFIw1Q+i5FsURVac8qkSHIwEh/FivfEkua9BcaYQ=; b=Rsgcc5bTr1tnCQ5oShBx48+8afz0eWIYWDcb6b5Na22JlvtPiCHbskwCdFLfSyN60s HTmgK2gXpUtCofFHd4NpDKhvwDwvSat/vn2YM0ZgVdf4lDoLYV3aPqQ2FgJFAPT++WMy hiMVI1zzfUBaToTfWsVNB573I+jijDBShPYBWVXYwEVoaKHNpjd/9n0bl6aCdax+fQ28 YVdbyveCmrxKw4nmaVTNPue7AanQz8VvPxqyyq1peUhiDgbi3L0NWYAcEEf0cCILkmVz mQG480uI8h/DIaQjLsXFNeRPgnAX8Yt8PvDE5D/UUF6x9LpnYnzecsUCnwTR0UtVZ3kD KSgQ== X-Gm-Message-State: AGRZ1gJ1/vhe6lwvFiajdqDs1HIsa2N2+Qm22HDXoiWef8oSDFl70Vxo O144o1qP19iL7yWTkt744yw= X-Google-Smtp-Source: AJdET5f7c0m5l4YBCzeg/lqf4vx8lw54pMqdLoidw0SBHIvyrRVb6GOTl5pbzpZ0581+02LY/FZNjw== X-Received: by 2002:adf:b3c1:: with SMTP id x1-v6mr781270wrd.179.1541033589349; Wed, 31 Oct 2018 17:53:09 -0700 (PDT) Received: from localhost.localdomain ([2a01:4f8:10b:24a5::2]) by smtp.gmail.com with ESMTPSA id o17-v6sm41180879wro.2.2018.10.31.17.53.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 31 Oct 2018 17:53:08 -0700 (PDT) From: Nathan Chancellor To: Linus Walleij Cc: Vladimir Zapolskiy , linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Nick Desaulniers , Nathan Chancellor Subject: [PATCH] pinctrl: lpc18xx: Use define directive for PIN_CONFIG_GPIO_PIN_INT Date: Wed, 31 Oct 2018 17:52:57 -0700 Message-Id: <20181101005257.8778-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Clang warns when one enumerated type is implicitly converted to another: drivers/pinctrl/pinctrl-lpc18xx.c:643:29: warning: implicit conversion from enumeration type 'enum lpc18xx_pin_config_param' to different enumeration type 'enum pin_config_param' [-Wenum-conversion] {"nxp,gpio-pin-interrupt", PIN_CONFIG_GPIO_PIN_INT, 0}, ~ ^~~~~~~~~~~~~~~~~~~~~~~ drivers/pinctrl/pinctrl-lpc18xx.c:648:12: warning: implicit conversion from enumeration type 'enum lpc18xx_pin_config_param' to different enumeration type 'enum pin_config_param' [-Wenum-conversion] PCONFDUMP(PIN_CONFIG_GPIO_PIN_INT, "gpio pin int", NULL, true), ~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./include/linux/pinctrl/pinconf-generic.h:163:11: note: expanded from macro 'PCONFDUMP' .param = a, .display = b, .format = c, .has_arg = d \ ^ 2 warnings generated. 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/140 Signed-off-by: Nathan Chancellor --- drivers/pinctrl/pinctrl-lpc18xx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/pinctrl/pinctrl-lpc18xx.c b/drivers/pinctrl/pinctrl-lpc18xx.c index a14bc5e5fc24..4bee606088e1 100644 --- a/drivers/pinctrl/pinctrl-lpc18xx.c +++ b/drivers/pinctrl/pinctrl-lpc18xx.c @@ -631,13 +631,10 @@ static const struct pinctrl_pin_desc lpc18xx_pins[] = { }; /** - * enum lpc18xx_pin_config_param - possible pin configuration parameters * @PIN_CONFIG_GPIO_PIN_INT: route gpio to the gpio pin interrupt * controller. */ -enum lpc18xx_pin_config_param { - PIN_CONFIG_GPIO_PIN_INT = PIN_CONFIG_END + 1, -}; +#define PIN_CONFIG_GPIO_PIN_INT (PIN_CONFIG_END + 1) static const struct pinconf_generic_params lpc18xx_params[] = { {"nxp,gpio-pin-interrupt", PIN_CONFIG_GPIO_PIN_INT, 0},