Commit 2e2fa2c5 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: vidtv: fix 32-bit warnings

There are several warnings produced when the driver is built
for 32-bit archs. Solve them.
Reported-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 9cfb4d36
...@@ -42,7 +42,7 @@ u32 vidtv_memcpy(void *to, ...@@ -42,7 +42,7 @@ u32 vidtv_memcpy(void *to,
size_t len) size_t len)
{ {
if (unlikely(to_offset + len > to_size)) { if (unlikely(to_offset + len > to_size)) {
pr_err_ratelimited("overflow detected, skipping. Try increasing the buffer size. Needed %lu, had %zu\n", pr_err_ratelimited("overflow detected, skipping. Try increasing the buffer size. Needed %zu, had %zu\n",
to_offset + len, to_offset + len,
to_size); to_size);
return 0; return 0;
...@@ -78,7 +78,7 @@ u32 vidtv_memset(void *to, ...@@ -78,7 +78,7 @@ u32 vidtv_memset(void *to,
size_t len) size_t len)
{ {
if (unlikely(to_offset + len > to_size)) { if (unlikely(to_offset + len > to_size)) {
pr_err_ratelimited("overflow detected, skipping. Try increasing the buffer size. Needed %lu, had %zu\n", pr_err_ratelimited("overflow detected, skipping. Try increasing the buffer size. Needed %zu, had %zu\n",
to_offset + len, to_offset + len,
to_size); to_size);
return 0; return 0;
......
...@@ -90,15 +90,9 @@ static u32 vidtv_pes_write_pts_dts(struct pes_header_write_args args) ...@@ -90,15 +90,9 @@ static u32 vidtv_pes_write_pts_dts(struct pes_header_write_args args)
if (!args.send_pts && args.send_dts) if (!args.send_pts && args.send_dts)
return 0; return 0;
#ifdef __BIG_ENDIAN mask1 = GENMASK_ULL(32, 30);
mask1 = GENMASK(30, 32); mask2 = GENMASK_ULL(29, 15);
mask2 = GENMASK(15, 29); mask3 = GENMASK_ULL(14, 0);
mask3 = GENMASK(0, 14);
#else
mask1 = GENMASK(32, 30);
mask2 = GENMASK(29, 15);
mask3 = GENMASK(14, 0);
#endif
/* see ISO/IEC 13818-1 : 2000 p. 32 */ /* see ISO/IEC 13818-1 : 2000 p. 32 */
if (args.send_pts && args.send_dts) { if (args.send_pts && args.send_dts) {
......
...@@ -422,7 +422,7 @@ static void vidtv_s302m_write_frames(struct vidtv_encoder *e) ...@@ -422,7 +422,7 @@ static void vidtv_s302m_write_frames(struct vidtv_encoder *e)
au->nbytes = nbytes_per_unit; au->nbytes = nbytes_per_unit;
if (au_sz + sizeof(struct vidtv_smpte_s302m_es) != nbytes_per_unit) { if (au_sz + sizeof(struct vidtv_smpte_s302m_es) != nbytes_per_unit) {
pr_warn_ratelimited("write size was %d, expected %lu\n", pr_warn_ratelimited("write size was %u, expected %zu\n",
nbytes_per_unit, nbytes_per_unit,
au_sz + sizeof(struct vidtv_smpte_s302m_es)); au_sz + sizeof(struct vidtv_smpte_s302m_es));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment