Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752718AbdF3KO7 (ORCPT ); Fri, 30 Jun 2017 06:14:59 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:34201 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752536AbdF3KO4 (ORCPT ); Fri, 30 Jun 2017 06:14:56 -0400 From: Arvind Yadav To: axboe@kernel.dk, axboe@fb.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] block: Constify attribute_group structures. Date: Fri, 30 Jun 2017 15:44:35 +0530 Message-Id: <8f55a9617ff8ac9ce8154d5bb7dc0181fd37bee4.1498817631.git.arvind.yadav.cs@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1043 Lines: 32 attribute_groups are not supposed to change at runtime. All functions working with attribute_groups provided by work with const attribute_group. So mark the non-const structs as const. File size before: text data bss dec hex filename 5302 544 0 5846 16d6 block/partition-generic.o File size After adding 'const': text data bss dec hex filename 5342 480 0 5822 16be block/partition-generic.o Signed-off-by: Arvind Yadav --- block/partition-generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/partition-generic.c b/block/partition-generic.c index ff07b91..47fa20d 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -196,7 +196,7 @@ static DEVICE_ATTR(discard_alignment, S_IRUGO, part_discard_alignment_show, NULL }; -static struct attribute_group part_attr_group = { +static const struct attribute_group part_attr_group = { .attrs = part_attrs, }; -- 1.9.1