summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorLuis Chamberlain <mcgrof@kernel.org>2021-11-09 16:29:49 -0800
committerJens Axboe <axboe@kernel.dk>2021-11-09 19:19:34 -0700
commit278167fd2f8ffe679351605fe03e29ff3ab8db18 (patch)
tree685d3d0485a3002c8bf1ff8e05a9054543ce582c /block
parentecaf97f474447821ade290cebbe82bc9b6b23cff (diff)
downloadlinux-278167fd2f8ffe679351605fe03e29ff3ab8db18.tar.bz2
block: add __must_check for *add_disk*() callers
Now that we have done a spring cleaning on all drivers and added error checking / handling, let's keep it that way and ensure no new drivers fail to stick with it. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Link: https://lore.kernel.org/r/20211110002949.999380-1-mcgrof@kernel.org Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r--block/genhd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/block/genhd.c b/block/genhd.c
index ca2fbab1d425..c5392cc24d37 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -394,8 +394,8 @@ static void disk_scan_partitions(struct gendisk *disk)
* This function registers the partitioning information in @disk
* with the kernel.
*/
-int device_add_disk(struct device *parent, struct gendisk *disk,
- const struct attribute_group **groups)
+int __must_check device_add_disk(struct device *parent, struct gendisk *disk,
+ const struct attribute_group **groups)
{
struct device *ddev = disk_to_dev(disk);
@@ -544,7 +544,7 @@ out_disk_release_events:
out_free_ext_minor:
if (disk->major == BLOCK_EXT_MAJOR)
blk_free_ext_minor(disk->first_minor);
- return WARN_ON_ONCE(ret); /* keep until all callers handle errors */
+ return ret;
}
EXPORT_SYMBOL(device_add_disk);