bcache: remove return value from bch_cached_dev_error
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 bcache: remove return value from bch_cached_dev_error
The only caller of bch_cached_dev_error does not check the return value. We can make it a void function.
Signed-off-by Zhen Zhang <[email protected]>
--- drivers/md/bcache/bcache.h | 2 +- drivers/md/bcache/super.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/md/bcache/bcache.h +1 -1
@@ -990,7 +990,7 @@ int bch_bucket_alloc_set(struct cache_set *c, unsigned int reserve,bool bch_alloc_sectors (struct cache_set *c,struct bkey *k,unsigned int sectors,unsigned int write_point,unsigned int write_prio,bool wait); -bool bch_cached_dev_error (struct cached_dev *dc); +void bch_cached_dev_error (struct cached_dev *dc); __printf(2, 3)bool bch_cache_set_error (struct cache_set *c,const char *fmt, ...);
drivers/md/bcache/super.c +2 -2
@@ -1607,10 +1607,10 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size)return flash_dev_run (c, u); } -bool bch_cached_dev_error(struct cached_dev *dc) +void bch_cached_dev_error(struct cached_dev *dc) {if (!dc ||test_bit (BCACHE_DEV_CLOSING , &dc->disk.flags)) -return false; +return ; dc->io_disable = true;/* make others know io_disable is true earlier */
@@ -1620,7 +1620,6 @@ bool bch_cached_dev_error(struct cached_dev *dc) dc->disk.disk->disk_name, dc->bdev);bcache_device_stop (&dc->disk); -return true; }/* Cache set */
Signature · 1 line
2.27.0
Quoted 4 lines · Zhang Zhen
The only caller of
bch_cached_dev_errordoes not check the return value. We can make it a void function.Signed-off-by Zhen Zhang <[email protected]>
NACK. I prefer to have the return values for different conditions, even they are not used for now.
Coly Li
Quoted 43 lines
--- drivers/md/bcache/bcache.h | 2 +- drivers/md/bcache/super.c | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-)drivers/md/bcache/bcache.h +1
-1@@ -990,7 +990,7 @@ int bch_bucket_alloc_set(struct cache_set *c, unsignedint reserve, bool bch_alloc_sectors(struct cache_set *c, struct bkey *k,unsigned int sectors,unsigned int write_point,unsigned int write_prio,bool wait); -bool bch_cached_dev_error (struct cached_dev *dc); +void bch_cached_dev_error (struct cached_dev *dc); __printf(2, 3)bool bch_cache_set_error (struct cache_set *c,const char *fmt, ...);drivers/md/bcache/super.c +2
-2@@ -1607,10 +1607,10 @@ int bch_flash_dev_create(struct cache_set *c, uint64_t size)return flash_dev_run (c, u); } -bool bch_cached_dev_error(struct cached_dev *dc) +void bch_cached_dev_error(struct cached_dev *dc) {if (!dc ||test_bit (BCACHE_DEV_CLOSING , &dc->disk.flags)) -return false; +return ; dc->io_disable = true;/* make others know io_disable is true earlier */ @@ -1620,7 +1620,6 @@ bool bch_cached_dev_error(struct cached_dev *dc) dc->disk.disk->disk_name, dc->bdev);bcache_device_stop (&dc->disk); -return true; }/* Cache set */ Signature · 1 line
2.27.0
Signature · 1 line
Coly Li