From patchwork Thu Sep 8 20:08:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 12970639 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 915EFC54EE9 for ; Thu, 8 Sep 2022 20:10:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 251BC10E59C; Thu, 8 Sep 2022 20:10:28 +0000 (UTC) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3314F10E59C for ; Thu, 8 Sep 2022 20:10:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1662667825; x=1694203825; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=ny5YB1Z8nDlP48CDc3+3f3gvC1Q45xzy2JeetCqOexk=; b=YENKgrIuVnchHfn8ukb44J1icC0BqqiLVbCZ60SXI7Ch1o9/ggwleKRH Hpt2kZy3TwhIEp1dSgdJ761+wZOW6rkd3+ivNdrrxgKH6ibwf087dwF5x 1wXM/VwLLRSJBWVsboOmtPIpGzUL3DhUnkIjmzzeXriTyWgaryYIBaQEc WlXSEX7IGlbinfwEk2XuJUDL8VpgOP2g9Z/sjW6GPbP/IPocgLXCuRAbC tbkafNw+tY/UYCam8ejsFML6ygw6MUN95bVQI5eWmp7lvad/LVbKNJJ2R jKMUP6gb7BW8k8BaG0dCVFWT8WvVuzFYFFhAErHp71gwsTYmysHLq46cc w==; X-IronPort-AV: E=McAfee;i="6500,9779,10464"; a="383607997" X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="383607997" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 13:10:06 -0700 X-IronPort-AV: E=Sophos;i="5.93,300,1654585200"; d="scan'208";a="718702453" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.143]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Sep 2022 13:10:06 -0700 From: Lucas De Marchi To: intel-gfx@lists.freedesktop.org Date: Thu, 8 Sep 2022 13:08:13 -0700 Message-Id: <20220908-if-ladder-v1-0-9949a713ca08@intel.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 X-Mailer: b4 0.10.0-dev-df873 Subject: [Intel-gfx] [PATCH v1 0/3] drm/i915: A couple of if/else ladder refactors 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: , Cc: Lucas De Marchi Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Refactor code to follow the same convention as last platform first. This series includes one patch that had already been reviewed, for frequency read and 2 more refactors. Signed-off-by: Lucas De Marchi --- Lucas De Marchi (3): drm/i915: Invert if/else ladder for frequency read drm/i915/gt: Extract per-platform function for frequency read drm/i915: Invert if/else ladder for stolen init drivers/gpu/drm/i915/gem/i915_gem_stolen.c | 51 +++----- drivers/gpu/drm/i915/gt/intel_gt_clock_utils.c | 171 +++++++++++-------------- 2 files changed, 93 insertions(+), 129 deletions(-) --- base-commit: adc57f2b82896fed07bc8e34956c15bb1448fca2 change-id: 20220908-if-ladder-df33a06d4f4e Best regards,