summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorDaniel W. S. Almeida <dwlsalmeida@gmail.com>2020-10-31 18:05:47 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-11-26 09:35:49 +0300
commitdd6dbe8d7e312238cc0ad0b907042a96b0505d44 (patch)
tree2cc5d50bbe9675a972da272d3b6e04e378da2d92 /drivers/media
parent9215f6bb4705ffe205885411394732bfc439dee0 (diff)
downloadlinux-dd6dbe8d7e312238cc0ad0b907042a96b0505d44.tar.xz
media: vidtv: extract the initial CRC value to into a #define
The same constant (0xffffffff) is used in three different functions. Extract it into a #define to avoid repetition. Signed-off-by: Daniel W. S. Almeida <dwlsalmeida@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/test-drivers/vidtv/vidtv_psi.c7
1 files 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 82cf67dd27c0..f2e25e68c085 100644
--- a/drivers/media/test-drivers/vidtv/vidtv_psi.c
+++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c
@@ -31,6 +31,7 @@
#define CRC_SIZE_IN_BYTES 4
#define MAX_VERSION_NUM 32
+#define INITIAL_CRC 0xffffffff
static const u32 CRC_LUT[256] = {
/* from libdvbv5 */
@@ -784,7 +785,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;
@@ -974,7 +975,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;
@@ -1124,7 +1125,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) ?