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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <D76FE1CB-1EF9-4F38-8D73-F3E0D7942A6C@collabora.com>
Date: Mon, 3 Jun 2024 11:57:15 -0300
From: Daniel Almeida <daniel.almeida@...labora.com>
To: Jianhua Lin <jianhua.lin@...iatek.com>
Cc: Mauro Carvalho Chehab <mchehab@...nel.org>,
 matthias.bgg@...il.com,
 AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
 Linux Media Mailing List <linux-media@...r.kernel.org>,
 linux-kernel@...r.kernel.org,
 linux-arm-kernel@...ts.infradead.org,
 linux-mediatek@...ts.infradead.org,
 Project_Global_Chrome_Upstream_Group@...iatek.com
Subject: Re: [PATCH] media: mediatek: jpeg: support 34bits

Hi Jianhua,


> + ret = of_property_read_u32(pdev->dev.of_node, "mediatek,34bits",
> + &jpeg->support_34bit);
> + if (ret != 0) {
> + dev_info(&pdev->dev, "default for 32bits");
> + jpeg->support_34bit = 0;
> + }
> + dev_info(&pdev->dev, "use 34bits: %d", jpeg->support_34bit);
> +

Please use of_property_read_bool instead.


> enc_get_file_size(void __iomem *base, u32 support_34bit)
> {
> - return readl(base + JPEG_ENC_DMA_ADDR0) -
> + u32 value = 1;
> +
> + if (support_34bit)
> + value = 4;
> +
> + return readl(base + JPEG_ENC_DMA_ADDR0) * value -
>       readl(base + JPEG_ENC_DST_ADDR0);
> }

Please use the ternary operator instead, there’s no need for two assignments.

Can you please add a comment inline to explain why this multiplier is needed?


> EXPORT_SYMBOL_GPL(mtk_jpeg_enc_get_file_size);
> @@ -75,6 +80,9 @@ void mtk_jpeg_enc_start(void __iomem *base)
> 
> value = readl(base + JPEG_ENC_CTRL);
> value |= JPEG_ENC_CTRL_INT_EN_BIT | JPEG_ENC_CTRL_ENABLE_BIT;
> + value |= JPEG_ENC_CTRL_RDMA_PADDING_EN;
> + value |= JPEG_ENC_CTRL_RDMA_RIGHT_PADDING_EN;
> + value &= ~JPEG_ENC_CTRL_RDMA_PADDING_0_EN;
> writel(value, base + JPEG_ENC_CTRL);
> }

These do not have to be gated by “support_34bit” ?

— Daniel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ