From 429c78f9b03c57e9a186cc3a13b6d2e9a8cb350f Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 10 Mar 2020 18:31:03 +0100 Subject: [PATCH] ANDROID: GKI: device.h: add Android ABI padding to some structures Try to mitigate potential future driver core api changes by padding to struct bus_type, struct device_driver, struct class, and struct device. Based on a patch from Michal Marek from the SLES kernel Bug: 151154716 Signed-off-by: Greg Kroah-Hartman Change-Id: I6892cde6481ba775789f0c02239dcfde3a26b56e --- include/linux/device.h | 9 +++++++++ include/linux/device/bus.h | 5 +++++ include/linux/device/class.h | 4 ++++ include/linux/device/driver.h | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index 4e1e42798879..540a14f1e052 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -30,6 +30,7 @@ #include #include #include +#include #include struct device; @@ -553,6 +554,14 @@ struct device { #ifdef CONFIG_DMA_OPS_BYPASS bool dma_ops_bypass : 1; #endif + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); + ANDROID_KABI_RESERVE(5); + ANDROID_KABI_RESERVE(6); + ANDROID_KABI_RESERVE(7); + ANDROID_KABI_RESERVE(8); }; /** diff --git a/include/linux/device/bus.h b/include/linux/device/bus.h index 1ea5e1d1545b..93ed259748f8 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -112,6 +112,11 @@ struct bus_type { struct lock_class_key lock_key; bool need_parent_lock; + + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); }; extern int __must_check bus_register(struct bus_type *bus); diff --git a/include/linux/device/class.h b/include/linux/device/class.h index 04e983415c3d..9923e4835526 100644 --- a/include/linux/device/class.h +++ b/include/linux/device/class.h @@ -76,7 +76,11 @@ struct class { const struct dev_pm_ops *pm; struct subsys_private *p; + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); }; struct class_dev_iter { diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h index ee7ba5b5417e..d5ad474e4fab 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -118,6 +118,11 @@ struct device_driver { void (*coredump) (struct device *dev); struct driver_private *p; + + ANDROID_KABI_RESERVE(1); + ANDROID_KABI_RESERVE(2); + ANDROID_KABI_RESERVE(3); + ANDROID_KABI_RESERVE(4); };