* Sparse warnings
@ 2008-06-27 19:52 Larry Finger
2008-06-27 19:53 ` Pavel Roskin
0 siblings, 1 reply; 14+ messages in thread
From: Larry Finger @ 2008-06-27 19:52 UTC (permalink / raw)
To: wireless, Jouni Malinen
While checking the rtl8187 driver for sparse warnings, I discovered these:
CHECK drivers/net/wireless/hostap/hostap_80211_rx.c
drivers/net/wireless/hostap/hostap_80211_rx.c:128:34: warning: symbol
'hdr' shadows an earlier one
drivers/net/wireless/hostap/hostap_80211_rx.c:67:29: originally
declared here
drivers/net/wireless/hostap/hostap_80211_rx.c:150:32: warning: symbol
'hdr' shadows an earlier one
drivers/net/wireless/hostap/hostap_80211_rx.c:67:29: originally
declared here
CHECK drivers/net/wireless/hostap/hostap_ap.c
drivers/net/wireless/hostap/hostap_ap.c:1933:18: warning: cast
truncates bits from constant value (ffffffffffff3fff becomes 3fff)
CHECK drivers/net/wireless/hostap/hostap_main.c
drivers/net/wireless/hostap/hostap_main.c:597:5: warning: symbol
'hostap_80211_header_parse' was not declared. Should it be static?
Obviously, none of these cause any problems, but I'm reporting them
just in case.
Larry
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: Sparse warnings
2008-06-27 19:52 Sparse warnings Larry Finger
@ 2008-06-27 19:53 ` Pavel Roskin
0 siblings, 0 replies; 14+ messages in thread
From: Pavel Roskin @ 2008-06-27 19:53 UTC (permalink / raw)
To: Larry Finger; +Cc: wireless, Jouni Malinen
On Fri, 2008-06-27 at 14:52 -0500, Larry Finger wrote:
> While checking the rtl8187 driver for sparse warnings, I discovered these:
>
> CHECK drivers/net/wireless/hostap/hostap_80211_rx.c
Larry, I'm sitting on a fix for that. Joini was unhappy about some
radiotap changes, and I didn't have time to revisit it. Give me two
hours, I'll send the uncontroversial parts.
--
Regards,
Pavel Roskin
^ permalink raw reply [flat|nested] 14+ messages in thread
* sparse warnings
@ 2008-09-11 10:46 Johannes Berg
0 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2008-09-11 10:46 UTC (permalink / raw)
To: linux-wireless
Cc: Michael Buesch, Chr, Daniel Drake, Luis R. Rodriguez,
Sujith Manoharan, Tomas Winkler
Please fix at your leisure:
drivers/net/wireless/ath9k/hw.c:4773:17: warning: symbol 'tmp' shadows an earlier one
drivers/net/wireless/ath9k/hw.c:4636:6: originally declared here
drivers/net/wireless/ath9k/hw.c:4975:17: warning: symbol 'tmp' shadows an earlier one
drivers/net/wireless/ath9k/hw.c:4885:6: originally declared here
drivers/net/wireless/ath9k/main.c:1557:28: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/ath9k/main.c:1557:28: expected restricted pci_power_t [usertype] state
drivers/net/wireless/ath9k/main.c:1557:28: got int
drivers/net/wireless/iwlwifi/iwl3945-base.c:4886:18: warning: invalid assignment: |=
drivers/net/wireless/iwlwifi/iwl3945-base.c:4886:18: left side has type unsigned char
drivers/net/wireless/iwlwifi/iwl3945-base.c:4886:18: right side has type restricted __le32
[and some more I have ignored because they seem to be bogus]
drivers/net/wireless/b43/phy_g.c:57:10: warning: symbol 'b43_radio_channel_codes_bg' was not declared. Should it be static?
drivers/net/wireless/b43/phy_g.c:218:6: warning: symbol 'b43_set_txpower_g' was not declared. Should it be static?
drivers/net/wireless/b43/phy_g.c:386:6: warning: symbol 'b43_nrssi_hw_write' was not declared. Should it be static?
drivers/net/wireless/b43/phy_g.c:393:5: warning: symbol 'b43_nrssi_hw_read' was not declared. Should it be static?
drivers/net/wireless/b43/phy_g.c:404:6: warning: symbol 'b43_nrssi_hw_update' was not declared. Should it be static?
drivers/net/wireless/b43/phy_g.c:418:6: warning: symbol 'b43_nrssi_mem_update' was not declared. Should it be static?
drivers/net/wireless/b43/phy_g.c:592:6: warning: symbol 'b43_calc_nrssi_slope' was not declared. Should it be static?
drivers/net/wireless/b43/phy_g.c:1357:5: warning: symbol 'b43_radio_init2050' was not declared. Should it be static?
drivers/net/wireless/b43/phy_a.c:80:6: warning: symbol 'b43_radio_set_tx_iq' was not declared. Should it be static?
drivers/net/wireless/b43/phy_a.c:150:6: warning: symbol 'b43_radio_init2060' was not declared. Should it be static?
drivers/net/wireless/b43/phy_n.c:33:6: warning: symbol 'b43_nphy_set_rxantenna' was not declared. Should it be static?
drivers/net/wireless/b43/phy_n.c:188:6: warning: symbol 'b43_nphy_radio_turn_on' was not declared. Should it be static?
drivers/net/wireless/b43/phy_n.c:193:6: warning: symbol 'b43_nphy_radio_turn_off' was not declared. Should it be static?
drivers/net/wireless/b43/phy_n.c:419:5: warning: symbol 'b43_phy_initn' was not declared. Should it be static?
drivers/net/wireless/p54/p54common.c:152:38: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/p54/p54common.c:152:38: expected restricted __be32 const [usertype] *p
drivers/net/wireless/p54/p54common.c:152:38: got unsigned int *<noident>
drivers/net/wireless/p54/p54common.c:184:15: warning: restricted __le32 degrades to integer
drivers/net/wireless/p54/p54common.c:185:29: warning: cast to restricted __le16
drivers/net/wireless/p54/p54common.c:185:29: warning: cast to restricted __le16
drivers/net/wireless/p54/p54common.c:185:29: warning: cast to restricted __le16
drivers/net/wireless/p54/p54common.c:185:29: warning: cast to restricted __le16
drivers/net/wireless/p54/p54common.c:309:11: warning: symbol 'p54_rf_chips' was not declared. Should it be static?
drivers/net/wireless/p54/p54common.c:313:5: warning: symbol 'p54_parse_eeprom' was not declared. Should it be static?
drivers/net/wireless/p54/p54common.c:620:43: warning: incorrect type in argument 3 (different base types)
drivers/net/wireless/p54/p54common.c:620:43: expected unsigned int [unsigned] [usertype] <noident>
drivers/net/wireless/p54/p54common.c:620:43: got restricted __le16 [usertype] len
drivers/net/wireless/p54/p54common.c:780:41: warning: restricted __le16 degrades to integer
drivers/net/wireless/p54/p54common.c:781:32: warning: restricted __le16 degrades to integer
drivers/net/wireless/p54/p54common.c:1250:28: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/p54/p54common.c:1250:28: expected unsigned short [unsigned] [usertype] filter_type
drivers/net/wireless/p54/p54common.c:1250:28: got restricted __le16 [usertype] filter_type
drivers/net/wireless/p54/p54common.c:1252:28: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/p54/p54common.c:1252:28: expected unsigned short [unsigned] [usertype] filter_type
drivers/net/wireless/p54/p54common.c:1252:28: got restricted __le16 [usertype] filter_type
drivers/net/wireless/p54/p54common.c:1257:42: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/p54/p54common.c:1257:42: expected unsigned short [unsigned] [usertype] filter_type
drivers/net/wireless/p54/p54common.c:1257:42: got restricted __le16
drivers/net/wireless/p54/p54common.c:1260:42: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/p54/p54common.c:1260:42: expected unsigned short [unsigned] [usertype] filter_type
drivers/net/wireless/p54/p54common.c:1260:42: got restricted __le16
drivers/net/wireless/p54/p54usb.c:228:10: warning: restricted __le32 degrades to integer
drivers/net/wireless/p54/p54usb.c:228:23: warning: restricted __le32 degrades to integer
drivers/net/wireless/p54/p54usb.c:228:7: warning: incorrect type in assignment (different base types)
drivers/net/wireless/p54/p54usb.c:228:7: expected restricted __le32 [assigned] [usertype] chk
drivers/net/wireless/p54/p54usb.c:228:7: got unsigned int
drivers/net/wireless/p54/p54usb.c:221:8: warning: symbol 'p54u_lm87_chksum' was not declared. Should it be static?
drivers/net/wireless/zd1211rw/zd_mac.c:756:6: warning: symbol 'zd_process_intr' was not declared. Should it be static?
drivers/net/wireless/zd1211rw/zd_usb.c:358:17: warning: implicit cast from nocast type
drivers/net/wireless/zd1211rw/zd_usb.c:358:17: warning: implicit cast from nocast type
johannes
^ permalink raw reply [flat|nested] 14+ messages in thread
* sparse warnings
@ 2008-10-28 15:57 Johannes Berg
2008-10-29 8:06 ` Holger Schurig
0 siblings, 1 reply; 14+ messages in thread
From: Johannes Berg @ 2008-10-28 15:57 UTC (permalink / raw)
To: linux-wireless
Cc: Tomas Winkler, Dan Williams, Daniel Drake, Luis R. Rodriguez
[-- Attachment #1: Type: text/plain, Size: 1373 bytes --]
These look like bugs:
drivers/net/wireless/iwlwifi/iwl3945-base.c:4848:18: warning: invalid assignment: |=
drivers/net/wireless/iwlwifi/iwl3945-base.c:4848:18: left side has type unsigned char
drivers/net/wireless/iwlwifi/iwl3945-base.c:4848:18: right side has type restricted __le32
drivers/net/wireless/libertas/cmd.c:609:16: warning: cast to restricted __le16
drivers/net/wireless/libertas/cmd.c:611:16: warning: cast to restricted __le16
These seem harmless:
drivers/net/wireless/zd1211rw/zd_usb.c:359:17: warning: implicit cast from nocast type
drivers/net/wireless/ath9k/main.c:1836:28: warning: incorrect type in argument 2 (different base types)
drivers/net/wireless/ath9k/main.c:1836:28: expected restricted pci_power_t [usertype] state
drivers/net/wireless/ath9k/main.c:1836:28: got int
drivers/net/wireless/ath9k/hw.c: In function ‘ath9k_hw_eeprom_set_board_values’:
drivers/net/wireless/ath9k/hw.c:544: warning: ‘ant_config’ may be used uninitialized in this function
drivers/net/wireless/ath9k/hw.c:4818:17: warning: symbol 'tmp' shadows an earlier one
drivers/net/wireless/ath9k/hw.c:4681:6: originally declared here
drivers/net/wireless/ath9k/hw.c:5020:17: warning: symbol 'tmp' shadows an earlier one
drivers/net/wireless/ath9k/hw.c:4930:6: originally declared here
[and a whole bunch in b43]
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: sparse warnings
2008-10-28 15:57 Johannes Berg
@ 2008-10-29 8:06 ` Holger Schurig
0 siblings, 0 replies; 14+ messages in thread
From: Holger Schurig @ 2008-10-29 8:06 UTC (permalink / raw)
To: linux-wireless
Cc: Johannes Berg, Tomas Winkler, Dan Williams, Daniel Drake,
Luis R. Rodriguez
> drivers/net/wireless/libertas/cmd.c:609:16: warning: cast to
> restricted __le16
> drivers/net/wireless/libertas/cmd.c:611:16:
> warning: cast to restricted __le16
Yeah, this seems like a bug. In the cmd struct, it's defined as
s8, so there is no need to use leXX_to_cpu() on it:
struct cmd_ds_802_11_rf_tx_power {
struct cmd_header hdr;
__le16 action;
__le16 curlevel;
s8 maxlevel;
s8 minlevel;
};
^ permalink raw reply [flat|nested] 14+ messages in thread
* sparse warnings
@ 2010-11-15 14:20 Belisko Marek
2010-11-17 9:11 ` Sascha Hauer
0 siblings, 1 reply; 14+ messages in thread
From: Belisko Marek @ 2010-11-15 14:20 UTC (permalink / raw)
To: barebox
Hi,
barebox compilation with C=1 produce a lot of sparse warnings.
Mainly concerning __iomem problems with readb() and similar functions.
Make it sense to take care or just could be omitted?
thanks,
marek
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: sparse warnings
2010-11-15 14:20 Belisko Marek
@ 2010-11-17 9:11 ` Sascha Hauer
2010-11-18 9:36 ` Belisko Marek
0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2010-11-17 9:11 UTC (permalink / raw)
To: Belisko Marek; +Cc: barebox
Hi Marek,
On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
> Hi,
>
> barebox compilation with C=1 produce a lot of sparse warnings.
> Mainly concerning __iomem problems with readb() and similar functions.
>
> Make it sense to take care or just could be omitted?
I think it makes sense to work on this. Then we can see the useful
warnings buried under the __iomem warnings.
I had the idea of adding a
#define IOMEM(addr) ((void __force __iomem *)(addr))
and use it where appropriate.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: sparse warnings
2010-11-17 9:11 ` Sascha Hauer
@ 2010-11-18 9:36 ` Belisko Marek
2010-11-18 10:01 ` Sascha Hauer
0 siblings, 1 reply; 14+ messages in thread
From: Belisko Marek @ 2010-11-18 9:36 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
Hi,
On Wed, Nov 17, 2010 at 10:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> Hi Marek,
>
> On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
>> Hi,
>>
>> barebox compilation with C=1 produce a lot of sparse warnings.
>> Mainly concerning __iomem problems with readb() and similar functions.
>>
>> Make it sense to take care or just could be omitted?
>
> I think it makes sense to work on this. Then we can see the useful
> warnings buried under the __iomem warnings.
>
> I had the idea of adding a
>
> #define IOMEM(addr) ((void __force __iomem *)(addr))
>
> and use it where appropriate.
Maybe stupid question but couldn't be __iomem mechanism removed completely?
Do we need to check for different address_space? In my opinion it
makes no sense in
barebox.
>
> Sascha
>
> --
> Pengutronix e.K. | |
> Industrial Linux Solutions | http://www.pengutronix.de/ |
> Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
> Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
>
thanks,
marek
--
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer
Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
icq: 290551086
web: http://open-nandra.com
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: sparse warnings
2010-11-18 9:36 ` Belisko Marek
@ 2010-11-18 10:01 ` Sascha Hauer
2010-11-18 10:22 ` Uwe Kleine-König
0 siblings, 1 reply; 14+ messages in thread
From: Sascha Hauer @ 2010-11-18 10:01 UTC (permalink / raw)
To: Belisko Marek; +Cc: barebox
On Thu, Nov 18, 2010 at 10:36:51AM +0100, Belisko Marek wrote:
> Hi,
>
> On Wed, Nov 17, 2010 at 10:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > Hi Marek,
> >
> > On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
> >> Hi,
> >>
> >> barebox compilation with C=1 produce a lot of sparse warnings.
> >> Mainly concerning __iomem problems with readb() and similar functions.
> >>
> >> Make it sense to take care or just could be omitted?
> >
> > I think it makes sense to work on this. Then we can see the useful
> > warnings buried under the __iomem warnings.
> >
> > I had the idea of adding a
> >
> > #define IOMEM(addr) ((void __force __iomem *)(addr))
> >
> > and use it where appropriate.
> Maybe stupid question but couldn't be __iomem mechanism removed completely?
> Do we need to check for different address_space? In my opinion it
> makes no sense in
> barebox.
I have a better feeling letting it in. There may be no different address
spaces on Arm, but there are for exmample on x86.
You can simply do a #define __iomem in include/linux/compiler.h to
silence these kinds of warnings temporarily if you are not interested.
I agree that at least on Arm these warnings will not reveal any real
bugs.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: sparse warnings
2010-11-18 10:01 ` Sascha Hauer
@ 2010-11-18 10:22 ` Uwe Kleine-König
0 siblings, 0 replies; 14+ messages in thread
From: Uwe Kleine-König @ 2010-11-18 10:22 UTC (permalink / raw)
To: Sascha Hauer; +Cc: barebox
On Thu, Nov 18, 2010 at 11:01:33AM +0100, Sascha Hauer wrote:
> On Thu, Nov 18, 2010 at 10:36:51AM +0100, Belisko Marek wrote:
> > Hi,
> >
> > On Wed, Nov 17, 2010 at 10:11 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > > Hi Marek,
> > >
> > > On Mon, Nov 15, 2010 at 03:20:47PM +0100, Belisko Marek wrote:
> > >> Hi,
> > >>
> > >> barebox compilation with C=1 produce a lot of sparse warnings.
> > >> Mainly concerning __iomem problems with readb() and similar functions.
> > >>
> > >> Make it sense to take care or just could be omitted?
> > >
> > > I think it makes sense to work on this. Then we can see the useful
> > > warnings buried under the __iomem warnings.
> > >
> > > I had the idea of adding a
> > >
> > > #define IOMEM(addr) ((void __force __iomem *)(addr))
> > >
> > > and use it where appropriate.
> > Maybe stupid question but couldn't be __iomem mechanism removed completely?
> > Do we need to check for different address_space? In my opinion it
> > makes no sense in
> > barebox.
>
> I have a better feeling letting it in. There may be no different address
> spaces on Arm, but there are for exmample on x86.
> You can simply do a #define __iomem in include/linux/compiler.h to
> silence these kinds of warnings temporarily if you are not interested.
> I agree that at least on Arm these warnings will not reveal any real
> bugs.
I can imagine you to get hard to find bugs if you interpret a pointer to
registers as normal pointer without volatile. Something like:
unsigned long *register = 0xabcdef04;
while (*register & SOME_FLAG)
/* nothing */
This might generate code that corresponds to
if (*register & SOME_FLAG)
while(1);
So I feel for letting it in, too.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 14+ messages in thread
* sparse warnings
@ 2020-07-29 19:48 Bjorn Helgaas
2020-09-30 22:39 ` Bjorn Helgaas
0 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2020-07-29 19:48 UTC (permalink / raw)
To: Jingoo Han, Gustavo Pimentel, Kishon Vijay Abraham I; +Cc: linux-pci
Just FYI, I see the following sparse warnings (among others):
$ make C=2 drivers/pci/
drivers/pci/endpoint/functions/pci-epf-test.c:288:24: warning: incorrect type in argument 1 (different address spaces)
drivers/pci/endpoint/functions/pci-epf-test.c:288:24: expected void *to
drivers/pci/endpoint/functions/pci-epf-test.c:288:24: got void [noderef] <asn:2> *[assigned] dst_addr
drivers/pci/endpoint/functions/pci-epf-test.c:288:34: warning: incorrect type in argument 2 (different address spaces)
drivers/pci/endpoint/functions/pci-epf-test.c:288:34: expected void const *from
drivers/pci/endpoint/functions/pci-epf-test.c:288:34: got void [noderef] <asn:2> *[assigned] src_addr
drivers/pci/controller/dwc/pcie-designware.c:447:52: warning: cast truncates bits from constant value (ffffffff7fffffff becomes 7fffffff)
It'd be nice to fix these if it's practical.
There are a bunch more sparse warnings about pci_power_t in the
generic code. Not sure what those would involve, so they're a problem
for another day.
Bjorn
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: sparse warnings
2020-07-29 19:48 Bjorn Helgaas
@ 2020-09-30 22:39 ` Bjorn Helgaas
2020-10-01 6:29 ` Kishon Vijay Abraham I
0 siblings, 1 reply; 14+ messages in thread
From: Bjorn Helgaas @ 2020-09-30 22:39 UTC (permalink / raw)
To: Jingoo Han, Gustavo Pimentel, Kishon Vijay Abraham I; +Cc: linux-pci
On Wed, Jul 29, 2020 at 02:48:15PM -0500, Bjorn Helgaas wrote:
> Just FYI, I see the following sparse warnings (among others):
>
> $ make C=2 drivers/pci/
>
> drivers/pci/endpoint/functions/pci-epf-test.c:288:24: warning: incorrect type in argument 1 (different address spaces)
> drivers/pci/endpoint/functions/pci-epf-test.c:288:24: expected void *to
> drivers/pci/endpoint/functions/pci-epf-test.c:288:24: got void [noderef] <asn:2> *[assigned] dst_addr
> drivers/pci/endpoint/functions/pci-epf-test.c:288:34: warning: incorrect type in argument 2 (different address spaces)
> drivers/pci/endpoint/functions/pci-epf-test.c:288:34: expected void const *from
> drivers/pci/endpoint/functions/pci-epf-test.c:288:34: got void [noderef] <asn:2> *[assigned] src_addr
>
> drivers/pci/controller/dwc/pcie-designware.c:447:52: warning: cast truncates bits from constant value (ffffffff7fffffff becomes 7fffffff)
>
> It'd be nice to fix these if it's practical.
Any ideas about these?
Bjorn
^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: sparse warnings
2020-09-30 22:39 ` Bjorn Helgaas
@ 2020-10-01 6:29 ` Kishon Vijay Abraham I
0 siblings, 0 replies; 14+ messages in thread
From: Kishon Vijay Abraham I @ 2020-10-01 6:29 UTC (permalink / raw)
To: Bjorn Helgaas, Jingoo Han, Gustavo Pimentel, Lorenzo Pieralisi,
Rob Herring
Cc: linux-pci
+RobH, Lorenzo
Hi Bjorn,
On 01/10/20 4:09 am, Bjorn Helgaas wrote:
> On Wed, Jul 29, 2020 at 02:48:15PM -0500, Bjorn Helgaas wrote:
>> Just FYI, I see the following sparse warnings (among others):
>>
>> $ make C=2 drivers/pci/
>>
>> drivers/pci/endpoint/functions/pci-epf-test.c:288:24: warning: incorrect type in argument 1 (different address spaces)
>> drivers/pci/endpoint/functions/pci-epf-test.c:288:24: expected void *to
>> drivers/pci/endpoint/functions/pci-epf-test.c:288:24: got void [noderef] <asn:2> *[assigned] dst_addr
>> drivers/pci/endpoint/functions/pci-epf-test.c:288:34: warning: incorrect type in argument 2 (different address spaces)
>> drivers/pci/endpoint/functions/pci-epf-test.c:288:34: expected void const *from
>> drivers/pci/endpoint/functions/pci-epf-test.c:288:34: got void [noderef] <asn:2> *[assigned] src_addr
>>
>> drivers/pci/controller/dwc/pcie-designware.c:447:52: warning: cast truncates bits from constant value (ffffffff7fffffff becomes 7fffffff)
>>
>> It'd be nice to fix these if it's practical.
>
> Any ideas about these?
pci-epf-test here uses memcpy() to copy data from one memory mapped IO
address to other memory mapped IO address. Other places in this driver
uses memcpy_fromio() and memcpy_toio() since only one of them is memory
mapped IO address.
So the option is to either use memcpy_fromio() to copy data from IO to
temporary buffer and then use memcpy_toio() to copy data from the
temporary buffer to the memory mapped IO or create a new variant
[memcpy_fromtoio()?] that takes both memory mapped IO address.
Thanks
Kishon
^ permalink raw reply [flat|nested] 14+ messages in thread
* sparse warnings
@ 2020-08-04 21:36 Michael S. Tsirkin
0 siblings, 0 replies; 14+ messages in thread
From: Michael S. Tsirkin @ 2020-08-04 21:36 UTC (permalink / raw)
To: pbonzini, kvm
noticed these hen building with C=1:
arch/x86/kvm/x86.c:2669:38: warning: incorrect type in argument 1 (different address spaces)
arch/x86/kvm/x86.c:2669:38: expected void const [noderef] __user *
arch/x86/kvm/x86.c:2669:38: got unsigned char [usertype] *
arch/x86/kvm/x86.c:7636:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm/x86.c:7636:15: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm/x86.c:7636:15: struct kvm_apic_map *
arch/x86/kvm/x86.c:10010:16: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm/x86.c:10010:16: struct kvm_apic_map [noderef] __rcu *
arch/x86/kvm/x86.c:10010:16: struct kvm_apic_map *
arch/x86/kvm/x86.c:10011:15: error: incompatible types in comparison expression (different address spaces):
arch/x86/kvm/x86.c:10011:15: struct kvm_pmu_event_filter [noderef] __rcu *
arch/x86/kvm/x86.c:10011:15: struct kvm_pmu_event_filter *
arch/x86/kvm/x86.c: note: in included file (through include/linux/notifier.h, arch/x86/include/asm/uprobes.h, include/linux/uprobes.h, include/linux/mm_types.h, include/asm-generic/fixmap.h, arch/x86/include/asm/fixmap.h, ...):
./include/linux/srcu.h:179:9: warning: context imbalance in 'vcpu_enter_guest' - unexpected unlock
HTH,
--
MST
^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2020-10-01 6:29 UTC | newest]
Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-27 19:52 Sparse warnings Larry Finger
2008-06-27 19:53 ` Pavel Roskin
-- strict thread matches above, loose matches on Subject: below --
2008-09-11 10:46 sparse warnings Johannes Berg
2008-10-28 15:57 Johannes Berg
2008-10-29 8:06 ` Holger Schurig
2010-11-15 14:20 Belisko Marek
2010-11-17 9:11 ` Sascha Hauer
2010-11-18 9:36 ` Belisko Marek
2010-11-18 10:01 ` Sascha Hauer
2010-11-18 10:22 ` Uwe Kleine-König
2020-07-29 19:48 Bjorn Helgaas
2020-09-30 22:39 ` Bjorn Helgaas
2020-10-01 6:29 ` Kishon Vijay Abraham I
2020-08-04 21:36 Michael S. Tsirkin
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.