Skip to content

Commit 857c4c0

Browse files
committed
dm writecache: remove BUG() and fail gracefully instead
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>
1 parent e7b6241 commit 857c4c0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/md/dm-writecache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ static int persistent_memory_claim(struct dm_writecache *wc)
319319
#else
320320
static int persistent_memory_claim(struct dm_writecache *wc)
321321
{
322-
BUG();
322+
return -EOPNOTSUPP;
323323
}
324324
#endif
325325

0 commit comments

Comments
 (0)