Blob Blame History Raw
From: Takashi Iwai <tiwai@suse.de>
Subject: Fix kABI breakage of iio_buffer
Patch-mainline: Never, kABI fix
References: bsc#1051510

The recent iio fixes
  patches.drivers/iio-buffer-make-length-types-match-kfifo-types
  patches.drivers/iio-buffer-fix-the-function-signature-to-match-imple
caused a kABI breakage due to the changes from int to unsigned and
size_t.  For fixing this, revert to int for declaration, and use only
unsigned for keeping alignment.

Signed-off-by: Takashi Iwai <tiwai@suse.de>

---
 include/linux/iio/buffer-dma.h  |    4 ++++
 include/linux/iio/buffer_impl.h |   12 ++++++++++--
 2 files changed, 14 insertions(+), 2 deletions(-)

--- a/include/linux/iio/buffer_impl.h
+++ b/include/linux/iio/buffer_impl.h
@@ -52,8 +52,11 @@ struct iio_buffer_access_funcs {
 	int (*request_update)(struct iio_buffer *buffer);
 
 	int (*set_bytes_per_datum)(struct iio_buffer *buffer, size_t bpd);
+#ifdef __GENKSYMS__
+	int (*set_length)(struct iio_buffer *buffer, int length);
+#else
 	int (*set_length)(struct iio_buffer *buffer, unsigned int length);
-
+#endif
 	int (*enable)(struct iio_buffer *buffer, struct iio_dev *indio_dev);
 	int (*disable)(struct iio_buffer *buffer, struct iio_dev *indio_dev);
 
@@ -70,11 +73,16 @@ struct iio_buffer_access_funcs {
  * those writing new buffer implementations.
  */
 struct iio_buffer {
+#ifdef __GENKSYMS__
+	int length;
+	int bytes_per_datum;
+#else
 	/** @length: Number of datums in buffer. */
 	unsigned int length;
 
 	/**  @bytes_per_datum: Size of individual datum including timestamp. */
-	size_t bytes_per_datum;
+	unsigned int bytes_per_datum;
+#endif
 
 	/**
 	 * @access: Buffer access functions associated with the
--- a/include/linux/iio/buffer-dma.h
+++ b/include/linux/iio/buffer-dma.h
@@ -141,7 +141,11 @@ int iio_dma_buffer_read(struct iio_buffe
 	char __user *user_buffer);
 size_t iio_dma_buffer_data_available(struct iio_buffer *buffer);
 int iio_dma_buffer_set_bytes_per_datum(struct iio_buffer *buffer, size_t bpd);
+#ifdef __GENKSYMS__
+int iio_dma_buffer_set_length(struct iio_buffer *buffer, int length);
+#else
 int iio_dma_buffer_set_length(struct iio_buffer *buffer, unsigned int length);
+#endif
 int iio_dma_buffer_request_update(struct iio_buffer *buffer);
 
 int iio_dma_buffer_init(struct iio_dma_buffer_queue *queue,