Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1689113

Re: [PATCH] mfd: ab8500-core: constify attribute_group structures.

Path csiph.com!eternal-september.org!feeder.eternal-september.org!aioe.org!bofh.it!news.nic.it!robomod
From Lee Jones <lee.jones@linaro.org>
Newsgroups linux.kernel
Subject Re: [PATCH] mfd: ab8500-core: constify attribute_group structures.
Date Mon, 17 Jul 2017 16:40:02 +0200
Message-ID <u4flM-6ht-19@gated-at.bofh.it> (permalink)
References <u1zAl-Th-5@gated-at.bofh.it>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=QjD5K5JGsbGo/1k/nz4NYIupa3kwzHkxxEndTWRNp6U=; b=WdHbnB2FtXX7j9H68Q8QMLyCaS+PQxtiG+SdWvoByh9vo48bcjvX/1Fc3o5Mk0xhd9 2W/pL1gpIRUbsTcZrheNYrecu5obXY/hgkri/M00Q80hf/LpTOJv74mv7PQ+qOyz8/zV OqQ1CRPjeH8NEcZ4DDKXw/DfeUQww244+uAgY=
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=QjD5K5JGsbGo/1k/nz4NYIupa3kwzHkxxEndTWRNp6U=; b=V0cPvZoUi1Y3MWziXfg4f/u16yhnb8ezQ0E9EGWErK1WgZLrxp+BVTZAYTNvxLWXn0 X4eDMi5g/qkDDH0DK+9DKIxzwzkCws9ocU52FuwO6YOFKI5rIX93LJII9BJ1q9ujN4vT sKincdKC+yjap6nWEzZlSeM86yLDv/AVHtPRWj5ZmsqYYY4mMFkrLO3N1A1AhH21dwck eVz1jB+kHUunHPbHmGHCzmvTsjq8unS+zK1PWbCeqBP9eT+OFtdyHQCmW8MYbTDvvw8o TYNhBVLCHVYSQ9KG1Aqe1zTZXm4W2pLdLpgasvQFKKGcZPAJ4nv4fqffkvyqwJCZ6hb7 VVaQ==
X-Gm-Message-State AIVw112/XacuOUSEJoXUfUHwmChiLV77ETROL1hn5wGl/U6o0uiu/Dap mwtaUBYSSHSbS+he
X-Received by 10.28.215.145 with SMTP id o139mr4546684wmg.5.1500302135540; Mon, 17 Jul 2017 07:35:35 -0700 (PDT)
MIME-Version 1.0
Content-Type text/plain; charset=utf-8
Content-Disposition inline
Content-Transfer-Encoding 8bit
User-Agent NeoMutt/20170113 (1.7.2)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 50
Organization linux.* mail to news gateway
X-Original-Cc linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org
X-Original-Date Mon, 17 Jul 2017 15:35:25 +0100
X-Original-Message-ID <20170717143525.iyv2nmjflzattir3@dell>
X-Original-References <82391b6661b206976c244dcef76946c45c6aac2d.1499664942.git.arvind.yadav.cs@gmail.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1689113

Show key headers only | View raw


On Mon, 10 Jul 2017, Arvind Yadav wrote:

> attribute_groups are not supposed to change at runtime. All functions
> working with attribute_groups provided by <linux/sysfs.h> work with const
> attribute_group. So mark the non-const structs as const.
> 
> File size before:
>    text	   data	    bss	    dec	    hex	filename
>   16298	   1009	    184	  17491	   4453	drivers/mfd/ab8500-core.o
> 
> File size After adding 'const':
>    text	   data	    bss	    dec	    hex	filename
>   16490	    817	    184	  17491	   4453	drivers/mfd/ab8500-core.o
> 
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
>  drivers/mfd/ab8500-core.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks.

> diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c
> index 8511c06..30d09d1 100644
> --- a/drivers/mfd/ab8500-core.c
> +++ b/drivers/mfd/ab8500-core.c
> @@ -1059,15 +1059,15 @@ static DEVICE_ATTR(dbbrstn, S_IRUGO | S_IWUSR,
>  	NULL,
>  };
>  
> -static struct attribute_group ab8500_attr_group = {
> +static const struct attribute_group ab8500_attr_group = {
>  	.attrs	= ab8500_sysfs_entries,
>  };
>  
> -static struct attribute_group ab8505_attr_group = {
> +static const struct attribute_group ab8505_attr_group = {
>  	.attrs	= ab8505_sysfs_entries,
>  };
>  
> -static struct attribute_group ab9540_attr_group = {
> +static const struct attribute_group ab9540_attr_group = {
>  	.attrs	= ab9540_sysfs_entries,
>  };
>  

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH] mfd: ab8500-core: constify attribute_group structures. Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-07-10 07:40 +0200
  Re: [PATCH] mfd: ab8500-core: constify attribute_group structures. Lee Jones <lee.jones@linaro.org> - 2017-07-17 16:40 +0200

csiph-web