Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5591847pxv; Wed, 28 Jul 2021 14:37:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjw+i7S6g6OdhpTzuSWaKNYEabq5rYqwIV7iRePa6Jje9CFMwNNdTGV/cTbEzJwyiCLDCf X-Received: by 2002:a6b:5d14:: with SMTP id r20mr1308721iob.140.1627508272974; Wed, 28 Jul 2021 14:37:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627508272; cv=none; d=google.com; s=arc-20160816; b=iFNloGTjMvrlVNX+Lp0W+w2JrlmxTSpmnUKfhzoFMzZ1OO4QGq5FbhQ+go4Ui2V3Ta Oz3P/MYE2JVZdTgKLDHeftfG/Itntu3U04aHg1o88D5AIgiMbMh8ePuPk0N1cZEryBck k8HfskTtL7pj0zvmRcPXGC71CK+7q/11nD5sILj6p1QqmG/wPQeraVuqwNm+hHp5WcPq yHjYyT4RDP2AzTcpqf3JWI4GcK5AHRCWbEeuz6S1UmIHZRluBDvSEuVH8x1Woshd9dIo IKpnxX5dl2bgGfWlugaAb80S1CjerOyTDN6oPw36TEdeHus/EzuwIy110rvHV+Vu9ZtT axAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject; bh=CSb4kSgsWGnwPSdmUAsGp2plOhe3boBZns6CpvCX17k=; b=ipKDTUmPT9ns4n/7AiiPYpukR/KrG+pYRj7X4hj6RFXuz4y6y1hOxlPpt+h0NX4QgP S/xScOaUuRsFGSepoGcTRIWW4AWGvNFY4o8x2r1Ct+A5zVG9wZzLfRzu8CR2AFWxutMF f9rQ/5DpiUqlTIS9yK+WzfBwn6g6+MYJ+AkfS8dxWIxGaoBD7LKR+ErsTjhsXN86LNgM kAC3Uuf5sy70uAwHdz1gK19SnNkeTAqek13eHc7Ki0IDMbtsm56YKn4Q5CBEup1+VmH+ aXc3prZGWaAxyA+Png6U1fI+fM+U8Z/xJMjYk9r2wkIm7H80CJhP9iUXa+CUQmZr3DGP HWAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si1303895ilu.89.2021.07.28.14.37.34; Wed, 28 Jul 2021 14:37:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231719AbhG1Vh1 (ORCPT + 99 others); Wed, 28 Jul 2021 17:37:27 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:34509 "EHLO mail-pl1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230156AbhG1Vh0 (ORCPT ); Wed, 28 Jul 2021 17:37:26 -0400 Received: by mail-pl1-f172.google.com with SMTP id d1so4396949pll.1; Wed, 28 Jul 2021 14:37:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CSb4kSgsWGnwPSdmUAsGp2plOhe3boBZns6CpvCX17k=; b=uXypgX22V/k+l41XgqFritHsAPaMfg89w3e9zMGbN2uAN7LfHXlfCra0IUid/I1tuu zuKP1U7J5R2BmSSJqcm8py+3omMUmkY+sMffmXLPT4JIWvaai9XmKNJN4CoHM/+jmRmT W5kYoZbNfrXcO/vHxVMKP24MzOtetMVz2vSmrO+Yi0xk9qW1hxM5oDS+s4TxsXnyiAJh ldC1fPN4ogIRm7AtXO2109BkpiNA4TvkEpBg+6GGTc3sItcUv8VW/67E4F5/P4lQCbMq MV3htCNZDcNmqeQagO55jwy2Zm7F049UI1JTQ2wH4/6TnczHASAe17to1vFpt92Em/C7 7K7Q== X-Gm-Message-State: AOAM530eCqDa8md/es0ryp22oB7NXenFtbC9VTZ/Kv7/FDEAfu37Cl/g FOUgMzS8C5pYlbYv9nixY1o= X-Received: by 2002:a63:1926:: with SMTP id z38mr816981pgl.451.1627508243326; Wed, 28 Jul 2021 14:37:23 -0700 (PDT) Received: from bvanassche-linux.mtv.corp.google.com ([2620:15c:211:1:3328:5f8d:f6e2:85ea]) by smtp.gmail.com with ESMTPSA id o8sm693212pjm.21.2021.07.28.14.37.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Jul 2021 14:37:22 -0700 (PDT) Subject: Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region To: Dan Carpenter , dsterba@suse.cz, Kees Cook , linux-hardening@vger.kernel.org, "Gustavo A. R. Silva" , Keith Packard , Greg Kroah-Hartman , Andrew Morton , linux-kernel@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-staging@lists.linux.dev, linux-block@vger.kernel.org, linux-kbuild@vger.kernel.org, clang-built-linux@googlegroups.com, nborisov@suse.com References: <20210727205855.411487-1-keescook@chromium.org> <20210727205855.411487-2-keescook@chromium.org> <20210728085921.GV5047@twin.jikos.cz> <20210728091434.GQ1931@kadam> From: Bart Van Assche Message-ID: Date: Wed, 28 Jul 2021 14:37:20 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210728091434.GQ1931@kadam> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 7/28/21 2:14 AM, Dan Carpenter wrote: > On Wed, Jul 28, 2021 at 10:59:22AM +0200, David Sterba wrote: >>> drivers/media/platform/omap3isp/ispstat.c | 5 +-- >>> include/uapi/linux/omap3isp.h | 44 +++++++++++++++++------ >>> 2 files changed, 36 insertions(+), 13 deletions(-) >>> >>> diff --git a/drivers/media/platform/omap3isp/ispstat.c b/drivers/media/platform/omap3isp/ispstat.c >>> index 5b9b57f4d9bf..ea8222fed38e 100644 >>> --- a/drivers/media/platform/omap3isp/ispstat.c >>> +++ b/drivers/media/platform/omap3isp/ispstat.c >>> @@ -512,7 +512,7 @@ int omap3isp_stat_request_statistics(struct ispstat *stat, >>> int omap3isp_stat_request_statistics_time32(struct ispstat *stat, >>> struct omap3isp_stat_data_time32 *data) >>> { >>> - struct omap3isp_stat_data data64; >>> + struct omap3isp_stat_data data64 = { }; >> >> Should this be { 0 } ? >> >> We've seen patches trying to switch from { 0 } to { } but the answer >> was that { 0 } is supposed to be used, >> http://www.ex-parrot.com/~chris/random/initialise.html >> >> (from https://lore.kernel.org/lkml/fbddb15a-6e46-3f21-23ba-b18f66e3448a@suse.com/) > > In the kernel we don't care about portability so much. Use the = { } > GCC extension. If the first member of the struct is a pointer then > Sparse will complain about = { 0 }. +1 for { }. BTW, my understanding is that neither the C standard nor the C++ standard guarantee anything about initialization of padding bytes nor about the initialization of unnamed bitfields for stack variables when using aggregate initialization. Bart.