Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp2822565rwo; Mon, 24 Jul 2023 01:35:42 -0700 (PDT) X-Google-Smtp-Source: APBJJlHHyTzYiyAckv/HKDn2huH9tWUsBf/2ogdHiU0q9RykjL1XKiWEmzgp5wCog+CjsekU25Qr X-Received: by 2002:aa7:88cf:0:b0:677:c5bf:dcc7 with SMTP id k15-20020aa788cf000000b00677c5bfdcc7mr10336081pff.17.1690187742489; Mon, 24 Jul 2023 01:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690187742; cv=none; d=google.com; s=arc-20160816; b=Kxmdbqt5Ly6EV5Vpqbq9vsTOnJDyv3WQkZVh3tHr6/fXMerSxVsZSbDGESw/i7Bftv esSYSnR0j9kz3h6wqqqRcd9ylxJD5Jdb+1ZCQF3Rl+KqlLu0LEh/eq7uoJfxWcvF6ktJ P8FuEkaEeF0IAZb+sVh+5/c81IZE1Gho9OEO2OBXKjiaOfKdp1rhLBKahYo8fa9QpXFh HNieR4TynyUehxFp6Gdz4+TykygHFCdfP1jW2KEcP5Ic4TMrz2+Jcf5prU/uQQJRyEyW NVyj8LwMWG0adEfYOJjZj3sR/4cxJmoXdu3BD2lV83yJasOIizuCnDN8WSf13/p7lH5R 77sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=/hh4o7AoFCZy8ZLAGDNdo4F9dJc56sS3AT7sReODyzI=; fh=htvDAZ2EevmTTVeHYZ2G/XahFb3tTzLEZ8jpgmY8BR0=; b=RSk82nQGf6i2Gt+NuJv4ySqm8TzB+aqwSZLlpK0cDe+uZwqVmZHST3IG/9/4idJHxu DehEbpWMwmG/43mcN4VvJMBUEoqC0L740TnQGuhE1l+k52wlTVxNEsnhIWlbD+pdPIkp PCAG7aaf1lsuID0m2xW1i0JW41fkSlUlZgZqIeH77WpJyqEs6L5QpdWup4L1R/cFMRuR GqdV0J7iKmEDPFHr2ep78/iKRlhvWkoEGi/e7hMu4oYcWQXCepbX9V1Ajw0fmGhOMxYi UrkAxahak00G+09v2txLl83p0JKaRTv4RgRULFU3QbAt4jxsM2AYri9VETkv78R7Z7Qc g6Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mS2AVJvP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt19-20020a056a00439300b00682acfc5dacsi8516349pfb.53.2023.07.24.01.35.30; Mon, 24 Jul 2023 01:35:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mS2AVJvP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231394AbjGXIZO (ORCPT + 99 others); Mon, 24 Jul 2023 04:25:14 -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=20J=C3=A4rvinen?= , 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 --- 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