From: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
To: mchehab+huawei@kernel.org, r.verdejo@samsung.com, nicolas@ndufresne.ca
Cc: "Daniel W . S . Almeida" <dwlsalmeida@gmail.com>,
linux-media@vger.kernel.org, skhan@linuxfoundation.org,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v2 6/6] media: vidtv: psi: fix missing assignments in while loops
Date: Sat, 31 Oct 2020 12:05:52 -0300 [thread overview]
Message-ID: <20201031150552.663598-7-dwlsalmeida@gmail.com> (raw)
In-Reply-To: <20201031150552.663598-1-dwlsalmeida@gmail.com>
From: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
Some variables were only assigned once but were used in while
loops as if they had been updated at every iteration. Fix this.
Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
---
drivers/media/test-drivers/vidtv/vidtv_psi.c | 22 +++++++++-----------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c
index ad2957efa483..4dda5b0004a3 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_psi.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c
@@ -1175,9 +1175,7 @@ u32 vidtv_psi_pmt_write_into(struct vidtv_psi_pmt_write_args args)
struct vidtv_psi_desc *table_descriptor = args.pmt->descriptor;
struct vidtv_psi_table_pmt_stream *stream = args.pmt->stream;
- struct vidtv_psi_desc *stream_descriptor = (stream) ?
- args.pmt->stream->descriptor :
- NULL;
+ struct vidtv_psi_desc *stream_descriptor;
struct header_write_args h_args = {};
struct psi_write_args psi_args = {};
@@ -1237,6 +1235,8 @@ u32 vidtv_psi_pmt_write_into(struct vidtv_psi_pmt_write_args args)
nbytes += vidtv_psi_ts_psi_write_into(psi_args);
+ stream_descriptor = stream->descriptor;
+
while (stream_descriptor) {
/* write the stream descriptors, if any */
d_args.dest_buf = args.buf;
@@ -1324,9 +1324,7 @@ u32 vidtv_psi_sdt_write_into(struct vidtv_psi_sdt_write_args args)
u32 crc = INITIAL_CRC;
struct vidtv_psi_table_sdt_service *service = args.sdt->service;
- struct vidtv_psi_desc *service_desc = (args.sdt->service) ?
- args.sdt->service->descriptor :
- NULL;
+ struct vidtv_psi_desc *service_desc;
struct header_write_args h_args = {};
struct psi_write_args psi_args = {};
@@ -1373,6 +1371,8 @@ u32 vidtv_psi_sdt_write_into(struct vidtv_psi_sdt_write_args args)
nbytes += vidtv_psi_ts_psi_write_into(psi_args);
+ service_desc = service->descriptor;
+
while (service_desc) {
/* copy the service descriptors, if any */
d_args.dest_buf = args.buf;
@@ -1616,9 +1616,7 @@ u32 vidtv_psi_nit_write_into(struct vidtv_psi_nit_write_args args)
struct vidtv_psi_desc *table_descriptor = args.nit->descriptor;
struct vidtv_psi_table_transport *transport = args.nit->transport;
- struct vidtv_psi_desc *transport_descriptor = (transport) ?
- args.nit->transport->descriptor :
- NULL;
+ struct vidtv_psi_desc *transport_descriptor;
struct header_write_args h_args = {};
struct psi_write_args psi_args = {};
@@ -1686,6 +1684,8 @@ u32 vidtv_psi_nit_write_into(struct vidtv_psi_nit_write_args args)
nbytes += vidtv_psi_ts_psi_write_into(psi_args);
+ transport_descriptor = transport->descriptor;
+
while (transport_descriptor) {
/* write the transport descriptors, if any */
d_args.dest_buf = args.buf;
@@ -1823,9 +1823,7 @@ u32 vidtv_psi_eit_write_into(struct vidtv_psi_eit_write_args args)
u32 crc = INITIAL_CRC;
struct vidtv_psi_table_eit_event *event = args.eit->event;
- struct vidtv_psi_desc *event_descriptor = (args.eit->event) ?
- args.eit->event->descriptor :
- NULL;
+ struct vidtv_psi_desc *event_descriptor;
struct header_write_args h_args = {};
struct psi_write_args psi_args = {};
--
2.29.2
prev parent reply other threads:[~2020-10-31 15:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-31 15:05 [PATCH v2 0/6] media: vidtv: Add support for more MPEG PSI tables Daniel W. S. Almeida
2020-10-31 15:05 ` [PATCH v2 1/6] media: vidtv: extract the initial CRC value to into a #define Daniel W. S. Almeida
2020-10-31 15:05 ` [PATCH v2 2/6] media: vidtv: psi: add a Network Information Table (NIT) Daniel W. S. Almeida
2020-10-31 15:05 ` [PATCH v2 3/6] media: vidtv: psi: Implement an Event Information Table (EIT) Daniel W. S. Almeida
2020-10-31 15:05 ` [PATCH v2 4/6] media: vidtv: psi: extract descriptor chaining code into a helper Daniel W. S. Almeida
2020-10-31 15:05 ` [PATCH v2 5/6] media: vidtv: Move s302m specific fields into encoder context Daniel W. S. Almeida
2020-10-31 15:05 ` Daniel W. S. Almeida [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=20201031150552.663598-7-dwlsalmeida@gmail.com \
--to=dwlsalmeida@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=r.verdejo@samsung.com \
--cc=skhan@linuxfoundation.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®