Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753848AbcKSQMG (ORCPT ); Sat, 19 Nov 2016 11:12:06 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:32994 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753719AbcKSQME (ORCPT ); Sat, 19 Nov 2016 11:12:04 -0500 From: Nicolai Stange To: Thomas Gleixner Cc: John Stultz , linux-kernel@vger.kernel.org, Nicolai Stange Subject: [RFC v8 21/28] clockevents: pack ->state_use_accessors and ->features together Date: Sat, 19 Nov 2016 17:10:29 +0100 Message-Id: <20161119161036.12679-10-nicstange@gmail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161119160055.12491-1-nicstange@gmail.com> References: <20161119160055.12491-1-nicstange@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1184 Lines: 33 Right now, the members ->state_use_accessors and ->features of struct clock_event_device occupy an int each which is way more than needed: the former can only take one of the five different values from enum clock_event_state while the latter is a bitmask with the highest CLOCK_EVT_FEAT_* bit defined so far being the ninth. Both members are located in the first cacheline and thus, packing them into a single int would free some precious space there. Turn both members into appropriately sized bitfields. Signed-off-by: Nicolai Stange --- include/linux/clockchips.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index c8dfc7a..548f4fe 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -111,8 +111,8 @@ struct clock_event_device { unsigned int min_delta_ticks_adjusted; u32 mult; u32 shift; - enum clock_event_state state_use_accessors; - unsigned int features; + enum clock_event_state state_use_accessors:8; + unsigned int features:24; unsigned long retries; int (*set_state_periodic)(struct clock_event_device *); -- 2.10.2