Skip to contentSkip to conversation

media: vidtv: fix build on 32bit architectures

PATCH New Daniel W. S. Almeida 1 participant 1 message Sep 16, 2020

Subsystems (2)
lore
Share & tools
lore

Daniel W. S. Almeida

author maintainer
#0 lore raw

PATCH v2 1/1 media: vidtv: fix build on 32bit architectures

From: Daniel W. S. Almeida <[email protected]>

Fix the following error for builds on 32bit architectures:

ERROR: modpost: "__udivdi3" [drivers/media/test-drivers/vidtv/dvb-vidtv-bridge.ko] undefined!

Which is due to 64bit divisions that did not go through the helpers in linux/math64.h

As vidtv_mux_check_mux_rate was not operational in its current form, drop the entire function while it is not fixed properly.

For now, call vidtv_mux_pad_with_nulls with a constant number of packets to avoid warnings due to unused functions when building this driver.

The 64bit division used in the s302m is not needed, remove them and use a fixed number of frames and a constant PTS increment instead.

Fixes f90cf6079bf67988 ("media: vidtv: add a bridge driver")

---
Changes in v2:

Rework the s302m encoder so that a fixed number of frames and a constant increment value for pts is used. This removes the 64bit division that was making the build fail.

---

 .../media/test-drivers/vidtv/vidtv_encoder.h  |  2 +-
 drivers/media/test-drivers/vidtv/vidtv_mux.c  | 42 +-------------
 .../media/test-drivers/vidtv/vidtv_s302m.c    | 56 ++++++-------------
 .../media/test-drivers/vidtv/vidtv_s302m.h    |  2 +
 4 files changed, 23 insertions(+), 79 deletions(-)
drivers/media/test-drivers/vidtv/vidtv_encoder.h +1 -1
index a7c99cafab4f..65d81daef4c3 100644
@@ -148,7 +148,7 @@ struct vidtv_encoder {
 
 	__be16 es_pid;
 
-	void *(*encode)(struct vidtv_encoder *e, u64 elapsed_time_usecs);
+	void *(*encode)(struct vidtv_encoder *e);
 
 	u32 (*clear)(struct vidtv_encoder *e);
 
drivers/media/test-drivers/vidtv/vidtv_mux.c +2 -40

64 lines not on this page · raw message

drivers/media/test-drivers/vidtv/vidtv_s302m.c +18 -38

109 lines not on this page · raw message

drivers/media/test-drivers/vidtv/vidtv_s302m.h +2 -0
index 01ef47a812c8..eca5e3150ede 100644
@@ -33,10 +33,12 @@
  * struct vidtv_s302m_ctx - s302m encoder context.
  * @enc: A pointer to the containing encoder structure.
  * @frame_index: The current frame in a block
+ * @au_count: The total number of access units encoded up to now
  */
 struct vidtv_s302m_ctx {
 	struct vidtv_encoder *enc;
 	u32 frame_index;
+	u32 au_count;
 };
 
 /**
Signature · 6 lines
2.28.0

_______________________________________________
Linux-kernel-mentees mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees