Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3109729rwo; Thu, 3 Aug 2023 22:36:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEqMtlYqwbt6dQKTNAYlxZae/4C82bFwq+3UFdr1ckYJGsp32uv+8ilOeVdC+PSMN8cVrVR X-Received: by 2002:a17:906:2250:b0:994:3207:cde3 with SMTP id 16-20020a170906225000b009943207cde3mr741939ejr.49.1691127369850; Thu, 03 Aug 2023 22:36:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691127369; cv=none; d=google.com; s=arc-20160816; b=MGn8st15g54ZVauv+N/N2iiTpPM5dvNex8s9JupVMO8xyva70jqHov9TCepsnnbOOn WEl3n3JjX0qGi0V5kxGOZ+5YM/far2fq8s7RWB22zhM/o4GSfXaVBEh2mGIhU340Wisl amA6WuRG85j1KUCrXbqG6sfQRFtjO90TY/yHvuMxXY62Jik3VrehWq1P3VulIM7pGPrR /cJGqP9biKDA54ylHLcLFjhHH6otvodnX37WWJ8Gpc33WCtTQkmM1xvwg9TgncZr7nV8 kIBxpMQJb2joHVPF0WORdoO/SVl5hO3d2xGMYlU1whiyWShHwAVoOqSNbRJK7EH9PIVc LHVw== 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=ZWi+NNootGR2qv9Z7EPDeVucoNfop9v8dbMYYRxQ89I=; fh=dD4cGU5sRzzsn2iG6wOihjBNBAM0T01LF9dJj7+j9oY=; b=okXI5jPX78CH8Jvnhyo4KA7G9/hf7tmEIpYOsl+EeDNnFJda8XEs/d8gpIV4YotJo6 TSkg6R5SCvyZ00UU8yOrl27eO6snC8dHni+EcyfUJ23StaIDv1l9Hl3BtYhDefqQaUjI KSnclmpNgmO8aCKErit2cEo5QloxjxZrp6zeEbaGBqMy+yejuzrhdHP3IbsvFKw0RQtu QLoSKiH5oBRpHnJNEoiiL0xkB/lntR4zU24+q2sKSw8e/RYpR2wHAX49UxqXevU/8ssp gDsSZp5KKo3bvM63yCkU7/Gj0CfPLSpNk7OhA73VvR5HeHrniAKS6NmAzARqt3jXM5vy 3Gew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=RFNvgdxK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 w8-20020a1709060a0800b0099b6a172f27si1113300ejf.611.2023.08.03.22.35.50; Thu, 03 Aug 2023 22:36:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=RFNvgdxK; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-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 S233461AbjHDFUW (ORCPT + 58 others); Fri, 4 Aug 2023 01:20:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231128AbjHDFSu (ORCPT ); Fri, 4 Aug 2023 01:18:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 388525277; Thu, 3 Aug 2023 22:15:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9168061F39; Fri, 4 Aug 2023 05:15:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6D3B8C433C8; Fri, 4 Aug 2023 05:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1691126146; bh=USmLM7XlRgBQi58d1O7rkZwpAoU1QZU1TYBFKp261ss=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=RFNvgdxKrimI8wHa+gINMl4wknnhcFE7xlFV+zDo9HVifudBf+5/8Xl3YKW289F7+ xM/BMTI7P8TClWhZ+M+fiP3p7tXyaHTNbj97ayBPNOwNKFRO6ADdRlknO1gTT+076m J9fVXeGFEOG2aKGoBK9cyEDVflbGM+mrzeLshpUc= Date: Fri, 4 Aug 2023 07:15:43 +0200 From: Greg KH To: Atul Raut Cc: kvalo@kernel.org, linux-kernel-mentees@lists.linuxfoundation.org, linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] ath6kl: replace one-element array with flexible-array member Message-ID: <2023080433-patio-staining-2cfe@gregkh> References: <20230804045554.6934-1-rauji.raut@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230804045554.6934-1-rauji.raut@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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-wireless@vger.kernel.org On Thu, Aug 03, 2023 at 09:55:54PM -0700, Atul Raut wrote: > One-element arrays are no longer relevant, and their > place has been taken by flexible array members thus, > use a flexible-array member to replace the one-element > array in struct ath6kl_usb_ctrl_diag_cmd_write > > This fixes warnings such as: > ./drivers/net/wireless/ath/ath6kl/usb.c:109:8-12: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) > > Signed-off-by: Atul Raut > --- > drivers/net/wireless/ath/ath6kl/usb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/ath/ath6kl/usb.c b/drivers/net/wireless/ath/ath6kl/usb.c > index 5220809841a6..c8ecc9e85897 100644 > --- a/drivers/net/wireless/ath/ath6kl/usb.c > +++ b/drivers/net/wireless/ath/ath6kl/usb.c > @@ -106,7 +106,7 @@ struct ath6kl_usb_ctrl_diag_cmd_write { > __le32 cmd; > __le32 address; > __le32 value; > - __le32 _pad[1]; > + __le32 _pad[]; Are you sure this is actually a variable length array? And you just changed the size of this structure, are you sure this is correct? There have been lots of work on this type of thing in the past on the hardening mailing list, I suggest you work there with the developers to see if this is even a valid change first. thanks, greg k-h