From patchwork Mon Jul 18 22:02:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 591550 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59B05CCA479 for ; Mon, 18 Jul 2022 22:02:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235551AbiGRWCu (ORCPT ); Mon, 18 Jul 2022 18:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234877AbiGRWCt (ORCPT ); Mon, 18 Jul 2022 18:02:49 -0400 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3CAE30F41; Mon, 18 Jul 2022 15:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1658181768; x=1689717768; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4f4sqt41mbrBJQ5YZ8lAHwW92PK8OUBMApM+zNy2HDY=; b=hM9Z/qy6RaT5oicalFdsPZGqVQhvImEtYBBFzdc8KyjoqQnU97+H9NPW aKEDHahNrNc4es5hylJQnt/YKFECmQjgkq9KO6O3bDEsJan/QHsU+yHPO W+NguDic4qsk3d8c4V80gXaJ9U85TpxlzZ42sIQYVOTEQHzP5Wsw1U2eQ xQjaG4G3VKw2QywvIrSi8INW9l2HvnyG+sBwUFrDs8ShNfovndZzK9Pgw u6bQQfmxTBE5KRUnObJihXaztia9GlixP02IUZiV1nrRX+1AFb9p85EMF wBIAEtzivdnTKC4OSKHDBniXWIHJ+Q6t/BqVwzaxwDhfpKLAenmQOu8Gu w==; X-IronPort-AV: E=McAfee;i="6400,9594,10412"; a="273161745" X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="273161745" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Jul 2022 15:02:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,282,1650956400"; d="scan'208";a="601361127" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga007.fm.intel.com with ESMTP; 18 Jul 2022 15:02:46 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 28FC0195; Tue, 19 Jul 2022 01:02:55 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Linus Walleij , Bartosz Golaszewski Subject: [PATCH v1 3/3] gpio: 74xx-mmio: use bits.h macros for all masks Date: Tue, 19 Jul 2022 01:02:52 +0300 Message-Id: <20220718220252.16923-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220718220252.16923-1-andriy.shevchenko@linux.intel.com> References: <20220718220252.16923-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Make use of the GENMASK() (far less error-prone, far more concise). Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- drivers/gpio/gpio-74xx-mmio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/gpio-74xx-mmio.c b/drivers/gpio/gpio-74xx-mmio.c index b2cc8a55c257..cd399898ed12 100644 --- a/drivers/gpio/gpio-74xx-mmio.c +++ b/drivers/gpio/gpio-74xx-mmio.c @@ -5,6 +5,7 @@ * Copyright (C) 2014 Alexander Shiyan */ +#include #include #include #include @@ -14,7 +15,7 @@ #define MMIO_74XX_DIR_IN (0 << 8) #define MMIO_74XX_DIR_OUT (1 << 8) -#define MMIO_74XX_BIT_CNT(x) ((x) & 0xff) +#define MMIO_74XX_BIT_CNT(x) ((x) & GENMASK(7, 0)) struct mmio_74xx_gpio_priv { struct gpio_chip gc;