[PATCH 02/18] media: allegro: add helper to report unsupported fields

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Allow generators to explicitly signal an error if the C structs contain
unsupported or invalid fields.

Signed-off-by: Michael Tretter <m.tretter@xxxxxxxxxxxxxx>
---
 drivers/media/platform/allegro-dvt/nal-rbsp.c | 5 +++++
 drivers/media/platform/allegro-dvt/nal-rbsp.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/drivers/media/platform/allegro-dvt/nal-rbsp.c b/drivers/media/platform/allegro-dvt/nal-rbsp.c
index 935ba23844f2..d911322d0efa 100644
--- a/drivers/media/platform/allegro-dvt/nal-rbsp.c
+++ b/drivers/media/platform/allegro-dvt/nal-rbsp.c
@@ -29,6 +29,11 @@ void rbsp_init(struct rbsp *rbsp, void *addr, size_t size,
 	rbsp->error = 0;
 }
 
+void rbsp_unsupported(struct rbsp *rbsp)
+{
+	rbsp->error = -EINVAL;
+}
+
 static int rbsp_read_bits(struct rbsp *rbsp, int n, unsigned int *value);
 static int rbsp_write_bits(struct rbsp *rbsp, int n, unsigned int value);
 
diff --git a/drivers/media/platform/allegro-dvt/nal-rbsp.h b/drivers/media/platform/allegro-dvt/nal-rbsp.h
index 90cc1a4f716d..c72f49fed8d3 100644
--- a/drivers/media/platform/allegro-dvt/nal-rbsp.h
+++ b/drivers/media/platform/allegro-dvt/nal-rbsp.h
@@ -49,6 +49,7 @@ extern struct nal_rbsp_ops read;
 
 void rbsp_init(struct rbsp *rbsp, void *addr, size_t size,
 	       struct nal_rbsp_ops *ops);
+void rbsp_unsupported(struct rbsp *rbsp);
 
 void rbsp_bit(struct rbsp *rbsp, int *value);
 void rbsp_bits(struct rbsp *rbsp, int n, int *value);
-- 
2.20.1




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux