Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3136708rwo; Thu, 3 Aug 2023 23:11:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE9tnpgwxqmlE6Ee5XiHsJbM/DLdC21wNbZ+uSX6TRYk3bOOqED6F0+iOGYiFqSKalUgyor X-Received: by 2002:a17:902:dad2:b0:1b3:fafd:11c5 with SMTP id q18-20020a170902dad200b001b3fafd11c5mr677425plx.44.1691129493997; Thu, 03 Aug 2023 23:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691129493; cv=none; d=google.com; s=arc-20160816; b=b2b5X15x+dEySuhq5dWnm8JDHPoPbeKCgy9hdkHjsBbMOwYymRwVqbfcNYcLWLnQqR gK8Mme4YDgMVn6ntuuBc0QxRQ3UWDyRsIqSRDC4JPJ1E3nmOZ7daUWK0oHFa07Eio7zz 1+eJah09Kc4e1JNws5szHRJ/JfK+7gIkS+rszoM/mmLji/2LcsJopllYa8/s9PsWDofi R6OyAxu5eyzrN/eYk5PW03jf0Vtj36rAChx5csElMJi4WVodWicR2RLFhVwV9G62dnVY tbWtiUFYpZmSuXHj3tZBIGDtr1YRDuWq9PKJ/mDUJawSzouUIoPfhbH79f4EDabYOUJj JGQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Qg1BzpcCBlZtLqUbr++ziMYLp2R2LQoOwOaQVvswVDI=; fh=OG6mgenPhkdQovUWFX3wFXMN7RP8b/yWNy11JXrlMu8=; b=o9e3bHFW2DPyEldxWpXF5GciHf4FvMyBameCPQHrft481/y1hUmS6kHN5rzbYIsCFN ZVQZMOpKTR6J7hnKbwsoAqF3HnwJTgGwIvWilCVqGjvPJg+9WvpCLBq99z2beBD+6BY9 MlBDTXmKCicHKcDUs6MjYPCsmbEuXgzOQkPI1sWBS4f3qLgyKXrshjHsbmc5PiWD4cMR 4csdpGRc09dOYEPPESypiBoHwJCfSOTLPZFzY3luBOtj01feptXtIHa5OjnnPbWjMgqB /vQ4mwiwDFKcvh9aO693wSOhpssiRqS/Vyg0zddL2dWVADYRsWLEuRwAMZJlVQb9DVE4 iqtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=P+mTRk0p; 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 ld7-20020a170902fac700b001b9eda236b5si1117472plb.506.2023.08.03.23.11.22; Thu, 03 Aug 2023 23:11:33 -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=P+mTRk0p; 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 S232803AbjHDEH3 (ORCPT + 99 others); Fri, 4 Aug 2023 00:07:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233110AbjHDEHY (ORCPT ); Fri, 4 Aug 2023 00:07:24 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 861AF3C28; Thu, 3 Aug 2023 21:07:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1691122042; x=1722658042; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Nct1OPaQWyF0NLQQ6u7Wq7eG9CS3igaS6y0hh8xq7cc=; b=P+mTRk0pXznlqitB1u0k4IgWqFzHW6Q69Y7LD1EgJiZ8s32Wnp8jexBh Q6npLYLmmP8Zcu0bFVOGXi0sO06FlbQ9qliXd2+TXhQ0CA0Jr4qf1QaRC EgHc8X+NyeUeWym7wWggt60pVhftfk+EEQA3d1x1JezGZM60vivSeIlu/ CId8NjVOlGe+KCrhctoIsk5z8z5NikS9P+c7dIjCrcxzn7Gms3NCjzjPE fQrBvR3KjCSkL3CO0XxZ7JzWT7pCCc2z60e9Y6DVv4zTKaNiQOxWePeQS Oaxvh5VVxvvBYG6abP4ob7hwKQRoVC30JXaN74Poyk6wZTevn0Kxx3mIb w==; X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="368962279" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="368962279" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Aug 2023 21:07:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10791"; a="679758521" X-IronPort-AV: E=Sophos;i="6.01,254,1684825200"; d="scan'208";a="679758521" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003.jf.intel.com with ESMTP; 03 Aug 2023 21:07:16 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1qRm5q-008pgS-0y; Fri, 04 Aug 2023 07:07:14 +0300 Date: Fri, 4 Aug 2023 07:07:14 +0300 From: Andy Shevchenko To: Andrew Morton Cc: Jani Nikula , Imre Deak , 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, Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Helge Deller , Rasmus Villemoes Subject: Re: [PATCH v4 1/1] drm/i915: Move abs_diff() to math.h Message-ID: References: <20230803131918.53727-1-andriy.shevchenko@linux.intel.com> <20230803102446.8edf94acc77e81ab2e09cee3@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230803102446.8edf94acc77e81ab2e09cee3@linux-foundation.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 On Thu, Aug 03, 2023 at 10:24:46AM -0700, Andrew Morton wrote: > On Thu, 3 Aug 2023 16:19:18 +0300 Andy Shevchenko wrote: ... > > +#define abs_diff(a, b) ({ \ > > + typeof(a) __a = (a); \ > > + typeof(b) __b = (b); \ > > + (void)(&__a == &__b); \ > > + __a > __b ? (__a - __b) : (__b - __a); \ > > +}) > > Can we document it please? > > Also, the open-coded type comparison could be replaced with __typecheck()? > > And why the heck isn't __typecheck() in typecheck.h, to be included by > minmax.h. > > etcetera. Sigh. I'll grab it, but please at least send along some > kerneldoc? Sure and thank you! -- With Best Regards, Andy Shevchenko