mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pujin Shi <shipujin.t@gmail.com>
To: "James E . J . Bottomley" <jejb@linux.ibm.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: Alim Akhtar <alim.akhtar@samsung.com>,
	Avri Altman <avri.altman@wdc.com>,
	Eric Biggers <ebiggers@google.com>,
	Satya Tangirala <satyat@google.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	hankinsea@gmail.com, shipujin.t@gmail.com
Subject: [PATCH 2/2] scsi: ufs: Use memset to initialize variable in ufshcd_clear_keyslot
Date: Fri,  2 Oct 2020 12:05:18 +0800	[thread overview]
Message-ID: <20201002040518.1224-2-shipujin.t@gmail.com> (raw)
In-Reply-To: <20201002040518.1224-1-shipujin.t@gmail.com>

Clang warns:

drivers/scsi/ufs/ufshcd-crypto.c:103:8: warning: missing braces around initializer [-Wmissing-braces]
  union ufs_crypto_cfg_entry cfg = { 0 };
        ^

Signed-off-by: Pujin Shi <shipujin.t@gmail.com>
---
 drivers/scsi/ufs/ufshcd-crypto.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c
index 8fca2a40c517..bd439021ccce 100644
--- a/drivers/scsi/ufs/ufshcd-crypto.c
+++ b/drivers/scsi/ufs/ufshcd-crypto.c
@@ -103,6 +103,9 @@ static int ufshcd_clear_keyslot(struct ufs_hba *hba, int slot)
 	 * might not be sufficient, so just clear the entire cfg.
 	 */
 	union ufs_crypto_cfg_entry cfg = { 0 };
+	union ufs_crypto_cfg_entry cfg;
+
+	memset(&cfg, 0, sizeof(cfg));
 
 	return ufshcd_program_key(hba, &cfg, slot);
 }
-- 
2.18.1


  reply	other threads:[~2020-10-02  4:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-02  4:05 [PATCH 1/2] scsi: ufs: Use memset to initialize variable in ufshcd_crypto_keyslot_program Pujin Shi
2020-10-02  4:05 ` Pujin Shi [this message]
2020-10-02  4:19 ` Eric Biggers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201002040518.1224-2-shipujin.t@gmail.com \
    --to=shipujin.t@gmail.com \
    --cc=alim.akhtar@samsung.com \
    --cc=avri.altman@wdc.com \
    --cc=ebiggers@google.com \
    --cc=hankinsea@gmail.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=satyat@google.com \
    --cc=stanley.chu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®