From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84730C4338F for ; Thu, 12 Aug 2021 13:03:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5E2A261059 for ; Thu, 12 Aug 2021 13:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236141AbhHLNEM (ORCPT ); Thu, 12 Aug 2021 09:04:12 -0400 Received: from mga17.intel.com ([192.55.52.151]:13025 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236042AbhHLNEM (ORCPT ); Thu, 12 Aug 2021 09:04:12 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10073"; a="195613980" X-IronPort-AV: E=Sophos;i="5.84,315,1620716400"; d="scan'208";a="195613980" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2021 06:03:43 -0700 X-IronPort-AV: E=Sophos;i="5.84,315,1620716400"; d="scan'208";a="676759385" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Aug 2021 06:03:41 -0700 Received: from andy by smile with local (Exim 4.94.2) (envelope-from ) id 1mEAMx-008ajP-Fh; Thu, 12 Aug 2021 16:03:35 +0300 Date: Thu, 12 Aug 2021 16:03:35 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Kent Gibson , Linus Walleij , Jack Winch , Helmut Grohne , Ben Hutchings , "open list:GPIO SUBSYSTEM" Subject: Re: [libgpiod v2.0][PATCH] core: extend config objects Message-ID: References: <20210806132810.23556-1-brgl@bgdev.pl> <20210807084809.GA17852@sol> <20210808231012.GA6224@sol> <20210810103113.GA6637@sol> <20210812102913.GA21938@sol> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org On Thu, Aug 12, 2021 at 02:51:02PM +0200, Bartosz Golaszewski wrote: > On Thu, Aug 12, 2021 at 12:29 PM Kent Gibson wrote: > As you said - it's on the heap, so who cares. But this is also an > internal structure and so we can use bit fields. That should reduce > the memory footprint significantly as we now don't require more than 3 > bits for any given enum. That would leave us with the debounce period > and offset as full size variables. Side note (I believe you know about): bit fields are the beasts when you have to have a locked access. -- With Best Regards, Andy Shevchenko