driverdev-devel.linuxdriverproject.org archive mirror
 help / color / mirror / Atom feed
From: Muhammad Usama Anjum <musamaanjum@gmail.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	Greg KH <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8192e, rtl8192u: use correct notation to define pointer
Date: Thu, 04 Feb 2021 19:51:42 +0500	[thread overview]
Message-ID: <3d1f36ebd3b59788a586e55bcaaad9705ecca4be.camel@gmail.com> (raw)
In-Reply-To: <20201028044232.qtzsnrrh7xgdzsoc@ltop.local>

> 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



_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

      reply	other threads:[~2021-02-04 14:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26 12:14 [PATCH] staging: rtl8192e, rtl8192u: use correct notation to define pointer Muhammad Usama Anjum
2020-10-27 11:23 ` Greg KH
2020-10-27 13:50   ` Dan Carpenter
2020-10-28  4:42   ` Luc Van Oostenryck
2021-02-04 14:51     ` Muhammad Usama Anjum [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d1f36ebd3b59788a586e55bcaaad9705ecca4be.camel@gmail.com \
    --to=musamaanjum@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).