Skip to content

Commit

Permalink
dm writecache: remove BUG() and fail gracefully instead
Browse files Browse the repository at this point in the history
Building on arch/s390/ results in this build error:

cc1: some warnings being treated as errors
../drivers/md/dm-writecache.c: In function 'persistent_memory_claim':
../drivers/md/dm-writecache.c:323:1: error: no return statement in function returning non-void [-Werror=return-type]

Fix this by replacing the BUG() with an -EOPNOTSUPP return.

Fixes: 48debaf ("dm: add writecache target")
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
  • Loading branch information
Mike Snitzer committed Dec 1, 2020
1 parent e7b6241 commit 857c4c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/md/dm-writecache.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static int persistent_memory_claim(struct dm_writecache *wc)
#else
static int persistent_memory_claim(struct dm_writecache *wc)
{
BUG();
return -EOPNOTSUPP;
}
#endif

Expand Down

0 comments on commit 857c4c0

Please sign in to comment.