From patchwork Mon Jul 24 08:25:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13323553 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 8FF9EC001B0 for ; Mon, 24 Jul 2023 08:25:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CCF3C10E282; Mon, 24 Jul 2023 08:25:13 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4575B10E27C; Mon, 24 Jul 2023 08:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1690187109; x=1721723109; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/0rsj8A0b5wTWXkiO061pramtAIL3iSBnO8ANxq5Bto=; b=mS2AVJvPLximhpM8fwhxfSWn4eHNsFMKdSCqJSJU3b1hR4vtgyMFiBYk x+oPnPHV/CuRdF2lEyUwQSwNnzYLVQpWKgVq86i+GVf+P1Hg5QQcGvx65 ysL96mnYCcaZZauwFqDKwNcZD+kT+i7c+ThIj7th3BVp9fOmF6WJdzTIU xxW6YeRMXnMUsU7/LZwCmXEBBizXHRyQrb6o53WuUx+BJVXZ8mAPe25y4 ZB9DzilgTAEorxD+B3kghPE3h1q2vNKhVzJ4U5YwMlLMvpOA8Eroieade bkNCQIOPVCrl0SLMTSehcxOHhszZlDfBB3ukUS9L/4o12RgTwQz8v2qVO A==; X-IronPort-AV: E=McAfee;i="6600,9927,10780"; a="433624411" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="433624411" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Jul 2023 01:25:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10780"; a="795686172" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="795686172" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 24 Jul 2023 01:25:05 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 65FC51A6; Mon, 24 Jul 2023 11:25:13 +0300 (EEST) From: Andy Shevchenko To: Jani Nikula , Imre Deak , Andy Shevchenko , Jiri Slaby , Greg Kroah-Hartman , =?utf-8?q?Ilpo_J=C3=A4rvin?= =?utf-8?q?en?= , Alexey Dobriyan , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, linux-fbdev@vger.kernel.org Date: Mon, 24 Jul 2023 11:25:11 +0300 Message-Id: <20230724082511.3225-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH v3 1/1] drm/i915: Move abs_diff() to math.h 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: Philipp Zabel , Nikita Shubin , Stephen Boyd , Helge Deller , Andi Shyti , Daniel Vetter , Rodrigo Vivi , David Airlie , Nikita Shubin via B4 Relay Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" abs_diff() belongs to math.h. Move it there. This will allow others to use it. Signed-off-by: Andy Shevchenko Reviewed-by: Jiri Slaby # tty/serial Reviewed-by: Philipp Zabel # gpu/ipu-v3 Reviewed-by: Andi Shyti Acked-by: Greg Kroah-Hartman Acked-by: Jani Nikula --- v3: added tag (Jiri), removed space after a cast (fdo CI) drivers/gpu/drm/i915/display/intel_dpll_mgr.c | 1 + drivers/gpu/drm/i915/display/intel_dpll_mgr.h | 7 ------- drivers/gpu/ipu-v3/ipu-image-convert.c | 15 +++++++-------- drivers/tty/serial/omap-serial.c | 7 +------ drivers/video/fbdev/core/svgalib.c | 7 +------ include/linux/math.h | 7 +++++++ 6 files changed, 17 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c index 6b2d8a1e2aa9..290e856fe9e9 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.c +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.c @@ -21,6 +21,7 @@ * DEALINGS IN THE SOFTWARE. */ +#include #include #include "i915_reg.h" diff --git a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h index ba62eb5d7c51..04e6810954b2 100644 --- a/drivers/gpu/drm/i915/display/intel_dpll_mgr.h +++ b/drivers/gpu/drm/i915/display/intel_dpll_mgr.h @@ -29,13 +29,6 @@ #include "intel_wakeref.h" -/*FIXME: Move this to a more appropriate place. */ -#define abs_diff(a, b) ({ \ - typeof(a) __a = (a); \ - typeof(b) __b = (b); \ - (void) (&__a == &__b); \ - __a > __b ? (__a - __b) : (__b - __a); }) - enum tc_port; struct drm_i915_private; struct intel_atomic_state; diff --git a/drivers/gpu/ipu-v3/ipu-image-convert.c b/drivers/gpu/ipu-v3/ipu-image-convert.c index af1612044eef..841316582ea9 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -7,7 +7,10 @@ #include #include +#include + #include