Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752270AbdGCGNf (ORCPT ); Mon, 3 Jul 2017 02:13:35 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36770 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750784AbdGCGNd (ORCPT ); Mon, 3 Jul 2017 02:13:33 -0400 From: Arvind Yadav To: minchan@kernel.org, ngupta@vflare.org Cc: sergey.senozhatsky.work@gmail.com, linux-kernel@vger.kernel.org Subject: [PATCH] zram: constify attribute_group structures. Date: Mon, 3 Jul 2017 11:43:13 +0530 Message-Id: <65680c1c4d85818f7094cbfa31c91bf28185ba1b.1499061182.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: 1075 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 8293 841 4 9138 23b2 drivers/block/zram/zram_drv.o File size After adding 'const': text data bss dec hex filename 8357 777 4 9138 23b2 drivers/block/zram/zram_drv.o Signed-off-by: Arvind Yadav --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index debee95..5da5c04 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1122,7 +1122,7 @@ static int zram_open(struct block_device *bdev, fmode_t mode) NULL, }; -static struct attribute_group zram_disk_attr_group = { +static const struct attribute_group zram_disk_attr_group = { .attrs = zram_disk_attrs, }; -- 1.9.1