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] [thread-next>] [day] [month] [year] [list]
Message-ID: <68d14afc-d641-4a4f-b3c8-37d280b5f571@ideasonboard.com>
Date: Tue, 23 Apr 2024 15:16:25 +0300
From: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>
To: Sean Anderson <sean.anderson@...ux.dev>,
 Laurent Pinchart <laurent.pinchart@...asonboard.com>,
 Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
 Maxime Ripard <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>,
 dri-devel@...ts.freedesktop.org
Cc: David Airlie <airlied@...il.com>, Daniel Vetter <daniel@...ll.ch>,
 linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
 Michal Simek <michal.simek@....com>
Subject: Re: [PATCH v3 01/13] drm: xlnx: Store base pointers in zynqmp_disp
 directly

On 22/04/2024 21:45, Sean Anderson wrote:
> The blend, avbuf, and audio members of zynqmp_disp are anonymous structs
> with only one member each. This is rather pointless, so move the members
> up a level.
> 
> Signed-off-by: Sean Anderson <sean.anderson@...ux.dev>
> ---
> 
> Changes in v3:
> - New

I would have renamed the fields to, e.g., "blend_base", but it doesn't 
really matter as they are accessed only in a couple of places.

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@...asonboard.com>

  Tomi

>   drivers/gpu/drm/xlnx/zynqmp_disp.c | 44 +++++++++++++-----------------
>   1 file changed, 19 insertions(+), 25 deletions(-)
> 
> diff --git a/drivers/gpu/drm/xlnx/zynqmp_disp.c b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> index 407bc07cec69..94a3ac046373 100644
> --- a/drivers/gpu/drm/xlnx/zynqmp_disp.c
> +++ b/drivers/gpu/drm/xlnx/zynqmp_disp.c
> @@ -128,24 +128,18 @@ struct zynqmp_disp_layer {
>    * struct zynqmp_disp - Display controller
>    * @dev: Device structure
>    * @dpsub: Display subsystem
> - * @blend.base: Register I/O base address for the blender
> - * @avbuf.base: Register I/O base address for the audio/video buffer manager
> - * @audio.base: Registers I/O base address for the audio mixer
> + * @blend: Register I/O base address for the blender
> + * @avbuf: Register I/O base address for the audio/video buffer manager
> + * @audio: Registers I/O base address for the audio mixer
>    * @layers: Layers (planes)
>    */
>   struct zynqmp_disp {
>   	struct device *dev;
>   	struct zynqmp_dpsub *dpsub;
>   
> -	struct {
> -		void __iomem *base;
> -	} blend;
> -	struct {
> -		void __iomem *base;
> -	} avbuf;
> -	struct {
> -		void __iomem *base;
> -	} audio;
> +	void __iomem *blend;
> +	void __iomem *avbuf;
> +	void __iomem *audio;
>   
>   	struct zynqmp_disp_layer layers[ZYNQMP_DPSUB_NUM_LAYERS];
>   };
> @@ -356,12 +350,12 @@ static const struct zynqmp_disp_format avbuf_gfx_fmts[] = {
>   
>   static u32 zynqmp_disp_avbuf_read(struct zynqmp_disp *disp, int reg)
>   {
> -	return readl(disp->avbuf.base + reg);
> +	return readl(disp->avbuf + reg);
>   }
>   
>   static void zynqmp_disp_avbuf_write(struct zynqmp_disp *disp, int reg, u32 val)
>   {
> -	writel(val, disp->avbuf.base + reg);
> +	writel(val, disp->avbuf + reg);
>   }
>   
>   static bool zynqmp_disp_layer_is_video(const struct zynqmp_disp_layer *layer)
> @@ -587,7 +581,7 @@ static void zynqmp_disp_avbuf_disable(struct zynqmp_disp *disp)
>   
>   static void zynqmp_disp_blend_write(struct zynqmp_disp *disp, int reg, u32 val)
>   {
> -	writel(val, disp->blend.base + reg);
> +	writel(val, disp->blend + reg);
>   }
>   
>   /*
> @@ -813,7 +807,7 @@ static void zynqmp_disp_blend_layer_disable(struct zynqmp_disp *disp,
>   
>   static void zynqmp_disp_audio_write(struct zynqmp_disp *disp, int reg, u32 val)
>   {
> -	writel(val, disp->audio.base + reg);
> +	writel(val, disp->audio + reg);
>   }
>   
>   /**
> @@ -1237,21 +1231,21 @@ int zynqmp_disp_probe(struct zynqmp_dpsub *dpsub)
>   	disp->dev = &pdev->dev;
>   	disp->dpsub = dpsub;
>   
> -	disp->blend.base = devm_platform_ioremap_resource_byname(pdev, "blend");
> -	if (IS_ERR(disp->blend.base)) {
> -		ret = PTR_ERR(disp->blend.base);
> +	disp->blend = devm_platform_ioremap_resource_byname(pdev, "blend");
> +	if (IS_ERR(disp->blend)) {
> +		ret = PTR_ERR(disp->blend);
>   		goto error;
>   	}
>   
> -	disp->avbuf.base = devm_platform_ioremap_resource_byname(pdev, "av_buf");
> -	if (IS_ERR(disp->avbuf.base)) {
> -		ret = PTR_ERR(disp->avbuf.base);
> +	disp->avbuf = devm_platform_ioremap_resource_byname(pdev, "av_buf");
> +	if (IS_ERR(disp->avbuf)) {
> +		ret = PTR_ERR(disp->avbuf);
>   		goto error;
>   	}
>   
> -	disp->audio.base = devm_platform_ioremap_resource_byname(pdev, "aud");
> -	if (IS_ERR(disp->audio.base)) {
> -		ret = PTR_ERR(disp->audio.base);
> +	disp->audio = devm_platform_ioremap_resource_byname(pdev, "aud");
> +	if (IS_ERR(disp->audio)) {
> +		ret = PTR_ERR(disp->audio);
>   		goto error;
>   	}
>   


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ