From: Dan Carpenter <dan.carpenter@linaro.org>
To: Joe Perches <joe@perches.com>
Cc: Jonathan Bergh <bergh.jonathan@gmail.com>,
mchehab@kernel.org, gregkh@linuxfoundation.org,
error27@gmail.com, linux-staging@lists.linux.dev,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/5] staging: media: av7110: Fix various whitespace checkpatch errors
Date: Tue, 24 Oct 2023 07:12:14 +0300 [thread overview]
Message-ID: <0fc4db47-4b05-473f-966e-962a2c671dcf@kadam.mountain> (raw)
In-Reply-To: <15f45bbde3f4289b012db7adb8166cf0d45e4fec.camel@perches.com>
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
next prev parent reply other threads:[~2023-10-24 4:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-20 23:23 [PATCH 0/5] staging: media: av7110: Fix various formatting and small code issues Jonathan Bergh
2023-10-20 23:23 ` [PATCH 1/5] staging: media: av7110: Fix missing newlines after declaration warnings Jonathan Bergh
2023-10-20 23:23 ` [PATCH 2/5] staging: media: av7110: Fix various whitespace checkpatch errors Jonathan Bergh
2023-10-23 14:26 ` Dan Carpenter
2023-10-23 15:24 ` Joe Perches
2023-10-24 4:12 ` Dan Carpenter [this message]
2023-10-20 23:23 ` [PATCH 3/5] staging: media: av7110: Remove unnecessary whitespace before quoted newlines Jonathan Bergh
2023-10-23 14:27 ` Dan Carpenter
2023-10-20 23:23 ` [PATCH 4/5] staging: media: av7110: Fix 'long int' and 'unsigned' variable declarations Jonathan Bergh
2023-10-20 23:23 ` [PATCH 5/5] staging: media: av7110: Fix various formating issues Jonathan Bergh
2023-10-23 14:32 ` Dan Carpenter
2023-11-22 10:57 ` [PATCH 0/5] staging: media: av7110: Fix various formatting and small code issues Hans Verkuil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0fc4db47-4b05-473f-966e-962a2c671dcf@kadam.mountain \
--to=dan.carpenter@linaro.org \
--cc=bergh.jonathan@gmail.com \
--cc=error27@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=mchehab@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®