Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5593195pxv; Wed, 28 Jul 2021 14:40:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcp1gLvfC+ErHpyWjyBHIujXrNTnbEUaTRvw2JVqknSD0SRoEHAjGRLOzTBhHXuShFOyeZ X-Received: by 2002:a6b:490d:: with SMTP id u13mr1274535iob.176.1627508434308; Wed, 28 Jul 2021 14:40:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627508434; cv=none; d=google.com; s=arc-20160816; b=lkMN2l4PGWhABZXTgs9qE+yN2VavWqoyzgagxhEAkESQkXckRMP0q/A1fSXzFLHTOY VHsLZIaD1D2UIzVAGbk2RHbY28n1xmlyCnr2kP2S/DkH58n1LkWqu8cTFPnYkzwbfHg1 LJfYPhhYCEecubgr0rO1U+bQ4t2TrafXN9L2qCN9Dg++D5IGsISsGVwm7uQ6/btuwo/e fWH06+YWxjZmPKMqpTYNgAkXc7iD4T7EG4Tbr7C/cGkmumqhSvJzbIDuAtH+TIdYvzgR nsqjFMxzr5yUHn2DuXdJZZeledNtWGPWroCaCDcNuUMxicBFh4tFBCFODSR5N71fSL9r njyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=oR4vzK6aCnqNgUfz40K7pF710nacCw6QNahoytQWvX8=; b=HDt1PgsY9lgfoC+lyPWHjXyd9g3IDMNnj9U9sXU1u7AauXzGqimtbqyL4J9IT2Xftn lx/YrqqBfDsz+UP8iVQLeZHzPzjVjLFW0y4xo95hhKmn+9macmlZO/GEETPzEUCHzDQ4 BLlUV4NyPNT0w9Xx0cxO99hzCEvuZW8d/kR047eEwIUmUHtLBAJSzyvsIsG7Rk0iSOWM 5O/Q6ijXTPzm5M9mcjcGAUnz1AdJkZYzXRNjl1R7LI3ADz1QbINu0K9qNl3EViPHVxis eDFNxuB+HFy2KRTcrQWCE8Xr3toVCxCvlDdjYMwVQdor6zK2c7h3PXMfi3QAsT/4KTpr 20xg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=P+ZyHs6o; dkim=neutral (no key) header.i=@suse.cz header.b=l8IhwodT; 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 z17si1017196jao.13.2021.07.28.14.40.21; Wed, 28 Jul 2021 14:40:34 -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; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=P+ZyHs6o; dkim=neutral (no key) header.i=@suse.cz header.b=l8IhwodT; 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 S231916AbhG1VkT (ORCPT + 99 others); Wed, 28 Jul 2021 17:40:19 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:49486 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231126AbhG1VkT (ORCPT ); Wed, 28 Jul 2021 17:40:19 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id A4D301FFF7; Wed, 28 Jul 2021 21:40:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1627508415; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oR4vzK6aCnqNgUfz40K7pF710nacCw6QNahoytQWvX8=; b=P+ZyHs6ofwzlskr3maz1kpnvrKfXlFoSHajF4uBqYXJi2q7qQ4/a6KvY4/0cgio85hOyYh EBOqUdyPJGAHk7Z+VzxfdvaESSda8uIHQnCY8HfeOaPgPC13mEZcQZ10rs+T5vJ9Pm4uqI xEfXn1PQjEiV1Wbs/RqxZWRTjMTIBAg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1627508415; h=from:from:reply-to:reply-to:date:date:message-id:message-id:to:to: cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=oR4vzK6aCnqNgUfz40K7pF710nacCw6QNahoytQWvX8=; b=l8IhwodTcUf+H2UTz+tdhmnb2dLWuiDuSzYxRUsIHmqcrBZ5Hdp9nLOp6zptu/z+kIJUOu wq++yx9GJLecP8CA== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 81390A3B83; Wed, 28 Jul 2021 21:40:15 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 6EF36DA8A7; Wed, 28 Jul 2021 23:37:30 +0200 (CEST) Date: Wed, 28 Jul 2021 23:37:30 +0200 From: David Sterba To: Bart Van Assche Cc: Dan Carpenter , 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 Subject: Re: [PATCH 01/64] media: omap3isp: Extract struct group for memcpy() region Message-ID: <20210728213730.GR5047@suse.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Bart Van Assche , Dan Carpenter , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Wed, Jul 28, 2021 at 02:37:20PM -0700, Bart Van Assche wrote: > 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 { }. Oh, I thought the tendency is is to use { 0 } because that can also intialize the compound members, by a "scalar 0" as it appears in the code.