summaryrefslogtreecommitdiff
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorZheng Qixing <zhengqixing@huawei.com>2025-02-27 15:55:05 +0800
committerJens Axboe <axboe@kernel.dk>2025-03-06 08:03:28 -0700
commitc8775aefba959cdfbaa25408a84d3dd15bbeb991 (patch)
tree4dd0a3bb535d85f6c5666e0c064e62f7644ce337 /drivers/nvdimm
parent5236f041fa6c81c71eabad44897e54a0d6d5bbf6 (diff)
downloadlinux-c8775aefba959cdfbaa25408a84d3dd15bbeb991.tar.gz
linux-c8775aefba959cdfbaa25408a84d3dd15bbeb991.tar.bz2
linux-c8775aefba959cdfbaa25408a84d3dd15bbeb991.zip
badblocks: return boolean from badblocks_set() and badblocks_clear()
Change the return type of badblocks_set() and badblocks_clear() from int to bool, indicating success or failure. Specifically: - _badblocks_set() and _badblocks_clear() functions now return true for success and false for failure. - All calls to these functions are updated to handle the new boolean return type. - This change improves code clarity and ensures a more consistent handling of success and failure states. Signed-off-by: Zheng Qixing <zhengqixing@huawei.com> Reviewed-by: Yu Kuai <yukuai3@huawei.com> Acked-by: Coly Li <colyli@kernel.org> Acked-by: Ira Weiny <ira.weiny@intel.com> Link: https://lore.kernel.org/r/20250227075507.151331-11-zhengqixing@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/badrange.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/nvdimm/badrange.c b/drivers/nvdimm/badrange.c
index a002ea6fdd84..ee478ccde7c6 100644
--- a/drivers/nvdimm/badrange.c
+++ b/drivers/nvdimm/badrange.c
@@ -167,7 +167,7 @@ static void set_badblock(struct badblocks *bb, sector_t s, int num)
dev_dbg(bb->dev, "Found a bad range (0x%llx, 0x%llx)\n",
(u64) s * 512, (u64) num * 512);
/* this isn't an error as the hardware will still throw an exception */
- if (badblocks_set(bb, s, num, 1))
+ if (!badblocks_set(bb, s, num, 1))
dev_info_once(bb->dev, "%s: failed for sector %llx\n",
__func__, (u64) s);
}