From f456f5cc1cbd9b076aa0af38fc34583136278634 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 | 5 +++++ include/linux/device/driver.h | 5 +++++ 4 files changed, 24 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h index 3f2460975b91..34692d22d443 100644 --- a/include/linux/device.h +++ b/include/linux/device.h @@ -30,6 +30,7 @@ #include #include #include +#include #include struct device; @@ -651,6 +652,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 d8b29ccd07e5..6cf173cbd437 100644 --- a/include/linux/device/bus.h +++ b/include/linux/device/bus.h @@ -115,6 +115,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 4b271d5eb42d..3d6a2b8d4ceb 100644 --- a/include/linux/device/class.h +++ b/include/linux/device/class.h @@ -76,6 +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 2114d65b862f..d2a71e25caab 100644 --- a/include/linux/device/driver.h +++ b/include/linux/device/driver.h @@ -119,6 +119,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); };