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: 13323551 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 B06FEC001DF for ; Mon, 24 Jul 2023 08:25:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231273AbjGXIZN (ORCPT ); Mon, 24 Jul 2023 04:25:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbjGXIZM (ORCPT ); Mon, 24 Jul 2023 04:25:12 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC44133; Mon, 24 Jul 2023 01:25:11 -0700 (PDT) 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="433624409" X-IronPort-AV: E=Sophos;i="6.01,228,1684825200"; d="scan'208";a="433624409" 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 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 , Andi Shyti Subject: [PATCH v3 1/1] drm/i915: Move abs_diff() to math.h 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 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 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