Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

block: drop dead assignments in loop_init()

Commit 8410d38c2552 ("loop: use __register_blkdev to allocate devices on
demand") simplified loop_init(); so computing the range of the block region
is not required anymore and can be dropped.

Drop dead assignments in loop_init().

As compilers will detect these unneeded assignments and optimize this,
the resulting object code is identical before and after this change.

No functional change. No change in object code.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Lukas Bulwahn and committed by
Jens Axboe
aeb2b0b1 31cc0776

+2 -6
+2 -6
drivers/block/loop.c
··· 2316 2316 static int __init loop_init(void) 2317 2317 { 2318 2318 int i, nr; 2319 - unsigned long range; 2320 2319 struct loop_device *lo; 2321 2320 int err; 2322 2321 ··· 2352 2353 * /dev/loop-control interface, or be instantiated by accessing 2353 2354 * a 'dead' device node. 2354 2355 */ 2355 - if (max_loop) { 2356 + if (max_loop) 2356 2357 nr = max_loop; 2357 - range = max_loop << part_shift; 2358 - } else { 2358 + else 2359 2359 nr = CONFIG_BLK_DEV_LOOP_MIN_COUNT; 2360 - range = 1UL << MINORBITS; 2361 - } 2362 2360 2363 2361 err = misc_register(&loop_misc); 2364 2362 if (err < 0)