From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: "Daniel W. S. Almeida" <dwlsalmeida@gmail.com>
Cc: r.verdejo@samsung.com, linux-kernel@vger.kernel.org,
nicolas@ndufresne.ca,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-media@vger.kernel.org
Subject: Re: [Linux-kernel-mentees] [PATCH WIP 1/6] media: vidtv: extract the initial CRC value to into a #define
Date: Tue, 29 Sep 2020 07:19:18 +0200 [thread overview]
Message-ID: <20200929071918.15c018ac@coco.lan> (raw)
In-Reply-To: <20200929032625.1548909-1-dwlsalmeida@gmail.com>
Em Tue, 29 Sep 2020 00:26:20 -0300
"Daniel W. S. Almeida" <dwlsalmeida@gmail.com> escreveu:
> From: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
On a very quick look, patches seem good. Why did you mark them as WIP?
Next time, please add a patch 0, specially when you tag something as
WIP, or RFC.
>
> The same constant (0xffffffff) is used in three different functions.
This one at least seems to be ready for merging ;-)
Regards,
Mauro
>
> Extract it into a #define to avoid repetition.
>
> Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com>
> ---
> drivers/media/test-drivers/vidtv/vidtv_psi.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c
> index 3151b300a91b..a24e84adc8ce 100644
> --- a/drivers/media/test-drivers/vidtv/vidtv_psi.c
> +++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c
> @@ -30,6 +30,7 @@
>
> #define CRC_SIZE_IN_BYTES 4
> #define MAX_VERSION_NUM 32
> +#define INITIAL_CRC 0xffffffff
>
> static const u32 CRC_LUT[256] = {
> /* from libdvbv5 */
> @@ -794,7 +795,7 @@ u32 vidtv_psi_pat_write_into(struct vidtv_psi_pat_write_args args)
> /* the number of bytes written by this function */
> u32 nbytes = 0;
> const u16 pat_pid = VIDTV_PAT_PID;
> - u32 crc = 0xffffffff;
> + u32 crc = INITIAL_CRC;
>
> struct vidtv_psi_table_pat_program *p = args.pat->program;
>
> @@ -990,7 +991,7 @@ u32 vidtv_psi_pmt_write_into(struct vidtv_psi_pmt_write_args args)
> {
> /* the number of bytes written by this function */
> u32 nbytes = 0;
> - u32 crc = 0xffffffff;
> + u32 crc = INITIAL_CRC;
>
> struct vidtv_psi_desc *table_descriptor = args.pmt->descriptor;
> struct vidtv_psi_table_pmt_stream *stream = args.pmt->stream;
> @@ -1143,7 +1144,7 @@ u32 vidtv_psi_sdt_write_into(struct vidtv_psi_sdt_write_args args)
> u32 nbytes = 0;
> u16 sdt_pid = VIDTV_SDT_PID; /* see ETSI EN 300 468 v1.15.1 p. 11 */
>
> - u32 crc = 0xffffffff;
> + u32 crc = INITIAL_CRC;
>
> struct vidtv_psi_table_sdt_service *service = args.sdt->service;
> struct vidtv_psi_desc *service_desc = (args.sdt->service) ?
Thanks,
Mauro
_______________________________________________
Linux-kernel-mentees mailing list
Linux-kernel-mentees@lists.linuxfoundation.org
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2020-09-29 5:19 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-29 3:26 [Linux-kernel-mentees] [PATCH WIP 1/6] media: vidtv: extract the initial CRC value to into a #define Daniel W. S. Almeida
2020-09-29 3:26 ` [Linux-kernel-mentees] [PATCH WIP 2/6] media: vidtv: psi: add a Network Information Table (NIT) Daniel W. S. Almeida
2020-09-29 3:26 ` [Linux-kernel-mentees] [PATCH WIP 3/6] media: vidtv: psi: Implement an Event Information Table (EIT) Daniel W. S. Almeida
2020-09-29 3:26 ` [Linux-kernel-mentees] [PATCH WIP 4/6] media: vidtv: psi: extract descriptor chaining code into a helper Daniel W. S. Almeida
2020-09-29 3:26 ` [Linux-kernel-mentees] [PATCH WIP 5/6] media: vidtv: Move s302m specific fields into encoder context Daniel W. S. Almeida
2020-09-29 3:26 ` [Linux-kernel-mentees] [PATCH WIP 6/6] media: vidtv: psi: fix missing assignments in while loops Daniel W. S. Almeida
2020-09-29 5:19 ` Mauro Carvalho Chehab [this message]
2020-09-29 9:30 ` [Linux-kernel-mentees] [PATCH WIP 1/6] media: vidtv: extract the initial CRC value to into a #define Daniel W. S. Almeida
2020-09-29 14:51 ` Mauro Carvalho Chehab
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=20200929071918.15c018ac@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=dwlsalmeida@gmail.com \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=r.verdejo@samsung.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;
as well as URLs for NNTP newsgroup(s).