[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3d1f36ebd3b59788a586e55bcaaad9705ecca4be.camel@gmail.com>
Date: Thu, 04 Feb 2021 19:51:42 +0500
From: Muhammad Usama Anjum <musamaanjum@...il.com>
To: Luc Van Oostenryck <luc.vanoostenryck@...il.com>,
Greg KH <gregkh@...uxfoundation.org>
Cc: devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtl8192e, rtl8192u: use correct notation to
define pointer
> Sparse's warning is not about changing the definition of this member
> as if it was the argument of a function. It's about how can you use
> an array of structure when this structure has a flexible member.
We have the following structures in drivers/staging/rtl8192e. (I've
simplified them for showing here.)
struct rtllib_hdr_3addr {
int a;
int payload[];
};
struct rtllib_info_element {
int len;
int data[];
};
struct rtllib_probe_request {
struct rtllib_hdr_3addr header;
struct rtllib_info_element info_element[];
};
static void func(struct rtllib_probe_request *ptr) {
ptr->header.a = 1;
}
Running sparse gives:
sparse -Wflexible-array-array flexible_array.c
flexible_array.c:13:48: warning: array of flexible structures
There are several such structures in rtl8192e and rtl8192u. I've been
trying to fix one of them. But it seems like more knowledge is
required to refactor the driver.
Thanks,
Usama
Powered by blists - more mailing lists