From: Wang, Yalin Date: Thu, 11 Sep 2014 08:19:49 +0000 (+0800) Subject: regmap: change struct regmap's internal locks as union X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=336fb81b319ec4d5c09aa6417de7c042cfcd7461;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git regmap: change struct regmap's internal locks as union this patch change struct regmap->mutex and struct regmap->spinlock as an union, because these 2 members are only used one of them, we change it to shrink the struct size. Signed-off-by: Yalin Wang Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/internal.h b/drivers/base/regmap/internal.h index 7d1326985bee..f82e8faa5d93 100644 --- a/drivers/base/regmap/internal.h +++ b/drivers/base/regmap/internal.h @@ -49,8 +49,10 @@ struct regmap_async { }; struct regmap { - struct mutex mutex; - spinlock_t spinlock; + union { + struct mutex mutex; + spinlock_t spinlock; + }; unsigned long spinlock_flags; regmap_lock lock; regmap_unlock unlock;