Skip to contentSkip to conversation

Btrfs: Use PTR_ERR_OR_ZERO

PATCH New Duan Jiong 1 participant 1 message Apr 11, 2014 Btrfs file system

lore
Share & tools
lore

Duan Jiong

author
#0 lore raw

PATCH 1/1 Btrfs: Use PTR_ERR_OR_ZERO

PTR_RET is deprecated. Do not recommend its usage anymore. Use PTR_ERR_OR_ZERO instead.

---
 fs/btrfs/hash.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
fs/btrfs/hash.c +1 -4
index 85889aa..8c2d3b9 100644
@@ -20,10 +20,7 @@ static struct crypto_shash *tfm;
 int __init btrfs_hash_init(void)
 {
 	tfm = crypto_alloc_shash("crc32c", 0, 0);
-	if (IS_ERR(tfm))
-		return PTR_ERR(tfm);
-
-	return 0;
+	return PTR_ERR_OR_ZERO(tfm);
 }
 
 void btrfs_hash_exit(void)
Signature · 1 line
1.8.3.1