From patchwork Fri Apr 26 13:01:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 13644761 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 0DB36C04FFE for ; Fri, 26 Apr 2024 13:03:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 59A8B10F062; Fri, 26 Apr 2024 13:03:37 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="mq4gqqlG"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2451710E9E9; Fri, 26 Apr 2024 13:03:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714136615; x=1745672615; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=a5JDKb4u3ip7ps6JPEHGzOCoKjm6K4KWOS+bRa+QxSI=; b=mq4gqqlGD/Qvtb87O7fhrxojcqXxF/OCPKYDXokajXP4dKtNqnd0fYW2 VfJtfU/E3vtu1DWvQKN1nmGdaGNflr511MgLVN2X6s+37C6we7pOkG0m3 cgwzopRkas8YxFD88Z3aGgWhhysAPq7+fv7I8JAD8Si6Vx0riTyWnstBo D98zKps1K4vDZB/nJNEZKCh9lht+nLRiLMQa5ORDKnzQM/AfrZH568+WU BEbEcDmsEw2AINaQwt6JM5m61xMB18KdTUiSlTfjbSZP5LR3frsWkIgBF 0zHraFmqW8SZ07Xx18ttuuEF0BxiFfF5fmUkMzzrAKI73YdoWDYdXMqRs g==; X-CSE-ConnectionGUID: Pmi2n1qaQ5+sCJR1flIvaA== X-CSE-MsgGUID: S+YXs3zwS06/xdEM3MM2bw== X-IronPort-AV: E=McAfee;i="6600,9927,11056"; a="10028799" X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="10028799" Received: from fmviesa004.fm.intel.com ([10.60.135.144]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 06:03:34 -0700 X-CSE-ConnectionGUID: Pv3CbkeBRQaAkdC/gr2TiA== X-CSE-MsgGUID: /LGUUirgTlaptD4tZmUpQA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,232,1708416000"; d="scan'208";a="30052954" Received: from dgarbuz-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.48.145]) by fmviesa004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Apr 2024 06:03:33 -0700 From: Jani Nikula To: intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Cc: jani.nikula@intel.com Subject: [PATCH 000/123] drm/i915: remove implicit dev_priv local variable use Date: Fri, 26 Apr 2024 16:01:25 +0300 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Hey all, it's time to stop using the implicit dev_priv local variable in register macros. Yes, this is huge. It's also (almost) completely scripted. Thoughts? BR, Jani. Here's the script: #!/bin/bash set -e # Find all the registers implicitly relying on dev_priv REGS=$(git grep -h "#define.*dev_priv" -- drivers/gpu/drm/i915/i915_reg.h |\ grep -v '#define[ \t]\+[a-zA-Z0-9_]\+(dev_priv' |\ sed 's/#define[ \t]\+\([a-zA-Z0-9_]\+\).*/\1/') for reg in $REGS; do echo $reg FILES=$(git grep -wl $reg -- drivers/gpu/drm/i915) cocci=$(mktemp) cat >$cocci < EOF # already function-like macros sed -i "s/\(#define *${reg}(\)/\1dev_priv, /" $FILES # new function-like macros sed -i "s/\(#define *${reg}\)\([ \t]\)/\1(dev_priv)\2/" $FILES spatch --sp-file $cocci --in-place --linux-spacing $FILES >/dev/null rm -f $cocci git commit -as -F - <