[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211028203600.2157356-1-mcgrof@kernel.org>
Date: Thu, 28 Oct 2021 13:36:00 -0700
From: Luis Chamberlain <mcgrof@...nel.org>
To: minchan@...nel.org, ngupta@...are.org, senozhatsky@...omium.org,
axboe@...nel.dk
Cc: linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [PATCH] zram: use ATTRIBUTE_GROUPS
Embrace ATTRIBUTE_GROUPS to avoid boiler plate code.
This should not introduce any functional changes.
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
drivers/block/zram/zram_drv.c | 11 ++---------
1 file changed, 2 insertions(+), 9 deletions(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index fcaf2750f68f..268f727f7cba 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1874,14 +1874,7 @@ static struct attribute *zram_disk_attrs[] = {
NULL,
};
-static const struct attribute_group zram_disk_attr_group = {
- .attrs = zram_disk_attrs,
-};
-
-static const struct attribute_group *zram_disk_attr_groups[] = {
- &zram_disk_attr_group,
- NULL,
-};
+ATTRIBUTE_GROUPS(zram_disk);
/*
* Allocate and initialize new zram device. the function returns
@@ -1953,7 +1946,7 @@ static int zram_add(void)
blk_queue_max_write_zeroes_sectors(zram->disk->queue, UINT_MAX);
blk_queue_flag_set(QUEUE_FLAG_STABLE_WRITES, zram->disk->queue);
- device_add_disk(NULL, zram->disk, zram_disk_attr_groups);
+ device_add_disk(NULL, zram->disk, zram_disk_groups);
strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor));
--
2.33.0
Powered by blists - more mailing lists