All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Punnay Sharma <punnaysharma805@gmail.com>
Cc: gregkh@linuxfoundation.org, mchehab@kernel.org,
	linux-media@vger.kernel.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/2] staging: media: av7110: fix corrupted BER reporting in sp8870
Date: Fri, 7 Aug 2026 21:46:35 +0300	[thread overview]
Message-ID: <anYoC44F6SrKW5iC@stanley.mountain> (raw)
In-Reply-To: <20260807183443.13912-1-punnaysharma805@gmail.com>

On Sat, Aug 08, 2026 at 12:04:42AM +0530, Punnay Sharma wrote:
> In sp8870_read_ber(), the 14-bit Bit Error Rate (BER) is assembled by
> reading two I2C registers: 0xC08 (lower 6 bits) and 0xC07 (upper 8 bits).
> 
> The current implementation masks the lower bits via `tmp = ret & 0x3F;`
> but subsequently overwrites `tmp` entirely when processing the upper
> bits using a direct assignment (`tmp = ret << 6;`). This logical error
> causes the lower 6 bits of the BER hardware metric to be silently
> discarded.
> 
> Fix this by using a bitwise OR (`tmp |= ret << 6;`) to correctly merge
> the MSB and LSB payloads before returning the metric to the DVB core.

AI uses a lot of really unnecessary words to say something very simple.
It explains the obvious stuff in detail and ignores the important bits.
It should be something like:

  Checker tools complain that the "tmp = ret & 0x3F;" assignment is
  never used.  It's probably supposed to be ORed.  I don't have the
  hardware so this is untested.

> 
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")

The fact that no one has complained in 21 years, probably means it's
not a real bug.  I generally ignore these ancient things.

> Signed-off-by: Punnay Sharma <punnaysharma805@gmail.com>
> ---

There are a bunch of rules for sending a v2 patch.
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Don't resend the same day.  Add a note to say what changed etc.

regards,
dan carpenter


  parent reply	other threads:[~2026-08-07 18:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-07 18:34 [PATCH v2 1/2] staging: media: av7110: fix corrupted BER reporting in sp8870 Punnay Sharma
2026-08-07 18:34 ` [PATCH v2 2/2] staging: media: av7110: fix sp8870 initialization failure state Punnay Sharma
2026-08-07 18:46 ` Dan Carpenter [this message]
2026-08-08  5:45 ` [PATCH v2 1/2] staging: media: av7110: fix corrupted BER reporting in sp8870 Greg KH

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=anYoC44F6SrKW5iC@stanley.mountain \
    --to=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=mchehab@kernel.org \
    --cc=punnaysharma805@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.