diff options
author | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-09-20 09:17:45 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-10-01 09:20:56 +0200 |
commit | fc4405a5f1077ded3194a38b3af9b2c6b9c69437 (patch) | |
tree | 2a88cd25c2f980aad23559931c1a898ecb41228f /drivers/media | |
parent | 56ce9eff9492e85297403ee825078463fabe8cf7 (diff) |
media: vidtv: cleanup PSI version numbers
There's no reason to use static vars to store PSI version
numbers.
Also, currently, version numbers are starting with 0x01,
because there's a code being called that increases it to
1 for all table initializer code, as the code may support
dynamic changes at the PS tables on some future.
So, let's just initialize them to 0x1f, in order for the
versions to be reported as starting from 0.
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.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/test-drivers/vidtv/vidtv_psi.c b/drivers/media/test-drivers/vidtv/vidtv_psi.c index 5fe3fbb765b8..82cf67dd27c0 100644 --- a/drivers/media/test-drivers/vidtv/vidtv_psi.c +++ b/drivers/media/test-drivers/vidtv/vidtv_psi.c @@ -756,7 +756,6 @@ vidtv_psi_pat_program_assign(struct vidtv_psi_table_pat *pat, struct vidtv_psi_table_pat *vidtv_psi_pat_table_init(u16 transport_stream_id) { struct vidtv_psi_table_pat *pat = kzalloc(sizeof(*pat), GFP_KERNEL); - static u8 pat_version; const u16 SYNTAX = 0x1; const u16 ZERO = 0x0; const u16 ONES = 0x03; @@ -767,7 +766,7 @@ struct vidtv_psi_table_pat *vidtv_psi_pat_table_init(u16 transport_stream_id) pat->header.id = cpu_to_be16(transport_stream_id); pat->header.current_next = 0x1; - pat->header.version = pat_version; + pat->header.version = 0x1f; pat->header.one2 = 0x03; pat->header.section_id = 0x0; @@ -935,7 +934,6 @@ struct vidtv_psi_table_pmt *vidtv_psi_pmt_table_init(u16 program_number, u16 pcr_pid) { struct vidtv_psi_table_pmt *pmt = kzalloc(sizeof(*pmt), GFP_KERNEL); - static u8 pmt_version; const u16 SYNTAX = 0x1; const u16 ZERO = 0x0; const u16 ONES = 0x03; @@ -953,7 +951,7 @@ struct vidtv_psi_table_pmt *vidtv_psi_pmt_table_init(u16 program_number, pmt->header.id = cpu_to_be16(program_number); pmt->header.current_next = 0x1; - pmt->header.version = pmt_version; + pmt->header.version = 0x1f; pmt->header.one2 = ONES; pmt->header.section_id = 0; @@ -1083,7 +1081,6 @@ void vidtv_psi_pmt_table_destroy(struct vidtv_psi_table_pmt *pmt) struct vidtv_psi_table_sdt *vidtv_psi_sdt_table_init(u16 transport_stream_id) { struct vidtv_psi_table_sdt *sdt = kzalloc(sizeof(*sdt), GFP_KERNEL); - static u8 sdt_version; const u16 SYNTAX = 0x1; const u16 ONE = 0x1; const u16 ONES = 0x03; @@ -1101,7 +1098,7 @@ struct vidtv_psi_table_sdt *vidtv_psi_sdt_table_init(u16 transport_stream_id) sdt->header.id = cpu_to_be16(transport_stream_id); sdt->header.current_next = ONE; - sdt->header.version = sdt_version; + sdt->header.version = 0x1f; sdt->header.one2 = ONES; sdt->header.section_id = 0; |