Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1467940pxk; Fri, 2 Oct 2020 10:12:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsWRM2AcvFY6e4c4vJ56MX7iPSSdMh+igOG/5VtiudxqJrBc11yeJAfskQbGrwcfq7vlxV X-Received: by 2002:a17:906:3e1a:: with SMTP id k26mr3360961eji.96.1601658771325; Fri, 02 Oct 2020 10:12:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601658771; cv=none; d=google.com; s=arc-20160816; b=cKs0lha2fOkE0YDRFn3m3L4wMBBtgkQdeJtovQrz624ZiBoVoarB05q0tpUrfQ9QSK V/AWBW6C5Fsgfh8eQ7Q5iJrpNq5SIn/7RRz0r0e3gaFCriQ6faI03/90raORhxeVDq8d C6w4ywYsUi8TviSk2qGBfxcZoiZ+wqjIVfw+Qmkq0rzZcm51k/A7+e4FuYpd0u17f/hq cXhWg9W/ZL4vLVEHR6FHxC1degWDnbJnhf1rf4TSPjqnfTqHB0KJoPWLNNVdmYejMc2+ +RqhaJQ7j92x6kzBwdsNgdwMO6sDI9ckJ8lHUpkG9FXjguCFLqGsSiFRPLMyOmJ6fHlv zcjA== 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=om0Q2H4YcHeHnq5Mwbq9pG/xcECELzDu+X4AekMQMVI=; b=Xh1MQqijZtMkMgPMZ/knhlEF0o9GKlz3wFOX+dXAGjbL+eO6eSBOfZTawdt0/FygPW 4Qhdis9FOJ999pVWxIKj4Vf2KWuOxUHCPmj+ijmqNSrAb2LlPKjBsTuu7inMxOP8Fne7 jN9BkbhZNnDHrecyj8rss/FZhXHrQWkCDE8uv5TcWtLDiBjl7YERmoroGavWswRO9LL5 copwdkxvnVBUCfg3Cr029PL52W6T8nJAcUJ+q6Prno/zNX90+t69F/Atr6jO/33xRaR3 hhLetEkKg7FOgxrFy+cGPSv2poqV1hJo/l24QudZZjuQfbDzcKOiYn8712Xfi04xxIHx l8+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VkZ5a2fY; 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 yd22si1803555ejb.346.2020.10.02.10.12.29; Fri, 02 Oct 2020 10:12:51 -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=VkZ5a2fY; 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 S2388175AbgJBRJR (ORCPT + 99 others); Fri, 2 Oct 2020 13:09:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:57212 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbgJBRJR (ORCPT ); Fri, 2 Oct 2020 13:09:17 -0400 Received: from gmail.com (unknown [104.132.1.76]) (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 AC03C205ED; Fri, 2 Oct 2020 17:09:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601658557; bh=XkJhhfg+ucSqL54w1TIz8V8cWXLZKBm/Z7c5yzqPaMM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VkZ5a2fYAyrxdUEU/k19Iva7CNZw4aV3k1fJ3wcIKa9aNCo2TKEd8DT5IOhvuV/gW sbcWrHkP5QVVtyItCGlE5+Vbcg4XxDxxbGb2EHxr3BgTtAJIKS2MHPhlkjyR33G4Bz V9Iwc2xEBZoK6nFvStRJEygFemItok06jVFtkIjY= Date: Fri, 2 Oct 2020 10:09:15 -0700 From: ebiggers@kernel.org 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 v2] scsi: ufs: fix missing brace warning for old compilers Message-ID: <20201002170915.GA2119452@gmail.com> References: <20201002063538.1250-1-shipujin.t@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201002063538.1250-1-shipujin.t@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 02, 2020 at 02:35:38PM +0800, Pujin Shi wrote: > 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 > > Fixes: 70297a8ac7a7 ("scsi: ufs: UFS crypto API") > Signed-off-by: Pujin Shi > --- > drivers/scsi/ufs/ufshcd-crypto.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd-crypto.c b/drivers/scsi/ufs/ufshcd-crypto.c > index d2edbd960ebf..07310b12a5dc 100644 > --- a/drivers/scsi/ufs/ufshcd-crypto.c > +++ b/drivers/scsi/ufs/ufshcd-crypto.c > @@ -59,7 +59,7 @@ 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; > > BUILD_BUG_ON(UFS_CRYPTO_KEY_SIZE_INVALID != 0); > @@ -100,7 +100,7 @@ static int ufshcd_clear_keyslot(struct ufs_hba *hba, int slot) > * Clear the crypto cfg on the device. Clearing CFGE > * might not be sufficient, so just clear the entire cfg. > */ > - union ufs_crypto_cfg_entry cfg = { 0 }; > + union ufs_crypto_cfg_entry cfg = {}; > Looks good, Reviewed-by: Eric Biggers