From a9cedd30326a0fd7f7df3f4572f1132e67ad3447 Mon Sep 17 00:00:00 2001 From: Pujin Shi Date: Fri, 2 Oct 2020 14:35:38 +0800 Subject: [PATCH] BACKPORT: scsi: ufs: Fix missing brace warning for old compilers For older versions of gcc, the array = {0}; will cause warnings: drivers/scsi/ufs/ufshcd-crypto.c: In function 'ufshcd_crypto_keyslot_program': drivers/scsi/ufs/ufshcd-crypto.c:62:8: warning: missing braces around initializer [-Wmissing-braces] union ufs_crypto_cfg_entry cfg = { 0 }; ^ drivers/scsi/ufs/ufshcd-crypto.c:62:8: warning: (near initialization for 'cfg.reg_val') [-Wmissing-braces] drivers/scsi/ufs/ufshcd-crypto.c: In function 'ufshcd_clear_keyslot': drivers/scsi/ufs/ufshcd-crypto.c:103:8: warning: missing braces around initializer [-Wmissing-braces] union ufs_crypto_cfg_entry cfg = { 0 }; ^ 2 warnings generated Link: https://lore.kernel.org/r/20201002063538.1250-1-shipujin.t@gmail.com Fixes: 70297a8ac7a7 ("scsi: ufs: UFS crypto API") Reviewed-by: Eric Biggers Signed-off-by: Pujin Shi Signed-off-by: Martin K. Petersen (cherry picked from commit 6500251e590657066a227dce897a0392f302af24) [drop non-applicable change to ufshcd_crypto_keyslot_program] Bug: 187129171 Signed-off-by: Connor O'Brien Change-Id: I06c4eacc036cc5e9d80217a986cfe9427fb6e255 --- drivers/scsi/ufs/ufshcd-crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c index 43d105bc0e266..f667a946c7405 100644 --- a/drivers/scsi/ufs/ufshcd-crypto.c +++ b/drivers/scsi/ufs/ufshcd-crypto.c @@ -159,7 +159,7 @@ out: static void ufshcd_clear_keyslot(struct ufs_hba *hba, int slot) { - union ufs_crypto_cfg_entry cfg = { 0 }; + union ufs_crypto_cfg_entry cfg = {}; int err; err = ufshcd_program_key(hba, &cfg, slot);