From: Hans Verkuil <hverkuil+cisco@kernel.org>
To: Nikhil S <nikhilsunilkumar@gmail.com>, mchehab@kernel.org
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] media: dvbringbuffer : fix space issues
Date: Mon, 3 Nov 2025 09:25:33 +0100 [thread overview]
Message-ID: <dd0aa0bd-17ec-42a5-9ddb-ed564993aa9b@kernel.org> (raw)
In-Reply-To: <20250925181032.7862-1-nikhilsunilkumar@gmail.com>
On 25/09/2025 20:10, Nikhil S wrote:
> Fix the space issues detected by the checkpatch tool
>
> Changes in v2:
> - Split multiple assignments into separate lines
This patch is a duplicate of:
https://lore.kernel.org/linux-media/20250718130807.87691-1-darshanrathod475@gmail.com/
which has already been merged. So I'm dropping this one.
Regards,
Hans
>
> Signed-off-by: Nikhil S <nikhilsunilkumar@gmail.com>
> ---
> drivers/media/dvb-core/dvb_ringbuffer.c | 34 +++++++++++++++----------
> 1 file changed, 20 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/media/dvb-core/dvb_ringbuffer.c b/drivers/media/dvb-core/dvb_ringbuffer.c
> index 7d4558de8..99c2d700c 100644
> --- a/drivers/media/dvb-core/dvb_ringbuffer.c
> +++ b/drivers/media/dvb-core/dvb_ringbuffer.c
> @@ -37,10 +37,11 @@
>
> void dvb_ringbuffer_init(struct dvb_ringbuffer *rbuf, void *data, size_t len)
> {
> - rbuf->pread=rbuf->pwrite=0;
> - rbuf->data=data;
> - rbuf->size=len;
> - rbuf->error=0;
> + rbuf->pread = 0;
> + rbuf->pwrite = 0;
> + rbuf->data = data;
> + rbuf->size = len;
> + rbuf->error = 0;
>
> init_waitqueue_head(&rbuf->queue);
>
> @@ -235,7 +236,7 @@ ssize_t dvb_ringbuffer_write_user(struct dvb_ringbuffer *rbuf,
> return len;
> }
>
> -ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t len)
> +ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8 *buf, size_t len)
> {
> int status;
> ssize_t oldpwrite = rbuf->pwrite;
> @@ -245,7 +246,8 @@ ssize_t dvb_ringbuffer_pkt_write(struct dvb_ringbuffer *rbuf, u8* buf, size_t le
> DVB_RINGBUFFER_WRITE_BYTE(rbuf, PKT_READY);
> status = dvb_ringbuffer_write(rbuf, buf, len);
>
> - if (status < 0) rbuf->pwrite = oldpwrite;
> + if (status < 0)
> + rbuf->pwrite = oldpwrite;
> return status;
> }
>
> @@ -258,8 +260,10 @@ ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf, size_t idx,
>
> pktlen = rbuf->data[idx] << 8;
> pktlen |= rbuf->data[(idx + 1) % rbuf->size];
> - if (offset > pktlen) return -EINVAL;
> - if ((offset + len) > pktlen) len = pktlen - offset;
> + if (offset > pktlen)
> + return -EINVAL;
> + if ((offset + len) > pktlen)
> + len = pktlen - offset;
>
> idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size;
> todo = len;
> @@ -278,7 +282,7 @@ ssize_t dvb_ringbuffer_pkt_read_user(struct dvb_ringbuffer *rbuf, size_t idx,
> }
>
> ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
> - int offset, u8* buf, size_t len)
> + int offset, u8 *buf, size_t len)
> {
> size_t todo;
> size_t split;
> @@ -286,8 +290,10 @@ ssize_t dvb_ringbuffer_pkt_read(struct dvb_ringbuffer *rbuf, size_t idx,
>
> pktlen = rbuf->data[idx] << 8;
> pktlen |= rbuf->data[(idx + 1) % rbuf->size];
> - if (offset > pktlen) return -EINVAL;
> - if ((offset + len) > pktlen) len = pktlen - offset;
> + if (offset > pktlen)
> + return -EINVAL;
> + if ((offset + len) > pktlen)
> + len = pktlen - offset;
>
> idx = (idx + DVB_RINGBUFFER_PKTHDRSIZE + offset) % rbuf->size;
> todo = len;
> @@ -309,7 +315,7 @@ void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx)
> rbuf->data[(idx + 2) % rbuf->size] = PKT_DISPOSED;
>
> // clean up disposed packets
> - while(dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) {
> + while (dvb_ringbuffer_avail(rbuf) > DVB_RINGBUFFER_PKTHDRSIZE) {
> if (DVB_RINGBUFFER_PEEK(rbuf, 2) == PKT_DISPOSED) {
> pktlen = DVB_RINGBUFFER_PEEK(rbuf, 0) << 8;
> pktlen |= DVB_RINGBUFFER_PEEK(rbuf, 1);
> @@ -321,7 +327,7 @@ void dvb_ringbuffer_pkt_dispose(struct dvb_ringbuffer *rbuf, size_t idx)
> }
> }
>
> -ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t* pktlen)
> +ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t *pktlen)
> {
> int consumed;
> int curpktlen;
> @@ -339,7 +345,7 @@ ssize_t dvb_ringbuffer_pkt_next(struct dvb_ringbuffer *rbuf, size_t idx, size_t*
> if (consumed < 0)
> consumed += rbuf->size;
>
> - while((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
> + while ((dvb_ringbuffer_avail(rbuf) - consumed) > DVB_RINGBUFFER_PKTHDRSIZE) {
>
> curpktlen = rbuf->data[idx] << 8;
> curpktlen |= rbuf->data[(idx + 1) % rbuf->size];
prev parent reply other threads:[~2025-11-03 8:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-25 18:10 Nikhil S
2025-11-03 8:25 ` Hans Verkuil [this message]
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=dd0aa0bd-17ec-42a5-9ddb-ed564993aa9b@kernel.org \
--to=hverkuil+cisco@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=nikhilsunilkumar@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 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®