[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3858062.NGQDOLnTj0@wuerfel>
Date: Tue, 19 Jul 2016 17:53:38 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Jes Sorensen <Jes.Sorensen@...hat.com>
Cc: linux-wireless@...r.kernel.org, Kalle Valo <kvalo@...eaurora.org>,
Larry Finger <Larry.Finger@...inger.net>,
netdev@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Mateusz Kulikowski <mateusz.kulikowski@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] staging/rtl8192e: use s8 instead of char
On Tuesday, July 19, 2016 11:46:04 AM CEST Jes Sorensen wrote:
> > diff --git a/drivers/staging/rtl8192e/rtl819x_TSProc.c b/drivers/staging/rtl8192e/rtl819x_TSProc.c
> > index 2c8a526773ed..e0a2fe5e6148 100644
> > --- a/drivers/staging/rtl8192e/rtl819x_TSProc.c
> > +++ b/drivers/staging/rtl8192e/rtl819x_TSProc.c
> > @@ -323,7 +323,7 @@ bool GetTs(struct rtllib_device *ieee, struct ts_common_info **ppTS,
> > if (ieee->current_network.qos_data.supported == 0) {
> > UP = 0;
> > } else {
> > - if (!IsACValid(TID)) {
> > + if (!IsACValid((s8)TID)) {
> > netdev_warn(ieee->dev, "%s(): TID(%d) is not valid\n",
> > __func__, TID);
> > return false;
>
> TID is a 4-bit field, it should never go negative. The cast to s8 seems
> wrong to me, if anything it should be using u8. I do realize the macro
> IsACValid checks against negative too, but that just looks silly to me.
Ok, I'll remove the extra comparison then to avoid the warning:
staging/rtl8192e/rtl819x_TSProc.c:326:14: error: comparison is always true due to limited range of data type [-Werror=type-limits]
I guess it should be a separate patch. I had just stumbled over the
same thing before resending the patch but decided not to change it
to keep the patch simple.
Arnd
Powered by blists - more mailing lists