From patchwork Thu Feb 13 18:23:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "andriy.shevchenko@linux.intel.com" X-Patchwork-Id: 13973890 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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 59F6DC021A0 for ; Thu, 13 Feb 2025 18:25:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B67F110EB6C; Thu, 13 Feb 2025 18:25:40 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="jf0AyP2B"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.13]) by gabe.freedesktop.org (Postfix) with ESMTPS id C2AF110EB71 for ; Thu, 13 Feb 2025 18:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1739471140; x=1771007140; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=feGGHOi3zI3MPTYTRwIv47zVrsjrDEIKTSIWX8tUD9w=; b=jf0AyP2BUUN13t5lMBpWk8AMKpgQCoSSHxgYNjXKsA5FIhLsii8qrDHP wTuAOSkcS0HDnSOdM0aVToLLUINrzFyIvNQjbLKMrbRo/N8PYD28Jalzk E6z1BNPCs7PJIJikBO8NVS2VnfZ7lPPARmD8NeB6ofo0FPfc8xxrE05z4 21ip2gffmo3BRqHr0IvhVhnfSAXPz0gkfHCXl4dRIqKXKiw/g6PX3wNfZ Ox5adR2AtMWOTXOw4ZLB2DS9v+gRcPViic+OtBkY+sRfVAhe7NFB3S5ow BNSAqCRoCU7nqtCcQQsM97yVgSQGvnhXxQfxwtBdfRvh1ppJdEUHXfV5g Q==; X-CSE-ConnectionGUID: q6t0+w0UQwq07it8pkgQiA== X-CSE-MsgGUID: gUvUVdATREy/RijIAOkdlw== X-IronPort-AV: E=McAfee;i="6700,10204,11344"; a="51177667" X-IronPort-AV: E=Sophos;i="6.13,282,1732608000"; d="scan'208";a="51177667" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Feb 2025 10:25:35 -0800 X-CSE-ConnectionGUID: 2kv5/gDFTa2LCfXXmvCe7A== X-CSE-MsgGUID: PQkSx2DlREChrWj3GYuAGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,224,1728975600"; d="scan'208";a="113721779" Received: from black.fi.intel.com ([10.237.72.28]) by orviesa007.jf.intel.com with ESMTP; 13 Feb 2025 10:25:30 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id EAC3B1FD; Thu, 13 Feb 2025 20:25:28 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Bartosz Golaszewski , Alexandru Ardelean , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org Cc: Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Linus Walleij , Bartosz Golaszewski Subject: [PATCH v2 0/2] gpiolib: Make code more robust by using for_each_if() Date: Thu, 13 Feb 2025 20:23:59 +0200 Message-ID: <20250213182527.3092371-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.45.1.3035.g276e886db78b MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Instead of opencoding with long lines, use for_each_if() macro which makes intention clearer and less error prone. In v2: - moved original for_each_if() implementation to the global header (Bart) Andy Shevchenko (2): drm: Move for_each_if() to util_macros.h for wider use gpiolib: Switch to use for_each_if() helper include/drm/drm_util.h | 16 +--------------- include/linux/gpio/driver.h | 7 ++++--- include/linux/util_macros.h | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 18 deletions(-) Reviewed-by: Linus Walleij