From patchwork Fri Jul 21 13:42:35 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13322009 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 B9C01EB64DC for ; Fri, 21 Jul 2023 13:43:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229887AbjGUNnS (ORCPT ); Fri, 21 Jul 2023 09:43:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229835AbjGUNnS (ORCPT ); Fri, 21 Jul 2023 09:43:18 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2425E1722; Fri, 21 Jul 2023 06:43:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1689946997; x=1721482997; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=y9NwNsAvvJdmVT4QE057QDIVHB4LGSYtYpCb0IL6g84=; b=V7cmpBxSdrQTcPePu3paLZNO1EmDCure8gzkBEo6N8G2Z6CsBkzbWtf7 p9P2dyWMFGsOJDV+JyEDPkB+9qFTaiAm0JGNRfqba+6CVB+30ESR0i3SC zJWV9r3//VH5L1FdCuJHHhpynmeSDGXNZUBPG4ROlIO71j3V+XiiuJQbg Zm2/r/Mj+RIkfEkQi8/BMRbsmTkP9uo0Wl5P4SH8TVAfgPZcyTqAxt73D jYJVuIT4MHmovmITG3MAwpBIvC2ZcWDsycwkuKp15uC6wEx52L0S3nQu+ QsqC0LnxU3i4xKJ5bNk39vd+JgJAukYM0E3+4MOekvGF6BF/WP4vRJHAg A==; X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="430816233" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="430816233" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Jul 2023 06:43:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10778"; a="848826421" X-IronPort-AV: E=Sophos;i="6.01,220,1684825200"; d="scan'208";a="848826421" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga004.jf.intel.com with ESMTP; 21 Jul 2023 06:43:11 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 0E01F370; Fri, 21 Jul 2023 16:43:18 +0300 (EEST) From: Andy Shevchenko To: Jani Nikula , Imre Deak , Andy Shevchenko , Alexey Dobriyan , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Philipp Zabel , Helge Deller , Stephen Boyd , Nikita Shubin , Nikita Shubin via B4 Relay Subject: [PATCH v1 1/1] drm/i915: Move abs_diff() to math.h Date: Fri, 21 Jul 2023 16:42:35 +0300 Message-Id: <20230721134235.15517-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 --- 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 | 14 ++++++-------- drivers/video/fbdev/core/svgalib.c | 7 +------ include/linux/math.h | 6 ++++++ 5 files changed, 14 insertions(+), 21 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..420992ac2ecd 100644 --- a/drivers/gpu/ipu-v3/ipu-image-convert.c +++ b/drivers/gpu/ipu-v3/ipu-image-convert.c @@ -8,6 +8,8 @@ #include #include #include