From: "Fabio M. De Francesco" <fmdefrancesco@gmail.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: rtl8188eu: Remove an unused variable and some lines of code
Date: Fri, 02 Jul 2021 14:14:45 +0200 [thread overview]
Message-ID: <2153683.Tj7f0gbxMR@linux.local> (raw)
In-Reply-To: <20210702083521.GV2040@kadam>
On Friday, July 2, 2021 10:35:21 AM CEST Dan Carpenter wrote:
> On Fri, Jul 02, 2021 at 10:48:40AM +0300, Dan Carpenter wrote:
> > On Thu, Jul 01, 2021 at 04:47:07PM +0200, Fabio M. De Francesco wrote:
> > > Remove set but unused iw_operation_mode[]. Remove all the lines of
> > > code from the function rtw_wx_set_rate, except the "return 0;" line
> > > to not break userland code that somewhat uses this IOCTL.
> > >
> > > Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> > > [...]
> >
Dear Dan,
> > Just delete this whole file. It doesn't do anything now.
>
> Sorry, I meant function, not file. *chortle*. :P
No worries, it is clear it was unintended.
Back to the function... As you may suspect :-) I know practically nothing
neither of Linux device drivers or of whatever else kernel, so I take your
words for good. ASAP, I'll send a v2 of this patch.
However, I usually like to understand what I make (just for fun and... more).
That rtw_wx_set_rate() is the implementation of the SIOCSIWRATE IOCTL command.
I hope that I have not misunderstood it, have I?
However, we know that this function does practically nothing and then simply
returns 0 to the user. That's exactly the reason why I deleted all its lines
(except one).
If I am a user of that command I get a "success" return code (0) and I don't
notice that it won't be able to set the bit rate. However everything should
still keep running (I suppose using the default bit rate of the hardware; who
really knows?).
Now it's time for two questions:
1) what happens if that command is used by some users that (hopelessly) expect
the function to set the bit rate? I mean: if the function is not anymore in
the list of the IOCTL commands of the rtw_handlers array will still the user
program compile, link, and don't crash at runtime?
2) how should I delete the association of SIOCSIWRATE with rtw_wx_set_rate()
in the rtw_handlers array?
- delete the entry and shift the array one position up?
- set the SIOCSIWRATE entry to NULL?
Regards,
Fabio
>
> regards,
> dan carpenter
next prev parent reply other threads:[~2021-07-02 12:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-01 14:47 [PATCH] staging: rtl8188eu: Remove an unused variable and some lines of code Fabio M. De Francesco
2021-07-02 7:48 ` Dan Carpenter
2021-07-02 8:35 ` Dan Carpenter
2021-07-02 12:14 ` Fabio M. De Francesco [this message]
2021-07-02 12:42 ` Dan Carpenter
2021-07-02 12:46 ` Dan Carpenter
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=2153683.Tj7f0gbxMR@linux.local \
--to=fmdefrancesco@gmail.com \
--cc=Larry.Finger@lwfinger.net \
--cc=dan.carpenter@oracle.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
/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.