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]
Message-ID: <0fc4db47-4b05-473f-966e-962a2c671dcf@kadam.mountain>
Date:   Tue, 24 Oct 2023 07:12:14 +0300
From:   Dan Carpenter <dan.carpenter@...aro.org>
To:     Joe Perches <joe@...ches.com>
Cc:     Jonathan Bergh <bergh.jonathan@...il.com>, mchehab@...nel.org,
        gregkh@...uxfoundation.org, error27@...il.com,
        linux-staging@...ts.linux.dev, linux-media@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/5] staging: media: av7110: Fix various whitespace
 checkpatch errors

On Mon, Oct 23, 2023 at 08:24:58AM -0700, Joe Perches wrote:
> 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)
> 

To me it depends on if the 0x0f means something.  It would be better as
a define instead of a magic number.

regards,
dan carpenter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ