diff mbox series

[v5,05/13] media: atmel: atmel-sama5d2-isc: fix wrong mask in YUYV format check

Message ID 20220217135645.1427466-6-eugen.hristev@microchip.com
State Superseded
Headers show
Series [v5,01/13] media: atmel: atmel-isc-base: use streaming status when queueing buffers | expand

Commit Message

Eugen Hristev Feb. 17, 2022, 1:56 p.m. UTC
While this does not happen in production, this check should be done
versus the mask, as checking with the YCYC value may not include
some bits that may be set.
Is it correct and safe to check the whole mask.

Fixes: 123aaf816b95 ("media: atmel: atmel-sama5d2-isc: fix YUYV format")
Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
---
 drivers/media/platform/atmel/atmel-sama5d2-isc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jacopo Mondi Feb. 23, 2022, 5:06 p.m. UTC | #1
Hi Eugen

On Thu, Feb 17, 2022 at 03:56:37PM +0200, Eugen Hristev wrote:
> While this does not happen in production, this check should be done
> versus the mask, as checking with the YCYC value may not include
> some bits that may be set.
> Is it correct and safe to check the whole mask.
>
> Fixes: 123aaf816b95 ("media: atmel: atmel-sama5d2-isc: fix YUYV format")
> Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>

I trust this
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j
> ---
>  drivers/media/platform/atmel/atmel-sama5d2-isc.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
> index c244682ea22f..025c3e8a7e95 100644
> --- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
> +++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
> @@ -291,7 +291,7 @@ static void isc_sama5d2_config_rlp(struct isc_device *isc)
>  	 * Thus, if the YCYC mode is selected, replace it with the
>  	 * sama5d2-compliant mode which is YYCC .
>  	 */
> -	if ((rlp_mode & ISC_RLP_CFG_MODE_YCYC) == ISC_RLP_CFG_MODE_YCYC) {
> +	if ((rlp_mode & ISC_RLP_CFG_MODE_MASK) == ISC_RLP_CFG_MODE_YCYC) {
>  		rlp_mode &= ~ISC_RLP_CFG_MODE_MASK;
>  		rlp_mode |= ISC_RLP_CFG_MODE_YYCC;
>  	}
> --
> 2.25.1
>
diff mbox series

Patch

diff --git a/drivers/media/platform/atmel/atmel-sama5d2-isc.c b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
index c244682ea22f..025c3e8a7e95 100644
--- a/drivers/media/platform/atmel/atmel-sama5d2-isc.c
+++ b/drivers/media/platform/atmel/atmel-sama5d2-isc.c
@@ -291,7 +291,7 @@  static void isc_sama5d2_config_rlp(struct isc_device *isc)
 	 * Thus, if the YCYC mode is selected, replace it with the
 	 * sama5d2-compliant mode which is YYCC .
 	 */
-	if ((rlp_mode & ISC_RLP_CFG_MODE_YCYC) == ISC_RLP_CFG_MODE_YCYC) {
+	if ((rlp_mode & ISC_RLP_CFG_MODE_MASK) == ISC_RLP_CFG_MODE_YCYC) {
 		rlp_mode &= ~ISC_RLP_CFG_MODE_MASK;
 		rlp_mode |= ISC_RLP_CFG_MODE_YYCC;
 	}