]> git.baikalelectronics.ru Git - kernel.git/commit
nvmet: fix comparison of a u16 with -1
authorColin Ian King <colin.king@canonical.com>
Fri, 14 Dec 2018 18:31:21 +0000 (18:31 +0000)
committerChristoph Hellwig <hch@lst.de>
Tue, 18 Dec 2018 16:50:43 +0000 (17:50 +0100)
commit2ecbea3f3a21448f295fede37ea666b323e563f5
treedd0ffeb07495b1d5a5acffec8d698543768bb9ec
parentce4a99941ee55698a3efca02fce0483f7c2c7389
nvmet: fix comparison of a u16 with -1

Currently the u16 req->error_loc is being compared to -1 which
will always be false.  Fix this by casting -1 to u16 to fix this.

Detected by clang:
  warning: result of comparison of constant -1 with expression of
  type 'u16' (aka 'unsigned short') is always false
  [-Wtautological-constant-out-of-range-compare]

Fixes: 769c057ea935 ("nvmet: add interface to update error-log page")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/core.c