From patchwork Thu Aug 3 13:19:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13339987 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 1B115EB64DD for ; Thu, 3 Aug 2023 13:30:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235803AbjHCNa4 (ORCPT ); Thu, 3 Aug 2023 09:30:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235045AbjHCNah (ORCPT ); Thu, 3 Aug 2023 09:30:37 -0400 Received: from mgamail.intel.com (unknown [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 027EA134; Thu, 3 Aug 2023 06:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691069362; x=1722605362; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=W1vGWvXnwAY/f51FTl0188tECkxF+EFRNzlkxGetUxc=; b=Y1OFQwJ5+Uch8dR/f4uFver+ZmiPwJA4Mu4hVyPr8LxCSHhQ+fKWn86+ JoqLN1HO2nT9u3Z99E2tfBgstS9kMHD57h5kOyIaBmkkDLl0bxyKgJSja O4o2lcXKlv89wkDSjxdeQZusI5tyrD4zbOkQ7l00XvdMRUaanAR/JOPtZ 8wV/U225bfZgs/ErZKaotCJfSmRVMqXIzSPv1ruaX27yLcj2Z1Ea3nnIZ IGxhTj8UIlkCVZAbcYTYSicVhXRNynQSZ+LufzIQYt43a8cFOMiYWb8J8 dx7x8dA/vZq6uz0GHHP3/WMv4VtuifqO6dgICvMiJ8OSr5ZVZSA3sC0Du Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="373499604" X-IronPort-AV: E=Sophos;i="6.01,252,1684825200"; d="scan'208";a="373499604" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 06:19:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="794985503" X-IronPort-AV: E=Sophos;i="6.01,252,1684825200"; d="scan'208";a="794985503" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 03 Aug 2023 06:19:10 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id DC3932AB; Thu, 3 Aug 2023 16:19:21 +0300 (EEST) From: Andy Shevchenko To: Jani Nikula , Imre Deak , Andy Shevchenko , Philipp Zabel , Andi Shyti , Jiri Slaby , Greg Kroah-Hartman , 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 Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Helge Deller , Rasmus Villemoes , Andrew Morton Subject: [PATCH v4 1/1] drm/i915: Move abs_diff() to math.h Date: Thu, 3 Aug 2023 16:19:18 +0300 Message-Id: <20230803131918.53727-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org abs_diff() belongs to math.h. Move it there. This will allow others to use it. Reviewed-by: Jiri Slaby # tty/serial Acked-by: Jani Nikula Acked-by: Greg Kroah-Hartman Reviewed-by: Andi Shyti Reviewed-by: Philipp Zabel # gpu/ipu-v3 Signed-off-by: Andy Shevchenko --- v4: - Cc'ed to Andrew (as Jani told he is okay to route it via other tree) - added tags 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