Received: by 2002:ab2:5c0e:0:b0:1ef:a325:1205 with SMTP id i14csp68911lqk; Wed, 13 Mar 2024 16:57:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXPCA/7xnR9hwo13k09SvyMXsKqV9/payJC7nOPCJWIavQ4AKIyP4PzIBdTD7GSw2R0jILVPlZwkAIR1MvtCHukNn7YneyFJoN44B4Ggw== X-Google-Smtp-Source: AGHT+IHh/0g8y0SpIcT7K6ZefvuvRSJTBeUDtlygOvxOXnJh5cuWuIrm61lXhnvLNd67BnQSEbL3 X-Received: by 2002:a05:6870:ac8f:b0:221:b3a5:fd31 with SMTP id ns15-20020a056870ac8f00b00221b3a5fd31mr401667oab.27.1710374271771; Wed, 13 Mar 2024 16:57:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710374271; cv=pass; d=google.com; s=arc-20160816; b=thWhBIFeX/9eZDmAkkiCMrQNTExwMZ4oNYWTtGHVcOcBx3Xzo6EWu+xYXLsDg4wFkF wFE4+XSyFDKGWL6/sAmb8a5yvhY6/CeWiqOsFWf9plpbp/ICB7xSIeNC7X9iELh1kywf CskvNJ3LVYIfnd9xpEQ4BgYQulv4XLnbkoP3zAr3SMaCsf1CbXvw9+sp7F0VCcnbw9Ug 9N/kka52UPhp6DMl9hsrK6jhP8yzLIh8sQukXN+9grvMJ85xgOfBx1G8etYgWC+wd3ik rXNZSED5tZpB1wKAueOBeglRNsWBGshITSzeE7ECxP7xYOKhSOcYxGep0nRc3DltMXPo obfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:to:from; bh=bmYzMLR2suBHtgBvrhnEQk1imSLGuOydk6KuQpmFLKc=; fh=YgUZ2/lPRGLRG7A+awv03LUUmaPSy2eh3E767EmTYHs=; b=0tE9GiYf46ahqfQaPrRwt6E6DwLffvNMNuFe/GVnKd47yCRdwkF6+WYIRU39sQjH6O kO2nCWWNUScBqqylP8NQxdVZXGFuq/nmVlebr3T/kiRIHY9TuU6JYReEOXP+j4ZrSwAU KqcT/Oj5pVLtn5oWPt6saTv/n93MKA2S9UpYIDyd7AdX/2OAeLJWTO6Ms/WHFfmP+hYc yvJp3lYPSpzq/a/cOppuMqresu8s9oxxtreJsHMF6aBrqdkQy8kM0BfyCchqFuDBcIQz KFvCzhuBBPHl5qu0VsJ8Z2Xfxdh+jf8PeeAkp3gWvPULFI+E9B5hCur+3o4sWacslPr0 0HZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102666-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id i2-20020aa78d82000000b006e6b41511f8si310374pfr.30.2024.03.13.16.57.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 16:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-102666-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-102666-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-102666-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D852D284A7E for ; Wed, 13 Mar 2024 23:57:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6A2AD6086B; Wed, 13 Mar 2024 23:55:41 +0000 (UTC) Received: from fgw23-7.mail.saunalahti.fi (fgw23-7.mail.saunalahti.fi [62.142.5.84]) (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 46AB65D908 for ; Wed, 13 Mar 2024 23:55:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.142.5.84 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; cv=none; b=DB/UG/fPlOZnE2GN+cUhXUinR62ThAMoSr5gsMq8AAa9V+Cn1jJPk2PP0Lunw9Y+pqwnJ7c9j30J+jHITy37hStBqrLzqi94k+Zq+BP9I7Cz24vxj9/wdRczD72ScLbfb12+rbeACuNW4k08jU9Kil6mqc4nEuTKQIMks9NrnOg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710374140; c=relaxed/simple; bh=A/6Rxz4Bmsq8vL9J8RxsvzpoTJK2t8DPLAAu7jQ7ezk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XDLQ8tm1fbzunp1Hnrdok9rh6LxwJ4zIZFiEbunhH3GGmkhTmvmXqa3OUvtb7Zs7p7qFtm3HtxJE76+KvddAf0CTKOkYyGquXlR6gvNIYaMjrEwjMOsEdPh1ddDPELKlDCR3etylc4ke9jEml0IcxT3iF8Wxfz4slvFL5uOiN9w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=62.142.5.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com Received: from localhost (88-113-26-217.elisa-laajakaista.fi [88.113.26.217]) by fgw23.mail.saunalahti.fi (Halon) with ESMTP id 07bc019b-e195-11ee-b972-005056bdfda7; Thu, 14 Mar 2024 01:54:29 +0200 (EET) From: Andy Shevchenko To: Linus Walleij , Andy Shevchenko , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 06/11] pinctrl: aw9523: Get rid of redundant ' & U8_MAX' pieces Date: Thu, 14 Mar 2024 01:52:09 +0200 Message-ID: <20240313235422.180075-7-andy.shevchenko@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240313235422.180075-1-andy.shevchenko@gmail.com> References: <20240313235422.180075-1-andy.shevchenko@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When the variable is declared as u8, no need to perform ' & U8_MAX' as it's implied anyway. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/pinctrl-aw9523.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/pinctrl-aw9523.c b/drivers/pinctrl/pinctrl-aw9523.c index 118896373844a..9e8e658f81404 100644 --- a/drivers/pinctrl/pinctrl-aw9523.c +++ b/drivers/pinctrl/pinctrl-aw9523.c @@ -603,7 +603,7 @@ static int aw9523_gpio_get_multiple(struct gpio_chip *chip, mutex_lock(&awi->i2c_lock); /* Port 0 (gpio 0-7) */ - m = *mask & U8_MAX; + m = *mask; if (m) { ret = _aw9523_gpio_get_multiple(awi, 0, &state, m); if (ret) @@ -612,7 +612,7 @@ static int aw9523_gpio_get_multiple(struct gpio_chip *chip, *bits = state; /* Port 1 (gpio 8-15) */ - m = (*mask >> 8) & U8_MAX; + m = *mask >> 8; if (m) { ret = _aw9523_gpio_get_multiple(awi, AW9523_PINS_PER_PORT, &state, m); @@ -635,20 +635,20 @@ static void aw9523_gpio_set_multiple(struct gpio_chip *chip, unsigned int reg; int ret; - mask_lo = *mask & U8_MAX; - mask_hi = (*mask >> 8) & U8_MAX; + mask_lo = *mask; + mask_hi = *mask >> 8; + bits_lo = *bits; + bits_hi = *bits >> 8; + mutex_lock(&awi->i2c_lock); if (mask_hi) { reg = AW9523_REG_OUT_STATE(AW9523_PINS_PER_PORT); - bits_hi = (*bits >> 8) & U8_MAX; - ret = regmap_write_bits(awi->regmap, reg, mask_hi, bits_hi); if (ret) dev_warn(awi->dev, "Cannot write port1 out level\n"); } if (mask_lo) { reg = AW9523_REG_OUT_STATE(0); - bits_lo = *bits & U8_MAX; ret = regmap_write_bits(awi->regmap, reg, mask_lo, bits_lo); if (ret) dev_warn(awi->dev, "Cannot write port0 out level\n"); -- 2.44.0