|
|
Log in / Subscribe / Register

staging: media: av7110: Fix various whitespace checkpatch errors

From:  Joe Perches <joe-AT-perches.com>
To:  Dan Carpenter <dan.carpenter-AT-linaro.org>, Jonathan Bergh <bergh.jonathan-AT-gmail.com>
Subject:  Re: [PATCH 2/5] staging: media: av7110: Fix various whitespace checkpatch errors
Date:  Mon, 23 Oct 2023 08:24:58 -0700
Message-ID:  <15f45bbde3f4289b012db7adb8166cf0d45e4fec.camel@perches.com>
Cc:  mchehab-AT-kernel.org, gregkh-AT-linuxfoundation.org, error27-AT-gmail.com, linux-staging-AT-lists.linux.dev, linux-media-AT-vger.kernel.org, linux-kernel-AT-vger.kernel.org
Archive-link:  Article

On Mon, 2023-10-23 at 17:26 +0300, Dan Carpenter wrote:
> On Sat, Oct 21, 2023 at 01:23:29AM +0200, Jonathan Bergh wrote:
[]
> > diff --git a/drivers/staging/media/av7110/av7110_av.c b/drivers/staging/media/av7110/av7110_av.c
[]
> > @@ -241,8 +241,8 @@ int av7110_pes_play(void *dest, struct dvb_ringbuffer *buf, int dlen)
> >  		sync |= DVB_RINGBUFFER_PEEK(buf, 2) << 8;
> >  		sync |= DVB_RINGBUFFER_PEEK(buf, 3);
> >  
> > -		if (((sync &~ 0x0f) == 0x000001e0) ||
> > -		    ((sync &~ 0x1f) == 0x000001c0) ||
> > +		if (((sync &~0x0f) == 0x000001e0) ||
> > +		    ((sync &~0x1f) == 0x000001c0) ||
> 
> These should be:
> 
> 	if (((sync & ~0x0f) == 0x000001e0) ||
> 	    ((sync & ~0x1f) == 0x000001c0) ||

Generally, I believe it would be better to avoid '& ~constant'
and use the positive form instead

	if ((sync & 0xfffffff0) == 0x000001e0) ||
	    (sync & 0xffffffe0) == 0x000001c0)




Copyright © 2023, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds