OSDN Git Service

bcache: Avoid nested function definition
authorPeter Foley <pefoley2@pefoley.com>
Fri, 13 Oct 2017 23:35:28 +0000 (16:35 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 16 Oct 2017 15:07:26 +0000 (09:07 -0600)
commit58f913dce2814a9ea7260e93ed3a949e0d5565e3
tree37a4ac1c7b4ed17019a767047602f80fcfd25058
parent515c24c13c7ff1262cdb40fe631c6391e99c0996
bcache: Avoid nested function definition

Fixes below error with clang:
../drivers/md/bcache/sysfs.c:759:3: error: function definition is not allowed here
                {       return *((uint16_t *) r) - *((uint16_t *) l); }
                ^
../drivers/md/bcache/sysfs.c:789:32: error: use of undeclared identifier 'cmp'
                sort(p, n, sizeof(uint16_t), cmp, NULL);
                                             ^
2 errors generated.

v2:
rename function to __bch_cache_cmp

Signed-off-by: Peter Foley <pefoley2@pefoley.com>
Reviewed-by: Coly Li <colyli@suse.de>
Reviewed-by: Michael Lyle <mlyle@lyle.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/sysfs.c