* [PATCH] Btrfs: Use PTR_ERR_OR_ZERO
@ 2014-04-11 3:09 Duan Jiong
0 siblings, 0 replies; only message in thread
From: Duan Jiong @ 2014-04-11 3:09 UTC (permalink / raw)
To: Filipe David Borba Manana, Chris Mason; +Cc: linux-btrfs
PTR_RET is deprecated. Do not recommend its usage anymore.
Use PTR_ERR_OR_ZERO instead.
Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
---
fs/btrfs/hash.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/fs/btrfs/hash.c b/fs/btrfs/hash.c
index 85889aa..8c2d3b9 100644
--- a/fs/btrfs/hash.c
+++ b/fs/btrfs/hash.c
@@ -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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-11 3:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-11 3:09 [PATCH] Btrfs: Use PTR_ERR_OR_ZERO Duan Jiong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).