From f4e06599faaeeba1299f14526e2e8cb1fe8fb2a7 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 26 Sep 2019 21:39:37 -0700 Subject: [PATCH] ecryptfs: Remove two pointless NULL checks in ecryptfs_dump_cipher Clang warns: ../fs/ecryptfs/debug.c:142:12: warning: address of array 'stat->cipher' will always evaluate to 'true' [-Wpointer-bool-conversion] if (stat->cipher) ~~ ~~~~~~^~~~~~ ../fs/ecryptfs/debug.c:146:12: warning: address of array 'stat->cipher_mode' will always evaluate to 'true' [-Wpointer-bool-conversion] if (stat->cipher_mode) ~~ ~~~~~~^~~~~~~~~~~ 2 warnings generated. Fixes: f50a4a1dc7a0 ("eCryptfs: fixed bug in cipher handling") Signed-off-by: Nathan Chancellor --- fs/ecryptfs/debug.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/ecryptfs/debug.c b/fs/ecryptfs/debug.c index 0556af1adfb7..d34a1d6b40fc 100644 --- a/fs/ecryptfs/debug.c +++ b/fs/ecryptfs/debug.c @@ -139,12 +139,8 @@ void ecryptfs_dump_cipher(struct ecryptfs_crypt_stat *stat) if (!stat) return; - if (stat->cipher) - ecryptfs_printk(KERN_DEBUG, - "ecryptfs cipher is %s\n", stat->cipher); - - if (stat->cipher_mode) - ecryptfs_printk(KERN_DEBUG, "ecryptfs cipher mode is %s\n", - stat->cipher_mode); + ecryptfs_printk(KERN_DEBUG, "ecryptfs cipher is %s\n", stat->cipher); + ecryptfs_printk(KERN_DEBUG, "ecryptfs cipher mode is %s\n", + stat->cipher_mode); } -- 2.11.0