Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1004642pxk; Thu, 1 Oct 2020 21:07:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+OVdyEqaqKBM5FP7ApxFh/j/wdlFXYLonJe6dImFqI00Qdypupezx2qR83ymRyBsvM9Sr X-Received: by 2002:a17:906:7143:: with SMTP id z3mr203891ejj.361.1601611620567; Thu, 01 Oct 2020 21:07:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601611620; cv=none; d=google.com; s=arc-20160816; b=FrO7/LCRLfanjW+1Vl7Zte524pHsZk+AtU+wzRuOKO/ViKA50DMBeM0i/cKdOPTtbo lZ1T3kTgEH/YfKz99wGBmEBell4LsX4aFI1EXXnKUTlVElFC+ezhrLKilsST7dqQPle2 iIX7XD+EnOtqev3VvwQe+El8KFUM+dYyv3JJTx57i/V5KGF5UhtnxSOYP9jbPvvWNPvH Burtmkye4sWtZGzJDAT1GRhNgPbjLSHvao+Oi1HV/iLph2WK3A/3QX2hAc72lPqdGlM1 vj+7WP1wpYjg7SI1mH0EtR5ipoDByH1Lvk36M4sIrYR5776sx3ecd6CPgDRpJWHUkD8c QSzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :dkim-signature; bh=qjTTmIDjemMC6Cb4Y0veXp5VpbkkdAJ8TRa758oYHTY=; b=sMWE/wXAsPaCCNsjupUfV26tMAWblBpxyMONlJQ8tZxk9QbhGO9cF9nfNI7EjP6yEy wNohxy0UUXLWQEvZrzi6f1ML6wYjyPjPJDcokrpvrkKZ964HGTRjMzfsbA6O0lKh4CjY 2d+XOysedVgCmXjUsCkJ7pTQx+kj89wzOoHEFUAJcsvOw8U8aNLLAmNxcCoD86cOlEEH C8oDuzdBEVH2GrNIvpzpm25yXkVFtNlgKc6mglV78IAH/BZ314krDa510KlKbgg/vkft EsapL7BfVxbrGR2fNVkZPkEAjN5SLcmix1HNjv+Up/Pn63WQKPDtaY9ctikYDzllzD5o gAGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="POG1/SCa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s2si144753edy.490.2020.10.01.21.06.37; Thu, 01 Oct 2020 21:07:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="POG1/SCa"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725972AbgJBEFi (ORCPT + 99 others); Fri, 2 Oct 2020 00:05:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725914AbgJBEFi (ORCPT ); Fri, 2 Oct 2020 00:05:38 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B79A2C0613D0; Thu, 1 Oct 2020 21:05:36 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id h23so68563pjv.5; Thu, 01 Oct 2020 21:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=qjTTmIDjemMC6Cb4Y0veXp5VpbkkdAJ8TRa758oYHTY=; b=POG1/SCaynBC+MY5oa6IzObg44yTsyXi3ADE+6W1ylKn+rMfbTxFAHetrEjepBXVf+ OGYq/pQqF+c+cBsQrpo4zVnKw0ySLk5Qe/TgeJdcpHZkusYh/hvICwYMpb+RDAkh7fhw CET/S19RffTKlXyl0Q/CRGlx0HDm//0B5+cMY4rGxXZ8tg53UG7ZDlZYGMMOiKySJV+7 9FHOc/3LqVHv4ED7adNd2ffAkLjzZT6ys9AbxzPYlVdQqz7ifpvGcsn2abyHGAZ07Cwf TkM1NamNJA/nSfGDhTaY/KpX4bXTlBEW4veAkKuDthG8RJoZBbV6KQfyx/bAVQRdVr/x 5xVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=qjTTmIDjemMC6Cb4Y0veXp5VpbkkdAJ8TRa758oYHTY=; b=KYu3zz9n103Qm3wdUQZFrpRPDjfkpkMrGx/F39TF1EPv7t9OQGVc2XWT5Fia1vDRgG zWg4wgQIOULMqtFEZ4sSempgecVvOZjsVpBUmYl+hSvtJ9p7HDL4hY3zraU7g4AOhn8Z hxxElTqmKJvDDue/Rb+A98Qi+Q65fJTy6Hlwt0J9AcIZcThRHQpoi3+XTHYmk0pU08na kuh0xNW+oqDjRGllQ+HOnn7Me0witug1M0kdSjps4+D+zQtPvQbN0EOcKu7IuAvM1w/V JoOY8pHZTXSyev2eQB3eSW6x+StUt1MhMOISMQle9f0tpCox86FGRlVP9/V7SInMhS6X m54Q== X-Gm-Message-State: AOAM532KeZKuPypF9y4D1TSb19koFvrGRWEchQS/PM2qP0sdv1rktg2+ QE2Ra5z7AHbPg0kflIernw== X-Received: by 2002:a17:90b:4204:: with SMTP id iw4mr623648pjb.175.1601611536312; Thu, 01 Oct 2020 21:05:36 -0700 (PDT) Received: from localhost.localdomain ([47.242.140.181]) by smtp.gmail.com with ESMTPSA id f4sm113203pfj.147.2020.10.01.21.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 21:05:35 -0700 (PDT) From: Pujin Shi To: "James E . J . Bottomley" , "Martin K . Petersen" Cc: Alim Akhtar , Avri Altman , Eric Biggers , Satya Tangirala , Stanley Chu , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hankinsea@gmail.com, shipujin.t@gmail.com Subject: [PATCH 1/2] scsi: ufs: Use memset to initialize variable in ufshcd_crypto_keyslot_program Date: Fri, 2 Oct 2020 12:05:17 +0800 Message-Id: <20201002040518.1224-1-shipujin.t@gmail.com> X-Mailer: git-send-email 2.18.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns: drivers/scsi/ufs/ufshcd-crypto.c:62:8: warning: missing braces around initializer [-Wmissing-braces] union ufs_crypto_cfg_entry cfg = { 0 }; ^ Signed-off-by: Pujin Shi --- drivers/scsi/ufs/ufshcd-crypto.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c index d2edbd960ebf..8fca2a40c517 100644 --- a/drivers/scsi/ufs/ufshcd-crypto.c +++ b/drivers/scsi/ufs/ufshcd-crypto.c @@ -59,9 +59,11 @@ static int ufshcd_crypto_keyslot_program(struct blk_keyslot_manager *ksm, u8 data_unit_mask = key->crypto_cfg.data_unit_size / 512; int i; int cap_idx = -1; - union ufs_crypto_cfg_entry cfg = { 0 }; + union ufs_crypto_cfg_entry cfg; int err; + memset(&cfg, 0, sizeof(cfg)); + BUILD_BUG_ON(UFS_CRYPTO_KEY_SIZE_INVALID != 0); for (i = 0; i < hba->crypto_capabilities.num_crypto_cap; i++) { if (ccap_array[i].algorithm_id == alg->ufs_alg && -- 2.18.1