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] [day] [month] [year] [list]
Message-ID: <7a3e11b0-272c-bef0-2256-ddd54797bfbf@xs4all.nl>
Date:   Wed, 26 May 2021 15:15:34 +0200
From:   Hans Verkuil <hverkuil@...all.nl>
To:     Piyush Thange <pthange19@...il.com>, mchehab@...nel.org,
        leon@...nel.org
Cc:     linux-media@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/4] media: usb: cpia2: Fixed coding style issues

On 30/04/2021 17:43, Piyush Thange wrote:
> Addition of more fixes on coding style.
> 
> Signed-off-by: Piyush Thange <pthange19@...il.com>
> ---
>  drivers/media/usb/cpia2/cpia2_v4l.c | 18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/media/usb/cpia2/cpia2_v4l.c b/drivers/media/usb/cpia2/cpia2_v4l.c
> index 261ced144793..d950f9171208 100644
> --- a/drivers/media/usb/cpia2/cpia2_v4l.c
> +++ b/drivers/media/usb/cpia2/cpia2_v4l.c
> @@ -883,12 +883,12 @@ static int cpia2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
>  
>  	frame = find_earliest_filled_buffer(cam);
>  
> -	if(frame < 0 && file->f_flags&O_NONBLOCK)
> +	if (frame < 0 && file->f_flags&O_NONBLOCK)

Add spaces around & as well.

There is no need to split this up into four patches. Just post a single patch
for all these changes.

>  		return -EAGAIN;
>  
> -	if(frame < 0) {
> +	if (frame < 0) {
>  		/* Wait for a frame to become available */
> -		struct framebuf *cb=cam->curbuff;
> +		struct framebuf *cb = cam->curbuff;
>  		mutex_unlock(&cam->v4l2_lock);
>  		wait_event_interruptible(cam->wq_stream,
>  					 !video_is_registered(&cam->vdev) ||
> @@ -970,7 +970,7 @@ static int cpia2_mmap(struct file *file, struct vm_area_struct *area)
>  		return -ERESTARTSYS;
>  	retval = cpia2_remap_buffer(cam, area);
>  
> -	if(!retval)
> +	if (!retval)
>  		cam->stream_fh = file->private_data;
>  	mutex_unlock(&cam->v4l2_lock);
>  	return retval;
> @@ -1160,10 +1160,10 @@ void cpia2_unregister_camera(struct camera_data *cam)
>   *****************************************************************************/
>  static void __init check_parameters(void)
>  {
> -	if(buffer_size < PAGE_SIZE) {
> +	if (buffer_size < PAGE_SIZE) {
>  		buffer_size = PAGE_SIZE;
>  		LOG("buffer_size too small, setting to %d\n", buffer_size);
> -	} else if(buffer_size > 1024*1024) {
> +	} else if (buffer_size > 1024*1024) {

Add spaces around * as well. checkpatch.pl --strict warns about that!

Regards,

	Hans

>  		/* arbitrary upper limiit */
>  		buffer_size = 1024*1024;
>  		LOG("buffer_size ridiculously large, setting to %d\n",
> @@ -1173,15 +1173,15 @@ static void __init check_parameters(void)
>  		buffer_size &= ~(PAGE_SIZE-1);
>  	}
>  
> -	if(num_buffers < 1) {
> +	if (num_buffers < 1) {
>  		num_buffers = 1;
>  		LOG("num_buffers too small, setting to %d\n", num_buffers);
> -	} else if(num_buffers > VIDEO_MAX_FRAME) {
> +	} else if (num_buffers > VIDEO_MAX_FRAME) {
>  		num_buffers = VIDEO_MAX_FRAME;
>  		LOG("num_buffers too large, setting to %d\n", num_buffers);
>  	}
>  
> -	if(alternate < USBIF_ISO_1 || alternate > USBIF_ISO_6) {
> +	if (alternate < USBIF_ISO_1 || alternate > USBIF_ISO_6) {
>  		alternate = DEFAULT_ALT;
>  		LOG("alternate specified is invalid, using %d\n", alternate);
>  	}
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ