Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp685645rdh; Wed, 14 Feb 2024 08:26:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX7E4Bym5KsMpTwS6gce8eQEZeQFVKXkVcJG0grzNEBaK5w3n0daF7WdTymJmDYwktQQsboDpobylzyPPrl8jt9XMPw2HZwn7FuBHoXwA== X-Google-Smtp-Source: AGHT+IHwk4GJXF9TYKf7ecw1rMdVALTu3qGQqC6pCn+sUtJiZfn0/36j0g/n396BuPd7MJ8FJXkT X-Received: by 2002:a05:6870:b6a0:b0:21c:3cd4:1cf9 with SMTP id cy32-20020a056870b6a000b0021c3cd41cf9mr2573276oab.23.1707927998339; Wed, 14 Feb 2024 08:26:38 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707927998; cv=pass; d=google.com; s=arc-20160816; b=LH5EFBjLZ6ufzaHwunTwESZekFEj1wm7FlD0JSBoreSjXDEjcyoMZQSbHESLFSmccM 3+gRiotLJwVwzybrauYxvgo9TtUUyJEl/3orTMnuMkywe2kgV4MVGhMPMcceGQUDpImM 4WrEGSictn2iZqJibcsEG5qPRWLj/FV0nSIBnQLfV10Fp5QbMnWWvwGVdeB15zCPhWPE n8skbW07ObDNfRWTHn64OpmuYbPAUvycYv8+iQwyUdeE1h3nMGfFIIBVRYXlnd/56fAp 2SevpHGQNeM/g83X/2HIHZdm+opt53D3618u1mbXNpWORIlMtzFTnWbgBUTSURNc88Y1 exkQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=y8W2yOX1/lqz3cTT+5TwvqzWpGJkVlzJWrTABq4PG4k=; fh=8MtMg7JkVB+daz6lR9HT3Uts6hqAfDnWBc0peKQA35s=; b=t8DH1HkynMDGpoZhXXK9G4igWZJqV4+6z0iBAvWw/0C78jeZ/VxATtcQBUi53LEakw lF+rEMuG7Xo5zL3+s7giPczGvlSqf3/dNx4E20pmPwD5GkPBPLLnUGG4uPgecK7BeVD3 Vzbl0raF0mxPqsUpOntYYVtKLfYBr791rbPPGFM/ZvS8O8m112LoszekhL6lg7uJVQFD B8R0wFjauEWGgXrs9i6rCOgJOpZYFR7i62+F6abmZTwA2g91XbmNM42pX+Wakdo/+y2Q gJxpl2WjgsUY9cpvpWHRPUrBE7J29iM1F+JH6l0kASTPeh3BR3/V8154jTKmXBGLAoRA GZBA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LmB7S6uF; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-65520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65520-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=2; AJvYcCWet8tM35nVPeD1KKEwNkAun/I7FVQb2Zoy/gB+dROGbk6iXPZpP0ZUVgl2jgnfDg3o+7rkZa0WFgDP0gL0I6Jmk1PEAT9PitgOTx8wVg== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o19-20020a05620a229300b00783d0f90a54si10845758qkh.532.2024.02.14.08.26.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 08:26:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=LmB7S6uF; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-65520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65520-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 19E831C20DF9 for ; Wed, 14 Feb 2024 16:26:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E03F560865; Wed, 14 Feb 2024 16:24:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="LmB7S6uF" Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6399160254; Wed, 14 Feb 2024 16:24:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.195 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707927896; cv=none; b=jNcNjwBwgIV3wun7PbgwG7EIEoADbjblqr2ZDtsjrTq7ATlEFWa116/hQ6QlwHwKcBKcjjNXM6BYGvskUrJ5ImxLo3sAA2Op9Q8J8iv2kiOPH0wEkeHjpgnmXaDFTtGD6KZJg9zdLqmaHBfVE7ZL3fdfUCTloyd6xHulyT6knDs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707927896; c=relaxed/simple; bh=ldERVwA0tqVeaQIDHTYEi71mBmSUTsvjMzu+1URPmgY=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=JMkvodEkmpNJBR5kBkBhrqanBfN88y7VW6DsoCrnfnDUADDFOLb1xYGikq2bemsWgNKh9A2vsrlPFcMuptESWCgt9J0+YRTLnHeJncPMOBzdVzS5lwBHYYfmcepuhwrVNV788cQNIP6BikQRKaVXRJu1N83vV24ruBMdwjII3d4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=LmB7S6uF; arc=none smtp.client-ip=217.70.183.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 21F1B60018; Wed, 14 Feb 2024 16:24:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707927892; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=y8W2yOX1/lqz3cTT+5TwvqzWpGJkVlzJWrTABq4PG4k=; b=LmB7S6uF1VqHaKkR2WZnKequ04ZUZd7v3E29hBaoG+ztkKOP6mdgED6tMr+jGhvfEDrMDb V1BG0YfBcCz+mPopZO8DiuPsX8zMfhshWRj04C0leLIsRsD6TkhO83c1qTrwoaF2Qgqubz aWfUKmljXAFDGsyTjFUufi3hiurK3n7MBsa9Fjk0Nb+JlgZdA3PURHrFHNCFIfOnLdIC9u thvf5hGoM914YbPlkbK9v4DbTtsOOMqsPBqQ/UkW1ZtIxKHWFvedmI6TzWYuLaVR5afX++ TKzhqfb4rBfIe4CUAsyRKb69q+FsPR/uOubv7i7sjNewmoOmkYeBy+CjOVZyfg== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Wed, 14 Feb 2024 17:24:04 +0100 Subject: [PATCH 11/23] pinctrl: nomadik: follow conditional kernel coding conventions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20240214-mbly-gpio-v1-11-f88c0ccf372b@bootlin.com> References: <20240214-mbly-gpio-v1-0-f88c0ccf372b@bootlin.com> In-Reply-To: <20240214-mbly-gpio-v1-0-f88c0ccf372b@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Philipp Zabel , Thomas Bogendoerfer Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, Gregory CLEMENT , Vladimir Kondratiev , Thomas Petazzoni , Tawfik Bayouk , =?utf-8?q?Th=C3=A9o_Lebrun?= X-Mailer: b4 0.12.4 X-GND-Sasl: theo.lebrun@bootlin.com Fix strict checkpatch warnings relative to if-else blocks and bool expressions. Message types addressed: CHECK: Comparison to NULL could be written "!nmk_cfg_params[index].choice" CHECK: Unbalanced braces around else statement CHECK: Using comparison to false is error prone CHECK: Using comparison to true is error prone CHECK: braces {} should be used on all arms of this statement Before: 0 errors, 1 warnings, 16 checks. After: 0 errors, 1 warnings, 7 checks. Signed-off-by: Théo Lebrun --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index 83e7868bc1d7..8099dd947701 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -377,7 +377,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, */ if (!alt_num) { for (i = 0 ; i < PRCM_IDX_GPIOCR_ALTC_MAX ; i++) { - if (pin_desc->altcx[i].used == true) { + if (pin_desc->altcx[i].used) { reg = gpiocr_regs[pin_desc->altcx[i].reg_index]; bit = pin_desc->altcx[i].control_bit; if (readl(npct->prcm_base + reg) & BIT(bit)) { @@ -392,7 +392,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, } alt_index = alt_num - 1; - if (pin_desc->altcx[alt_index].used == false) { + if (!pin_desc->altcx[alt_index].used) { dev_warn(npct->dev, "PRCM GPIOCR: pin %i: alternate-C%i does not exist\n", offset, alt_num); @@ -406,7 +406,7 @@ static void nmk_prcm_altcx_set_mode(struct nmk_pinctrl *npct, for (i = 0 ; i < PRCM_IDX_GPIOCR_ALTC_MAX ; i++) { if (i == alt_index) continue; - if (pin_desc->altcx[i].used == true) { + if (pin_desc->altcx[i].used) { reg = gpiocr_regs[pin_desc->altcx[i].reg_index]; bit = pin_desc->altcx[i].control_bit; if (readl(npct->prcm_base + reg) & BIT(bit)) { @@ -494,7 +494,7 @@ int __maybe_unused nmk_prcm_gpiocr_get_mode(struct pinctrl_dev *pctldev, int gpi pin_desc = npct->soc->altcx_pins + i; gpiocr_regs = npct->soc->prcm_gpiocr_registers; for (i = 0; i < PRCM_IDX_GPIOCR_ALTC_MAX; i++) { - if (pin_desc->altcx[i].used == true) { + if (pin_desc->altcx[i].used) { reg = gpiocr_regs[pin_desc->altcx[i].reg_index]; bit = pin_desc->altcx[i].control_bit; if (readl(npct->prcm_base + reg) & BIT(bit)) @@ -676,9 +676,9 @@ static const struct nmk_cfg_param nmk_cfg_params[] = { static int nmk_dt_pin_config(int index, int val, unsigned long *config) { - if (nmk_cfg_params[index].choice == NULL) + if (!nmk_cfg_params[index].choice) { *config = nmk_cfg_params[index].config; - else { + } else { /* test if out of range */ if (val < nmk_cfg_params[index].size) { *config = nmk_cfg_params[index].config | @@ -1102,9 +1102,9 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin, if (gpiomode) /* No glitch when going to GPIO mode */ __nmk_gpio_set_mode(nmk_chip, bit, NMK_GPIO_ALT_GPIO); - if (output) + if (output) { __nmk_gpio_make_output(nmk_chip, bit, val); - else { + } else { __nmk_gpio_make_input(nmk_chip, bit); __nmk_gpio_set_pull(nmk_chip, bit, pull); } -- 2.43.1