From: Michael Buesch <mb@bu3sch.de>
To: Pavel Roskin <proski@gnu.org>
Cc: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless@vger.kernel.org,
"John W. Linville" <linville@tuxdriver.com>
Subject: Re: [PATCH] d80211: fix sparse warnings
Date: Tue, 27 Feb 2007 16:40:21 +0100 [thread overview]
Message-ID: <200702271640.21252.mb@bu3sch.de> (raw)
In-Reply-To: <1172539109.5835.28.camel@dv>
On Tuesday 27 February 2007 02:18, Pavel Roskin wrote:
> On Mon, 2007-02-26 at 23:59 +0100, Johannes Berg wrote:
> > This fixes some sparse warnings in d80211.
> >
> > Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
> >
> > ---
> > A few warnings remain:
> >
> > net/d80211/ieee80211.c:820:37: warning: potentially expensive pointer subtraction
>
> That's subtraction of pointers to types with sizes that are not power of
> two. This could lead to expensive division operations. In may cases,
> this warning indicates that using array indices instead of pointers
> would be more effective (and probably safer).
Uh, well.
I think it's this line, no?
control->rts_rateidx = (int)(rate - tx->local->curr_rates);
The problem there is, we have a pointer into an array and we
need to get the index number into that array.
Any better way to get an index by a pointer and a basepointer?
--
Greetings Michael.
next prev parent reply other threads:[~2007-02-27 15:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-26 22:59 [PATCH] d80211: fix sparse warnings Johannes Berg
2007-02-27 1:18 ` Pavel Roskin
2007-02-27 7:16 ` Pavel Roskin
2007-02-27 8:28 ` Johannes Berg
2007-02-27 15:40 ` Michael Buesch [this message]
2007-02-27 15:45 ` Michael Wu
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=200702271640.21252.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=proski@gnu.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.