Re: [PATCH 14/29] media: Avoid comma separated statements

From: Kieran Bingham
Date: Fri Sep 04 2020 - 07:45:49 EST


On 25/08/2020 05:56, Joe Perches wrote:
> Use semicolons and braces.
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> ---
> drivers/media/i2c/msp3400-kthreads.c | 12 ++++++++----
> drivers/media/pci/bt8xx/bttv-cards.c | 6 ++++--
> drivers/media/pci/saa7134/saa7134-video.c | 7 +++++--
> 3 files changed, 17 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/i2c/msp3400-kthreads.c b/drivers/media/i2c/msp3400-kthreads.c
> index d3b0d1c18efd..ac8752c63266 100644
> --- a/drivers/media/i2c/msp3400-kthreads.c
> +++ b/drivers/media/i2c/msp3400-kthreads.c
> @@ -549,8 +549,10 @@ int msp3400c_thread(void *data)
> val = msp_read_dsp(client, 0x1b);
> if (val > 32767)
> val -= 65536;
> - if (val1 < val)
> - val1 = val, max1 = i;
> + if (val1 < val) {
> + val1 = val;
> + max1 = i;
> + }
> dev_dbg_lvl(&client->dev, 1, msp_debug,
> "carrier1 val: %5d / %s\n", val, cd[i].name);
> }
> @@ -586,8 +588,10 @@ int msp3400c_thread(void *data)
> val = msp_read_dsp(client, 0x1b);
> if (val > 32767)
> val -= 65536;
> - if (val2 < val)
> - val2 = val, max2 = i;
> + if (val2 < val) {
> + val2 = val;
> + max2 = i;
> + }
> dev_dbg_lvl(&client->dev, 1, msp_debug,
> "carrier2 val: %5d / %s\n", val, cd[i].name);
> }
> diff --git a/drivers/media/pci/bt8xx/bttv-cards.c b/drivers/media/pci/bt8xx/bttv-cards.c
> index 16148802dabb..ca20b806e82d 100644
> --- a/drivers/media/pci/bt8xx/bttv-cards.c
> +++ b/drivers/media/pci/bt8xx/bttv-cards.c
> @@ -3934,8 +3934,10 @@ static void osprey_eeprom(struct bttv *btv, const u8 ee[256])
> if (checksum != ee[21])
> return;
> cardid = BTTV_BOARD_OSPREY1x0_848;
> - for (i = 12; i < 21; i++)
> - serial *= 10, serial += ee[i] - '0';
> + for (i = 12; i < 21; i++) {
> + serial *= 10;
> + serial += ee[i] - '0';
> + }
> }
> } else {
> unsigned short type;
> diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c
> index a8ac94fadc14..f673cda57f30 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;

Don't we have any swap macro helpers for this?

Anyway, that would be out of scope of this patch series.

Reviewed-by: Kieran Bingham <kieran.bingham+renesas@xxxxxxxxxxxxxxxx>

> + }
> 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)) {
>