Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3645036iog; Tue, 21 Jun 2022 03:03:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sMHnrMNEQUbNIw+tXWmUlLhN88rGbjFAyIojl4nQHftmSv0TH9sIKqgX7bPFi1GhHYXc/7 X-Received: by 2002:a05:6402:3705:b0:435:5e48:b6c7 with SMTP id ek5-20020a056402370500b004355e48b6c7mr26479011edb.396.1655805822738; Tue, 21 Jun 2022 03:03:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655805822; cv=none; d=google.com; s=arc-20160816; b=wGUOAdQRyxdXLwO/EjqaTJ77AUxWLAP1pSnD7n/Vst5uRHlV/C7275atm0zm1JbMjH d5qBBDeLOqzE2dJer0ISizV/NZ1Yep99y6PxSNzvzxXVW742pDIQFC8sYpepVkHYZjkS z0nl1qiqed6fF4S5EJkTHRkTQK+oiKFYoAQZ/RHtNgtiMsjcWnh6NmPmj8bR6c7JgvNg w18wQj1ScqLW8cdVZyN8dELFZOvSVWidzptr8/DsSwHv4K3lGH4n4taxnOlUxVS4t1jA UbYhaKwqd/hMvC//DwMRF5dmuFr2y4S/6MfSMMPQTKknFre/wi9Y8BUO8QmT0JKFff/e tY7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=wVV1kgkOYc9WD2BZGRnaDHVlgrSB3okEof8wTqZkR1Y=; b=V9Bj1WaYGYt3N8u/D/WkbtpUEMntqAiFEo65JS2OZTJplftCm6dctA1oAJNtSv/3ao gZz9C3OZqyElM36+LRMDagUEvi42cKh4pXtDJcOd9Xc4eGyxKuen0ihfGHpAYuPsff5B 4yU7ak03F6Sj0CgGZJ6Mi/Akptq+JNqdSOhF7PwXzFDZwJaUifIEyPjp+I7W0KPfz2EA +1JcKlBBTbSLiHN7pHdUOmFyfXsz3ps7M0xXH2UXc5v/zY2dT0FQag3J6S5BRWxunfv0 eR/41gWDloZJ7bVPrVN50knBt9QkMgqHaIOSGq2aDw2YIyuuY+Pg0AkrgduvcLsLBnuT odkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=rZwkqty8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hz1-20020a1709072ce100b00722e6656ea0si811749ejc.401.2022.06.21.03.03.16; Tue, 21 Jun 2022 03:03: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=@google.com header.s=20210112 header.b=rZwkqty8; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349184AbiFUJiq (ORCPT + 99 others); Tue, 21 Jun 2022 05:38:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349141AbiFUJim (ORCPT ); Tue, 21 Jun 2022 05:38:42 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 752442B8 for ; Tue, 21 Jun 2022 02:38:41 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id n1so17832419wrg.12 for ; Tue, 21 Jun 2022 02:38:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wVV1kgkOYc9WD2BZGRnaDHVlgrSB3okEof8wTqZkR1Y=; b=rZwkqty8+yl9OrZL9JlyoCfL7zooS2eY/Dh9sqhZoaOQ3VqdUlrScC9JTtlQZhcCO8 zddqt/E9pwIqysQ7Gcf/vRJ22yviQAA5F0wrki5+2RigggW3wmF5PnmXGM60elD59Aoz A1EJ64hATwMB2glD75lqdnP4wA1glmHnMRYBgK/wTmUhz4v59Xw4HGqcathzNBMVeNgY yiwkXx+Yyt5xzuYPmsczjE8J7YrChPqTPxfGwqg8/wqF+cUVBjjhr0Aiam1+P3c8tS97 I8n0V2z/T6DXPGb7gE1irDe31c4UmEZPFH0mcPs7cSAc1LxHYnTDCDsdaG2dGZ+tHF3w DCWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=wVV1kgkOYc9WD2BZGRnaDHVlgrSB3okEof8wTqZkR1Y=; b=GNXMOR2aEkcxu8xwUPSErbNPzGUQZFiY+7jMWLcO+BSUbXMgWbvfCMPAqBNdz5flyr CFRGFeEPKct7eHuK1K/0t0L2U5PmZr9RsuieUiRsxl4F1pngpP7EIwfcbJYJdBGwlK5k Cg4S8fimpF+LEzjNHCDu4ErrMc/TkwWzbJJlHMZX5wZ6fbD0FBJmSEOtFSYa74YsSM/N C8d6dTtODMLh9N5XTU/u9QHgCbMCnAHz8NPOGInUfs7LThSw692QT+OmMui+0w+p3xjh RYMLa/z0zagQiWn4xUt59fWk/6eFFdLHiA4Z5tsX6ItZarN6QfqJLA1Q3AdGiDij24Il 7hYA== X-Gm-Message-State: AJIora+fqaFTF+fsWHnbVSx84bNHFfF5JCUq4MGZNxFWuVtUtH3job5k VD6YRfmP2OZ0Lawu2wmUoVXj8Aipl773E6U3EiJWbg== X-Received: by 2002:a5d:570e:0:b0:21b:9610:2dd7 with SMTP id a14-20020a5d570e000000b0021b96102dd7mr3422861wrv.337.1655804319725; Tue, 21 Jun 2022 02:38:39 -0700 (PDT) MIME-Version: 1.0 References: <20220620160640.3790-1-jose.exposito89@gmail.com> <20220620160640.3790-2-jose.exposito89@gmail.com> In-Reply-To: <20220620160640.3790-2-jose.exposito89@gmail.com> From: David Gow Date: Tue, 21 Jun 2022 17:38:28 +0800 Message-ID: Subject: Re: [PATCH v4 1/3] drm/rect: Add DRM_RECT_INIT() macro To: =?UTF-8?B?Sm9zw6kgRXhww7NzaXRv?= Cc: Javier Martinez Canillas , Daniel Latypov , Thomas Zimmermann , maarten.lankhorst@linux.intel.com, Maxime Ripard , David Airlie , Daniel Vetter , Jani Nikula , =?UTF-8?B?TWHDrXJhIENhbmFs?= , Isabella Basso , magalilemes00@gmail.com, tales.aparecida@gmail.com, dri-devel@lists.freedesktop.org, KUnit Development , Linux Kernel Mailing List , Jani Nikula Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg=sha-256; boundary="0000000000005335b705e1f1fcad" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL 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 --0000000000005335b705e1f1fcad Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Jun 21, 2022 at 12:06 AM Jos=C3=A9 Exp=C3=B3sito wrote: > > Add a helper macro to initialize a rectangle from x, y, width and > height information. > > Reviewed-by: Jani Nikula > Acked-by: Thomas Zimmermann > Signed-off-by: Jos=C3=A9 Exp=C3=B3sito > --- This looks good to me, though I have one minor concern about the macro name. (But if it's okay with the DRM folks, which it seems to be, I won't object.) Either way, Reviewed-by: David Gow > include/drm/drm_rect.h | 16 ++++++++++++++++ > 1 file changed, 16 insertions(+) > > diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h > index 6f6e19bd4dac..e8d94fca2703 100644 > --- a/include/drm/drm_rect.h > +++ b/include/drm/drm_rect.h > @@ -47,6 +47,22 @@ struct drm_rect { > int x1, y1, x2, y2; > }; > > +/** > + * 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) ((struct drm_rect){ \ > + .x1 =3D (x), \ > + .y1 =3D (y), \ > + .x2 =3D (x) + (w), \ > + .y2 =3D (y) + (h) }) > + My only slight concern here is that it might be a little bit confusing that a macro called DRM_RECT_INIT() accepts x/y/w/h, whereas the actual struct drm_rect is x1/y1/x2/y2. If the macro were called something like DRM_RECT_INIT_FROM_XYWH() or similar. > /** > * DRM_RECT_FMT - printf string for &struct drm_rect > */ > -- > 2.25.1 > --0000000000005335b705e1f1fcad Content-Type: application/pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" Content-Description: S/MIME Cryptographic Signature MIIPnwYJKoZIhvcNAQcCoIIPkDCCD4wCAQExDzANBglghkgBZQMEAgEFADALBgkqhkiG9w0BBwGg ggz5MIIEtjCCA56gAwIBAgIQeAMYYHb81ngUVR0WyMTzqzANBgkqhkiG9w0BAQsFADBMMSAwHgYD VQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UE AxMKR2xvYmFsU2lnbjAeFw0y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