Message ID | Y7WYzkIOqaHOxDDS@qemulion |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp5199222wrt; Wed, 4 Jan 2023 07:21:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXt1AOMW5LBiXrMLrLxyILKVHf9o6oX+IyPHxBKNdZ+2JQ6tnmsgB/h/KJJP1gEGPRuRj7BB X-Received: by 2002:a17:902:c10a:b0:188:bc62:276f with SMTP id 10-20020a170902c10a00b00188bc62276fmr50403442pli.3.1672845717946; Wed, 04 Jan 2023 07:21:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672845717; cv=none; d=google.com; s=arc-20160816; b=Me+7OGHejhAQL9LLsODndY1mEK0C4rwhlRq5G3FslYZhzVCjBLwS69QzsgjWf24IxY vDncGrzYJH4hRj53aKz7Mv1MOXb1+r+6v0NVmjyUHKyZ6f2ALSUca1qMTnCt7dR488kO uEaZdgGAGoYpvt75jbiKx2/IZP8Vv9etF6r3ZeuoshgK2+WTQFdILWZ7qmPbTwA4Pk6A B1z4fLhZmdR4gbbon0hBeLan8yYfl0IiU1ScX7277qlUE7kf00tPoWR+GNm8IVqZ7cXH A56cExxNReOHezEZHV3qanlUXhugdyMCeHbxBIUtymEDh3/YeoAmzXZhvC9AWz+YuDLT 9TaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:cc:to:from:date:dkim-signature; bh=dvzpRORGS0LqgPxB27LbAA3EDYWqJhxX8PbY2NX0HdY=; b=bfJuzXJBTicBY2KeRrIYX1hW4Hz51e9NEVZAK4sCoPTzxKethgQRxuJwiLv9Oc56PT Hl/eU6u0KyQODSUf+EYNXe24R2FqHUSVNRUOkz/KAdK8nrEdkvY9CxMFseus468qjDOF nplro3l9RM/1BvSNOn+O/mLAugpwTSlYeurWUgTe9fEZz9oMoSJW7nkT3fFNPPyxtN4c gd1K6yJCJp4WTwqvPorGT5P+xMKnv1rCMO0FT1S/N+sgk51j8h3S0TmHzO7VzzsaQYi2 /UxBhYamUsEFAVEWYAlCyAywQLUbX1ahoigr12fD+3vXWyk/YsuhiMjfmVa1sSNsVitV yhQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mailo.com header.s=mailo header.b=N39HXlk0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c5-20020a170902724500b00192721d6a97si28151719pll.499.2023.01.04.07.21.44; Wed, 04 Jan 2023 07:21:57 -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=fail header.i=@mailo.com header.s=mailo header.b=N39HXlk0; 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=fail (p=NONE sp=NONE dis=NONE) header.from=mailo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239485AbjADPVC (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Wed, 4 Jan 2023 10:21:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239603AbjADPUe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 4 Jan 2023 10:20:34 -0500 Received: from msg-1.mailo.com (msg-1.mailo.com [213.182.54.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C34B41D66 for <linux-kernel@vger.kernel.org>; Wed, 4 Jan 2023 07:19:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=mailo.com; s=mailo; t=1672845524; bh=4WpdPESN9laCQ+0dJmH7VyKj6Z31XLjyfTH0r5nSp8Q=; h=X-EA-Auth:Date:From:To:Cc:Subject:Message-ID:MIME-Version: Content-Type; b=N39HXlk0W+MGAQ5rlz8fsuFhKA54WDmJbAWuLnco2QEA0v6Tab5DUGNbT7qKkXMie aU5t/1sd6JcxZXgFXxZNsPiQcTneG5afojH2hApZrhdHFcpbiTA6ekoPSFYWTi3ldC C06SrGMstJip6vnTTLtM15bXg1PaOh+HnTF86XsE= Received: by b-6.in.mailobj.net [192.168.90.16] with ESMTP via ip-206.mailobj.net [213.182.55.206] Wed, 4 Jan 2023 16:18:44 +0100 (CET) X-EA-Auth: 3o+1Ih6VxbOMPaGorsbD5/WgdCd+p/k8N8ulKnPs8eMqVrMW1/0ry1vYlZ+tKsz7zkpeAryF9JTQ4DZa68X2NjxW1nx+DONI Date: Wed, 4 Jan 2023 20:48:38 +0530 From: Deepak R Varma <drv@mailo.com> To: Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Saurabh Singh Sengar <ssengar@microsoft.com>, Praveen Kumar <kumarpraveen@linux.microsoft.com>, Deepak R Varma <drv@mailo.com> Subject: [PATCH v2] staging: greybus: Replace zero-length array by DECLARE_FLEX_ARRAY() helper Message-ID: <Y7WYzkIOqaHOxDDS@qemulion> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754063589753384108?= X-GMAIL-MSGID: =?utf-8?q?1754105871164489948?= |
Series |
[v2] staging: greybus: Replace zero-length array by DECLARE_FLEX_ARRAY() helper
|
|
Commit Message
Deepak R Varma
Jan. 4, 2023, 3:18 p.m. UTC
The code currently uses C90 standard extension based zero length array struct which is now deprecated and the new C99 standard extension of flexible array declarations are to be used instead. Also, the macro DECLARE_FLEX_ARRAY() allows to use single flexible array member in a structure. Refer to these links [1], [2], and [3] for details. [1] https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html [2] https://lore.kernel.org/lkml/YxKY6O2hmdwNh8r8@work [3] https://lore.kernel.org/lkml/20210827163015.3141722-2-keescook@chromium.org/ Issue identified using Coccinelle flexible_array.cocci semantic patch. Signed-off-by: Deepak R Varma <drv@mailo.com> Reviewed-by: Alex Elder <elder@linaro.org> --- Changes in v2: Following improvements as suggested by Alex Elder <elder@ieee.org> - Include third reference URL in the commit message. - Update 2nd reference URL - Include Reviewed by tag drivers/staging/greybus/usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.34.1
diff --git a/drivers/staging/greybus/usb.c b/drivers/staging/greybus/usb.c index 8e9d9d59a357..b7badf87a3f0 100644 --- a/drivers/staging/greybus/usb.c +++ b/drivers/staging/greybus/usb.c @@ -27,7 +27,7 @@ struct gb_usb_hub_control_request { }; struct gb_usb_hub_control_response { - u8 buf[0]; + DECLARE_FLEX_ARRAY(u8, buf); }; struct gb_usb_device {