lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CABVgOSnFXqEsnZOeXbu1z8S1nxWcpjWF1SWd7TY3zXCDr5WvcQ@mail.gmail.com>
Date:   Wed, 22 Jun 2022 15:12:26 +0800
From:   David Gow <davidgow@...gle.com>
To:     Thomas Zimmermann <tzimmermann@...e.de>
Cc:     José Expósito <jose.exposito89@...il.com>,
        dri-devel@...ts.freedesktop.org, magalilemes00@...il.com,
        David Airlie <airlied@...ux.ie>,
        Maíra Canal <maira.canal@....br>,
        Daniel Latypov <dlatypov@...gle.com>,
        Javier Martinez Canillas <javierm@...hat.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jani Nikula <jani.nikula@...el.com>, tales.aparecida@...il.com,
        Isabella Basso <isabbasso@...eup.net>,
        KUnit Development <kunit-dev@...glegroups.com>
Subject: Re: [PATCH v4 1/3] drm/rect: Add DRM_RECT_INIT() macro

On Tue, Jun 21, 2022 at 6:02 PM Thomas Zimmermann <tzimmermann@...e.de> wrote:
>
> Hi
>
> Am 21.06.22 um 11:38 schrieb David Gow:
> > On Tue, Jun 21, 2022 at 12:06 AM José Expósito
 [ ... ]
> >> +/**
> >> + * 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 = (x), \
> >> +               .y1 = (y), \
> >> +               .x2 = (x) + (w), \
> >> +               .y2 = (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.
>
> The existing drm_rect_init() function uses xywh arguments. So the
> current name is consistent with existing practice. I don't think we
> refer to x2,y2 much, if ever.
>

Ah, fair enough. I wasn't aware of the existing drm_rect_init()
function, so this makes sense as-is.

Cheers,
-- David

Download attachment "smime.p7s" of type "application/pkcs7-signature" (4003 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ