From patchwork Fri Jul 21 13:53: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: 13322038 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 15389EB64DC for ; Fri, 21 Jul 2023 13:53:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230508AbjGUNxg (ORCPT ); Fri, 21 Jul 2023 09:53:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231344AbjGUNxa (ORCPT ); Fri, 21 Jul 2023 09:53:30 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE16630EC; Fri, 21 Jul 2023 06:53:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689947600; x=1721483600; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=jwdXRg3P3UmW5n1ff6El/jezcNwpEzwczgkGeziGSaU=; b=oCdQJgBDnnCJLCopEj0hLn713msCnrzux0goLuLjXEnZjJMwnO1jRo7f 7d8WoxvEVksaun/MGmu72pDfntK2tpPFkOWR1Cr+WSRT/SAeG2Y6/wFcR p7qTXBKmu6i4En6gSF7vMrpllW/K54AlnYVo2n8Ed30bNug/TZyPuVTTk OwzK6Ml8T6+x/0hIRF0Ghe/89XAzgyl3gM3zxEmiJT/VQrP+hJ+x9xBQp Gg58nVzdWpItFlLlzz4ROG3F4bTfxUl3vH4GYnqtAy5aFWeN1wb6DF0Dm leOcXZWqIL65u1PeJV4mb4CZBAxB6bbj21qfQofV5AAOeMuKXGOFdw7Nb g==; X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="397919027" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="397919027" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 06:53:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="790205398" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="790205398" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 21 Jul 2023 06:53:14 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D288B370; Fri, 21 Jul 2023 16:53:21 +0300 (EEST) From: Andy Shevchenko To: Jani Nikula , Imre Deak , Andy Shevchenko , =?utf-8?q?Ilpo_J=C3=A4?= =?utf-8?q?rvinen?= , 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 , Philipp Zabel , Jiri Slaby , Helge Deller , Stephen Boyd , Nikita Shubin , Nikita Shubin via B4 Relay Subject: [PATCH v2 1/1] drm/i915: Move abs_diff() to math.h Date: Fri, 21 Jul 2023 16:53:18 +0300 Message-Id: <20230721135318.17603-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. Signed-off-by: Andy Shevchenko Reviewed-by: Jiri Slaby # tty/serial --- v2: better header location on ipu-v3, converted omap-serial as well 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 | 6 ++++++ 6 files changed, 16 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