[lkml]   [2021]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [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.


 \ /
  Last update: 2021-02-04 20:34    [W:0.123 / U:4.788 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site