Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1010860pxk; Thu, 1 Oct 2020 21:21:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzoTx+TC3Y5OhUuIeQ2a8txss84+MIyfls2uoxlSXBnPbqrhyAc9IpQxl0K3vY2z4rkOCq X-Received: by 2002:a50:c94c:: with SMTP id p12mr320807edh.182.1601612505437; Thu, 01 Oct 2020 21:21:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601612505; cv=none; d=google.com; s=arc-20160816; b=ORk2LEZt5UUkKnVvlEWaArjGGI700IrExsR8jsG5GAYUrwl8nPop3ZiOuTJ4+UV9xK xSwE4Wsp33HCQpmRsP9aZBjrSIlDQ4YdzoafCMsFT5I7jvxokGIDNr+YSRNEulP+gnjA egWj8WsTuXtn6s3A3Cx8PWUArRCmmhaAblMRB7vsGXnRdsyTITelhNeckTkFICHLN5NL wom9dTUvAptWocwRT8h7Hxd12/XakVbo0gBozxWwSfgwR4snB1T2FPLE5YB25lCc7VNY QqoFu5hnmMVXk5MakYbRoHYat4fDDu2DH4nTEk0//w4xQqoGsK0woQAaxuXE9ePRsPaj NCtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=lL+hkgkpqDygy2HJX0k1aGiyI1Mn3LJ1GjfQYns348Y=; b=B5qbZIsw19SvZgECpTYMTkq/yF4VH/oXkU98vTXz4pn4SRXPPxfQoVXIjcHPrgDurM K0mG2IDbJ5ostoDgNOH3YJJClhA+ERlVa3EaN0sKxEJ411yecl4hASkSO0DMXTLitEPg WCGjMcejvpn/reKKXZPYgaYJhSZMta6xYwgUfvx0UrUHvMpKUGbqsiRzYtQATQYv5Ocj 0Jyp+j+USKpElqWS03QAns3uv8nBnduSWavmsaWS7j6AAemRZYlWpp+KzfnIN4MpnjoU aZImJ9QFSfCTTHqmLoRViq25/hq5hzlL5rz8oh8aG5oVeeBbXYl9JyUxyuykx353rzh0 77vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=K89zENm0; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u19si118047eds.502.2020.10.01.21.21.23; Thu, 01 Oct 2020 21:21:45 -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=@kernel.org header.s=default header.b=K89zENm0; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725968AbgJBETN (ORCPT + 99 others); Fri, 2 Oct 2020 00:19:13 -0400 Received: from mail.kernel.org ([198.145.29.99]:48538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725926AbgJBETM (ORCPT ); Fri, 2 Oct 2020 00:19:12 -0400 Received: from sol.localdomain (172-10-235-113.lightspeed.sntcca.sbcglobal.net [172.10.235.113]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 589E920796; Fri, 2 Oct 2020 04:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601612352; bh=VNJapsQTTyEmiuSQJg6sqrJGIXXBuxZSpS+OAzNcVm4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=K89zENm0GcOS4C1dUyty0oeWptjfCLrtXMUt+15Jp1eDyjKnqtAMoQu3Rm8qKyOqV FSWS8i5Et4I+SWKlOybASR3Rop8GkaQxP8PR/YO7B3rQk3++v0QjWYixya02T8PFzj P1hTfSpOYbwF+jnynnoWJGD6S1QevfuVs1ZlktJw= Date: Thu, 1 Oct 2020 21:19:10 -0700 From: Eric Biggers To: Pujin Shi Cc: "James E . J . Bottomley" , "Martin K . Petersen" , Alim Akhtar , Avri Altman , Satya Tangirala , Stanley Chu , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, hankinsea@gmail.com Subject: Re: [PATCH 1/2] scsi: ufs: Use memset to initialize variable in ufshcd_crypto_keyslot_program Message-ID: <20201002041910.GB78003@sol.localdomain> References: <20201002040518.1224-1-shipujin.t@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201002040518.1224-1-shipujin.t@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 02, 2020 at 12:05:17PM +0800, Pujin Shi wrote: > Clang warns: > > drivers/scsi/ufs/ufshcd-crypto.c:62:8: warning: missing braces around initializer [-Wmissing-braces] > union ufs_crypto_cfg_entry cfg = { 0 }; > ^ > Which version of clang? I don't see the warning with clang 10.0.1 (or with gcc 10.2.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)); > + How about an empty initializer? union ufs_crypto_cfg_entry cfg = {}; Same comments on your other patch. - Eric