Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp14423827rwb; Mon, 28 Nov 2022 00:16:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf5dlW+IAgOh0uzcBkx6FPREhuPhTA8rzI5CoBNsyDXZ5g4WEzelzUfow7NpKkDmZszYkA9P X-Received: by 2002:a17:903:244c:b0:189:3279:5e82 with SMTP id l12-20020a170903244c00b0018932795e82mr30407686pls.10.1669623388615; Mon, 28 Nov 2022 00:16:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669623388; cv=none; d=google.com; s=arc-20160816; b=h6L6FSAPOSZvLZsweQrNVYxO+GxjykrW0FG3lHWAzLqB5eeOYWCsxe/RTCwZ2O+Qcg LKUrhzoFXi8x194jv0cSYHEwYry0KDTqJOXUevBbptvFEHw/pbRPJ02turyy3naMjewa /mMamUkgqXQzj+JsVCQWFIS6iGERfTrArd68j+uOMxyYyHo5fXb1nxFdus/QE6pbJ+Ir gq4MwbmBLq/bd8NTegt9H99RcvSHFTYmijeimYdDh8YllQtZUjKh4Sm0f+CnkF+em5z5 tIXKpeSDPVTf3/grIX8kYR7u73m0N8N4dtlUT8ZhQ0/5vxjY90Vudj1XJ6IrrRyErEEf IhBg== 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=5w96l6+kxHjTiQPIGm34868e+fx61cn6XEnbhCyycRc=; b=pwj4S7trNaOU4u0fiTqW21ETTgA1xEU0w6lD3RnOCEWvUn0/Drkr0f80Q7DN8QSSFd +N37Lonv1aB2Mr6TOtQ4qNtKaptEStWebyRF0rZO1SK5Ijl7E5Iq5MXtrpUW4c9V3cta IYnRfO+qonM5Wb6nSxI7pQKTsDc++13PLQKIvpNs9ced9gZf5kCZUGt3hsFAExEMLKVV ES9bEYxFRu/qTk65QvGuPa3MX/ZHYafPuuhHtlY8nnF/9kgtjZyvokx9CqhOkA43JFaM iA+ZbUOWi9F1AeVAe61mt7s2TSdAYFjVZbKTOfosurgPLMXVKSto5KId2Ml8SW505cWw 1veQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Jkdq03L2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t63-20020a638142000000b0043a93738a14si11158116pgd.167.2022.11.28.00.16.18; Mon, 28 Nov 2022 00:16:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Jkdq03L2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229758AbiK1Hxi (ORCPT + 84 others); Mon, 28 Nov 2022 02:53:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229529AbiK1Hxg (ORCPT ); Mon, 28 Nov 2022 02:53:36 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBFE6C37 for ; Sun, 27 Nov 2022 23:53:35 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id AC3C1B80AF0 for ; Mon, 28 Nov 2022 07:53:34 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CCB8BC433C1; Mon, 28 Nov 2022 07:53:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1669622013; bh=um03zoPpxKsSPE+M2zpAJXsHvH/peut6tDHzA78ZNoM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Jkdq03L2qV0u5uszScn4GnxkJ4wH4lW1f++a+IEgzYsJg5muigr6IoZU5+L2o4XUU EbPVIDsb1DEBMWPOGkAU/p4KGA0byXjOTXP8C/yFqHTVUblSV4zr1LgMi4lXsQ86eZ CXSB8knab1krmTsd5FbaPDmuVIU2Y1kjY/NjfNTk= Date: Mon, 28 Nov 2022 08:53:28 +0100 From: Greg Kroah-Hartman To: Deepak R Varma Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, gustavoars@kernel.org Subject: Re: [PATCH] staging: wlan-ng: Replace zero-length arrays with DECLARE_FLEX_ARRAY() helper Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 28, 2022 at 01:15:43PM +0530, Deepak R Varma wrote: > On Sat, Nov 19, 2022 at 08:08:15PM +0530, Deepak R Varma wrote: > > On Thu, Nov 17, 2022 at 07:03:21PM +0100, Greg Kroah-Hartman wrote: > > > On Thu, Nov 17, 2022 at 06:50:55PM +0530, Deepak R Varma wrote: > > > > On Thu, Nov 17, 2022 at 01:54:49PM +0100, Greg Kroah-Hartman wrote: > > > > > On Thu, Nov 17, 2022 at 03:48:45PM +0530, Deepak R Varma wrote: > > > > > > > > > > > > struct hfa384x_pdr_refdac_measurements { > > > > > > - u16 value[0]; > > > > > > + DECLARE_FLEX_ARRAY(u16, value); > > > > > > } __packed; > > > > > > > > > > Why? This structure is never used anywhere, right? So why is this > > > > > needed to be changed and not just removed entirely? Same for the other > > > > > structures in this patch. > > > > > > > > Hello Greg, > > > > I am unable to confirm that these structures are truly not needed in the absence > > > > if a real device based testing. I could only validate that using the compile > > > > build and driver loading. > > > > > > Think this through, if no one is actually using this structure, and it > > > is of 0 size, then do you think it is being used? > > > > Hello Greg, > > I did not find any memory allocation for these zero length array structures. > > Also, the union or its enclosing structure do not appear to access the members. > > Hence I am leaning towards concluding that these zero length array structures do > > not appear to be necessary. > > > > There are a few other structures that are part of the same union, however, they > > too do not appear to be used for accessing the memory assigned to the union [or > > its enclosing structure]. I think most of the members of these unions can be > > replaced by one max size structure of this union [e.g. struct > > hfa384x_pdr_mkk_measurements]. > > > > Could you please comment if I am reading the code right? > > > > For your quick reference, the zero length structure declaration are online 963 > > whereas the union is on line number 1080 of the file drivers/staging/wlan-ng/hfa384x.h > > Hello Greg, > can you please suggest how should I approach this clean-up/correction? Sorry, but I do not have the bandwidth to help out with this. I will gladly review changes submitted only. greg k-h