Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp225575iog; Mon, 13 Jun 2022 00:56:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3w/8y7o+TVI16CKxqCSxT5uz7Newi2sWe3qtz64DSa8xJYXUlAj/qSxQNGE+6i86NczCm X-Received: by 2002:a17:906:27d4:b0:710:9a8a:85ef with SMTP id k20-20020a17090627d400b007109a8a85efmr42308424ejc.136.1655106997122; Mon, 13 Jun 2022 00:56:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655106997; cv=none; d=google.com; s=arc-20160816; b=NUT9ocEgMWWpqhvuzhyNmgbWLl6I71emkA4mZfaNsM7myAYcHWZwsczLV31VjmDTgP zU/f6qm3LII4WcyhYrh5GMQChq36nOT9wsWUk+gA2DoBQFCCSxaQrNIiuWSNOSFtzSJq bpJt08rD1eKoAx2kI/lVtTOfdBoFzA8hyMRRK4bcPCU9rPjSyJHWjs41gAaQRN37zoUR m2TyFuMbxeYSzt7RJrBPaCvkedtXHTBRcClw9DJGdbILeDunqGGUaJ9x/4cpAgVdwtHQ usMNd1s8yDvffJO8V+12/6sefwQQP0svMGn9ZGUFR+qtVR2pOq2+MHU4NhctWU3BpjvQ RsxA== 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:references:organization:in-reply-to:subject:cc:to :from:dkim-signature; bh=Ym8bXS5HEp6qwipGx4HfkC3qDzbrMjqhebi3MNH9Enw=; b=KZ6cmAz1HjrO4KJy5nrCHhwLWdjZU5BCn5KBbMhnWDVmL1xuQMCQHfOEqvRNJ7MZEy 7GyYlRIf9p3uOg+oGAcRXovVfwAq6j4i6I0+jazNQN92qoajcBAHZrQGR7mzrJsxctz1 1dftmpVeOdZ37j4RqAdbPorynCruZq6TOfwimXC/EiE14c5eIeD/zf0sxzpQfd9Hd+wn J0NyQ0jXYH6D1msbWcT8U+Vp+yH+xSlub9lfrgTfvrx6go8JASI382PX3Yu6aF0jm84D qI5O6hEMWuEOxQ8dDRpzPSB3OWinfRhbWV2jqXHRLfPm6tMGJZsYN/e/xs3WxEZrh/do D0jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="D7FAg/7N"; 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 ga5-20020a1709070c0500b0071076a14dc5si7539097ejc.774.2022.06.13.00.56.12; Mon, 13 Jun 2022 00:56:37 -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="D7FAg/7N"; 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 S233074AbiFMHyR (ORCPT + 99 others); Mon, 13 Jun 2022 03:54:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235222AbiFMHyM (ORCPT ); Mon, 13 Jun 2022 03:54:12 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48029101DE for ; Mon, 13 Jun 2022 00:54:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655106852; x=1686642852; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version:content-transfer-encoding; bh=O8tMnzfOI/GijOMMiN7vNOf1uJlj0uc0jxlTVKkoOEo=; b=D7FAg/7NKDSK47ti6mNCrFavrQsgtikfvfUsBaxsra9yq38kaAG9ik3Q Aefzik07bnfu4dcyTyeTd+JKf/S8ggLEZTWDoPNOuTCERdwOSXRJum9R9 SHXgYdepQo5k64CNmrFjbVLRBq4Vsq6FMLy3yjCEa33mqXYvbwjIoRMA5 ZWPNfewPkb+av935HFoxCimXyjEdUWZiBQbjeeDplSEQpdQoYzDbqJiTe R1iUute7YZSKFqIbisLO+U1PBgo+WD00epqoTGJoRXPrfnCostLfAM8aQ X/sfN/0Hj4EkNQD/1Mfd44B+XHmemeXma3+7YwPa0i8YDv060a/V+VYTE A==; X-IronPort-AV: E=McAfee;i="6400,9594,10376"; a="278238328" X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="278238328" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2022 00:54:04 -0700 X-IronPort-AV: E=Sophos;i="5.91,296,1647327600"; d="scan'208";a="639594390" Received: from njascanu-mobl.ger.corp.intel.com (HELO localhost) ([10.252.47.149]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jun 2022 00:54:01 -0700 From: Jani Nikula To: =?utf-8?Q?Jos=C3=A9_Exp=C3=B3sito?= , javierm@redhat.com Cc: davidgow@google.com, airlied@linux.ie, dlatypov@google.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, tzimmermann@suse.de, =?utf-8?Q?Jos=C3=A9_Exp=C3=B3sito?= , kunit-dev@googlegroups.com Subject: Re: [PATCH v2 1/3] drm/rect: Add DRM_RECT_INIT() macro In-Reply-To: <20220612161248.271590-2-jose.exposito89@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20220612161248.271590-1-jose.exposito89@gmail.com> <20220612161248.271590-2-jose.exposito89@gmail.com> Date: Mon, 13 Jun 2022 10:53:57 +0300 Message-ID: <87pmjdyp62.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 On Sun, 12 Jun 2022, Jos=C3=A9 Exp=C3=B3sito wr= ote: > Add a helper macro to initialize a rectangle from x, y, width and > height information. > > Signed-off-by: Jos=C3=A9 Exp=C3=B3sito > --- > include/drm/drm_rect.h | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h > index 6f6e19bd4dac..945696323c69 100644 > --- a/include/drm/drm_rect.h > +++ b/include/drm/drm_rect.h > @@ -47,6 +47,18 @@ struct drm_rect { > int x1, y1, x2, y2; > }; >=20=20 > +/** > + * DRM_RECT_INIT - initialize a rectangle from x/y/w/h > + * @x: x coordinate > + * @y: y coordinate > + * @w: width > + * @h: height > + * > + * RETURNS: > + * A new rectangle of the specified size. > + */ > +#define DRM_RECT_INIT(x, y, w, h) { (x), (y), (x) + (w), (y) + (h) } Please use designated initializers. It might help type safety if it also contained a (struct drm_rect) cast. BR, Jani. > + > /** > * DRM_RECT_FMT - printf string for &struct drm_rect > */ --=20 Jani Nikula, Intel Open Source Graphics Center