Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp771956iog; Mon, 13 Jun 2022 12:36:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU3qhyuUc+Si5+al1dJn2e3ok8gJ6gUWCLiiUlOQK12rNgnARfRzht5tsPic9qyJiTpolD X-Received: by 2002:a17:906:7a57:b0:711:faf1:587d with SMTP id i23-20020a1709067a5700b00711faf1587dmr1138342ejo.581.1655149003958; Mon, 13 Jun 2022 12:36:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655149003; cv=none; d=google.com; s=arc-20160816; b=WOrgvWgqc4x8/0dthlStDvd5XWkMIJZGY3Qy4GLSbECf3AElLokwW6k/OskgxiXc5A gUlktZld5amYzV6cGrmfz/ROs88PutEt1VjfzPrxabHTcAUsWxfQNA2oftqD9R75aT6O bTeYW8/qvhoHe7uKlM9zfwJFiDQogRy7BIg7YntPfek5y85V9NLLlczTF+4vfQ9/EvBQ dNDfH8r4G/NClAw1+hoBXMrDQK+OantbulWxU7EfEEqfQ2wIFfM2xyrf/dhxB9m+mkxT KTh7ohWMqHpw29PkZBqZhhr0K8ko1EjhWYbFQYHVQy2xnvl/juikVpWFBuekXRfzrm9+ Crsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=v9wOSbkkFgoouudCT5M9ut11ttnj6LGZRsAbuaQUW4w=; b=bRwPHpNkeH6LSn1BYAot44nLrx0UL3ujE8874uUG9DRwY+piLeT0iSe25H2HXvhoyg x8bV/lV4uKOvHSundC7KR4kF2zjDQMgGkPTRNLIr+M4s2zU9k8QrrIAmJcaqYr9+2K09 R8csgC3cYshXG/HoKMmThk9pHTdAmULQT0EiCMmbOSPWrIjax9XMJWGpvjxFAdjEKNoF JCunz3qkrmh2PkoDokHU7zVhgZ7aaZO+zzKzvl0yVBXw+4OczoqPA5HhpDgbO38cs0yv p954Kh3sWtxi7xPJ2ronJpavwyllMldKS1QpiiJ7sAvfk/gfoYUSg4HaUdn2zkweGAx5 n1gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="AhRXQM/u"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g18-20020a1709065d1200b00702d8b7438csi8768136ejt.326.2022.06.13.12.36.17; Mon, 13 Jun 2022 12:36:43 -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=@gmail.com header.s=20210112 header.b="AhRXQM/u"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349913AbiFMTY1 (ORCPT + 99 others); Mon, 13 Jun 2022 15:24:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53182 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350071AbiFMTXW (ORCPT ); Mon, 13 Jun 2022 15:23:22 -0400 Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A9C63522CD for ; Mon, 13 Jun 2022 10:19:55 -0700 (PDT) Received: by mail-wr1-x42c.google.com with SMTP id h5so8031055wrb.0 for ; Mon, 13 Jun 2022 10:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=v9wOSbkkFgoouudCT5M9ut11ttnj6LGZRsAbuaQUW4w=; b=AhRXQM/ukGy67WqPvSWEdkzh2PE+yy+GSFhlwgy+rjdEcBQcH5eTH7wmfvOFQZ2+2g S2NoTKCqKPCjaIsxjCSDZKihElHpfrXopMf0Gvr1nWl6qFzmc4Rc9R/OCX8XXiAnZ3z2 3mMZ1tYsDbkbr+HujclIPj1SogBHfm7NDSF8qEzfkoEuxVDqnMvotCfqtMgGcOLnrt0C FNZiHc/RrEuV5NC0Wjh+Ib++wXt99f9T+4ntJIv7vi99j0/qXrAejs2G2swfZ3NBBBeS i7Xxq0fQR9Et8WY8Hl5XgxQuIs4n+t1h9QP85QyB0kf3CHBK1OLwHHO8Ifsq88iyH651 YxAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=v9wOSbkkFgoouudCT5M9ut11ttnj6LGZRsAbuaQUW4w=; b=nCkV3cqEN6RQbDuqk3TMnO1MMUOTTXasPNvlDDl3/h7/2j/wRWTtsWPheSmzIsGEHx 7i5moMOuVjx0xUjVwOpp3pg4KM21NYpxz9ZcDUMqEaxrB2Z8Nc4O88Dgzs+1SRCEZ0Ty yZ42cBaD4B8PizPI414WVbcQO2if7DTNrPuOZSa7IFcePINhTJNiRS8BiANgazzb+uwu JJ3vQqVUZ0Ymeh1XJsRSoZ3cSHssWky1aB421ZrYta46v3QamZ086EbWMhbS1iWLUYr/ L22K5GmhbuTRAin4iudZoFYEU/7ZevPQ4W+Izgp4+v6qVlLp4HlxgD4N1+q6KYmCb+ka +Jlw== X-Gm-Message-State: AJIora/U0c3rmIFTEvwGcR5JZfpqs+doFZ0Wl2ayPOsK8OLVBQE5XTa9 gOahYKBZlcAxkR8qRBcv5UU= X-Received: by 2002:a05:6000:1688:b0:218:47d6:5e46 with SMTP id y8-20020a056000168800b0021847d65e46mr785988wrd.699.1655140794288; Mon, 13 Jun 2022 10:19:54 -0700 (PDT) Received: from elementary ([94.73.36.128]) by smtp.gmail.com with ESMTPSA id r8-20020a05600c424800b0039740903c39sm9879039wmm.7.2022.06.13.10.19.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Jun 2022 10:19:53 -0700 (PDT) Date: Mon, 13 Jun 2022 19:19:51 +0200 From: =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= To: Jani Nikula Cc: javierm@redhat.com, davidgow@google.com, airlied@linux.ie, dlatypov@google.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, tzimmermann@suse.de, kunit-dev@googlegroups.com Subject: Re: [PATCH v2 1/3] drm/rect: Add DRM_RECT_INIT() macro Message-ID: <20220613171951.GA132742@elementary> References: <20220612161248.271590-1-jose.exposito89@gmail.com> <20220612161248.271590-2-jose.exposito89@gmail.com> <87pmjdyp62.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <87pmjdyp62.fsf@intel.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 Mon, Jun 13, 2022 at 10:53:57AM +0300, Jani Nikula wrote: > On Sun, 12 Jun 2022, Jos? Exp?sito wrote: > > Add a helper macro to initialize a rectangle from x, y, width and > > height information. > > > > Signed-off-by: Jos? Exp?sito > > --- > > 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; > > }; > > > > +/** > > + * 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. Thanks a lot for your review Jani, just emailed v3 with your suggested changes. Jose > BR, > Jani. > > > > + > > /** > > * DRM_RECT_FMT - printf string for &struct drm_rect > > */ > > -- > Jani Nikula, Intel Open Source Graphics Center