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]
Date:   Tue, 29 Sep 2020 17:57:04 +0200
From:   Christophe JAILLET <christophe.jaillet@...adoo.fr>
To:     Julia Lawall <Julia.Lawall@...ia.fr>,
        Mauro Carvalho Chehab <mchehab@...nel.org>
Cc:     Valdis Klētnieks <valdis.kletnieks@...edu>,
        Joe Perches <joe@...ches.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        kernel-janitors@...r.kernel.org, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 04/20] media: saa7134: use semicolons rather than commas
 to separate statements

Le 29/09/2020 à 15:14, Julia Lawall a écrit :
> Replace commas with semicolons.  Commas introduce unnecessary
> variability in the code structure and are hard to see.  What is done
> is essentially described by the following Coccinelle semantic patch
> (http://coccinelle.lip6.fr/):
> 
> // <smpl>
> @@ expression e1,e2; @@
> e1
> -,
> +;
> e2
> ... when any
> // </smpl>
> 
> Signed-off-by: Julia Lawall <Julia.Lawall@...ia.fr>
> 
> ---
>   drivers/media/pci/saa7134/saa7134-video.c |    7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
> index 9a6a6b68f8e3..2ca963b04b3f 100644
> --- a/drivers/media/pci/saa7134/saa7134-video.c
> +++ b/drivers/media/pci/saa7134/saa7134-video.c
> @@ -868,8 +868,11 @@ static int buffer_activate(struct saa7134_dev *dev,
>   		lines_uv = dev->height >> dev->fmt->vshift;
>   		base2    = base + bpl * dev->height;
>   		base3    = base2 + bpl_uv * lines_uv;
> -		if (dev->fmt->uvswap)
> -			tmp = base2, base2 = base3, base3 = tmp;
> +		if (dev->fmt->uvswap) {
> +			tmp = base2;
> +			base2 = base3;
> +			base3 = tmp;
> +		}
>   		video_dbg("uv: bpl=%ld lines=%ld base2/3=%ld/%ld\n",
>   			bpl_uv,lines_uv,base2,base3);
>   		if (V4L2_FIELD_HAS_BOTH(dev->field)) {
> 
> 
Hi,
this could be turned into a simpler:
    swap(base2, base3);

CJ

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ