From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C647C55178 for ; Tue, 27 Oct 2020 11:22:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAE2122265 for ; Tue, 27 Oct 2020 11:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603797732; bh=keEF1atJGqkxzQS1pRxnbXeyCt012WhNm5pF5TvhsVU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=qnIwM18sFJXWDtS8BPWwpHS6wwM5d3Jhz9TmraDUdN0cqfaOCMqTHKWgEs1NUPw0x UFLg6D/MMNORV2u/bqxwqrVvwdiqW5TrQ7twRnB6bpPpzOVLLKwWXJ+yapUmTfUsOk Gnx7YqGH7UEPEbOPPo3ij8skviap+2g+VijPz03Q= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422266AbgJ0LWL (ORCPT ); Tue, 27 Oct 2020 07:22:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:42318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438680AbgJ0LWK (ORCPT ); Tue, 27 Oct 2020 07:22:10 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9138C22265; Tue, 27 Oct 2020 11:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603797729; bh=keEF1atJGqkxzQS1pRxnbXeyCt012WhNm5pF5TvhsVU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k+8yTyTgSvrWzQJlBd4p2EelGPxG9SlppibKiPGf6j/gWtX4+MfWH0kodO5S5XxLx 2odmoek3kRu/Qqji/Bflm3Iv32yM5x5UH8YtmQJeS3Ij0bFzJ16VJu95sMnNAgCevX CsIBWe4uUjVBCO0yAP+BmR1uIqtiycAO5pox8yKA= Date: Tue, 27 Oct 2020 12:23:03 +0100 From: Greg KH To: Muhammad Usama Anjum Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: rtl8192e, rtl8192u: use correct notation to define pointer Message-ID: <20201027112303.GA405023@kroah.com> References: <20201026121435.GA782465@LEGION> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201026121435.GA782465@LEGION> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2020 at 05:14:35PM +0500, Muhammad Usama Anjum wrote: > Use pointer notation instead of using array notation as info_element is > a pointer not array. > > Warnings from sparse: > drivers/staging/rtl8192u/ieee80211/ieee80211.h:1013:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:985:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:963:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:996:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:974:51: warning: array of flexible structures > > drivers/staging/rtl8192e/rtllib.h:832:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:851:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:805:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:843:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:821:48: warning: array of flexible structures > > Signed-off-by: Muhammad Usama Anjum > --- > drivers/staging/rtl8192e/rtllib.h | 10 +++++----- > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 12 ++++++------ > 2 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h > index b84f00b8d18b..1dab9c3d08a8 100644 > --- a/drivers/staging/rtl8192e/rtllib.h > +++ b/drivers/staging/rtl8192e/rtllib.h > @@ -802,7 +802,7 @@ struct rtllib_authentication { > __le16 transaction; > __le16 status; > /*challenge*/ > - struct rtllib_info_element info_element[]; > + struct rtllib_info_element *info_element; > } __packed; Are you sure these changes are correct? This isn't just a list of structures after this at the end of the structure? Please look at commit 5979afa2c4d1 ("staging: Replace zero-length array with flexible-array member") which made most of these flexible arrays. This is not a pointer, it really is an array, I think sparse is really wrong here, be careful. thanks, greg k-h From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=BAYES_20,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0BAFC388F9 for ; Tue, 27 Oct 2020 11:22:13 +0000 (UTC) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 13C1C22281 for ; Tue, 27 Oct 2020 11:22:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="k+8yTyTg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13C1C22281 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=driverdev-devel-bounces@linuxdriverproject.org Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7990F86697; Tue, 27 Oct 2020 11:22:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GZnOQsPINpeJ; Tue, 27 Oct 2020 11:22:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A659586684; Tue, 27 Oct 2020 11:22:11 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 3B28E1BF859 for ; Tue, 27 Oct 2020 11:22:10 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 37B2F84EE2 for ; Tue, 27 Oct 2020 11:22:10 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 97Q5HSu8jfwe for ; Tue, 27 Oct 2020 11:22:09 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by fraxinus.osuosl.org (Postfix) with ESMTPS id B040384E7A for ; Tue, 27 Oct 2020 11:22:09 +0000 (UTC) Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9138C22265; Tue, 27 Oct 2020 11:22:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603797729; bh=keEF1atJGqkxzQS1pRxnbXeyCt012WhNm5pF5TvhsVU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k+8yTyTgSvrWzQJlBd4p2EelGPxG9SlppibKiPGf6j/gWtX4+MfWH0kodO5S5XxLx 2odmoek3kRu/Qqji/Bflm3Iv32yM5x5UH8YtmQJeS3Ij0bFzJ16VJu95sMnNAgCevX CsIBWe4uUjVBCO0yAP+BmR1uIqtiycAO5pox8yKA= Date: Tue, 27 Oct 2020 12:23:03 +0100 From: Greg KH To: Muhammad Usama Anjum Subject: Re: [PATCH] staging: rtl8192e, rtl8192u: use correct notation to define pointer Message-ID: <20201027112303.GA405023@kroah.com> References: <20201026121435.GA782465@LEGION> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201026121435.GA782465@LEGION> X-BeenThere: driverdev-devel@linuxdriverproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" On Mon, Oct 26, 2020 at 05:14:35PM +0500, Muhammad Usama Anjum wrote: > Use pointer notation instead of using array notation as info_element is > a pointer not array. > > Warnings from sparse: > drivers/staging/rtl8192u/ieee80211/ieee80211.h:1013:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:985:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:963:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:996:51: warning: array of flexible structures > drivers/staging/rtl8192u/ieee80211/ieee80211.h:974:51: warning: array of flexible structures > > drivers/staging/rtl8192e/rtllib.h:832:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:851:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:805:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:843:48: warning: array of flexible structures > drivers/staging/rtl8192e/rtllib.h:821:48: warning: array of flexible structures > > Signed-off-by: Muhammad Usama Anjum > --- > drivers/staging/rtl8192e/rtllib.h | 10 +++++----- > drivers/staging/rtl8192u/ieee80211/ieee80211.h | 12 ++++++------ > 2 files changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/staging/rtl8192e/rtllib.h b/drivers/staging/rtl8192e/rtllib.h > index b84f00b8d18b..1dab9c3d08a8 100644 > --- a/drivers/staging/rtl8192e/rtllib.h > +++ b/drivers/staging/rtl8192e/rtllib.h > @@ -802,7 +802,7 @@ struct rtllib_authentication { > __le16 transaction; > __le16 status; > /*challenge*/ > - struct rtllib_info_element info_element[]; > + struct rtllib_info_element *info_element; > } __packed; Are you sure these changes are correct? This isn't just a list of structures after this at the end of the structure? Please look at commit 5979afa2c4d1 ("staging: Replace zero-length array with flexible-array member") which made most of these flexible arrays. This is not a pointer, it really is an array, I think sparse is really wrong here, be careful. thanks, greg k-h _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel