* [PATCH] fix warning in drivers/net/sis900.c
@ 2003-03-01 17:11 Martin J. Bligh
2003-03-01 17:23 ` Jeff Garzik
0 siblings, 1 reply; 3+ messages in thread
From: Martin J. Bligh @ 2003-03-01 17:11 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-kernel
drivers/net/sis900.c: In function `set_rx_mode':
drivers/net/sis900.c:2100: warning: passing arg 2 of `set_bit' from incompatible pointer type
I just cast this. Seems to work fine at the moment, so presumably it's
correct.
M.
diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/net/sis900.c sisfix/drivers/net/sis900.c
--- virgin/drivers/net/sis900.c Tue Feb 25 23:03:47 2003
+++ sisfix/drivers/net/sis900.c Sat Mar 1 08:39:16 2003
@@ -2097,7 +2097,7 @@ static void set_rx_mode(struct net_devic
for (i = 0, mclist = net_dev->mc_list; mclist && i < net_dev->mc_count;
i++, mclist = mclist->next)
set_bit(sis900_compute_hashtable_index(mclist->dmi_addr, revision),
- mc_filter);
+ (unsigned long *) mc_filter);
}
/* update Multicast Hash Table in Receive Filter */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix warning in drivers/net/sis900.c
2003-03-01 17:11 [PATCH] fix warning in drivers/net/sis900.c Martin J. Bligh
@ 2003-03-01 17:23 ` Jeff Garzik
2003-03-20 7:34 ` Martin J. Bligh
0 siblings, 1 reply; 3+ messages in thread
From: Jeff Garzik @ 2003-03-01 17:23 UTC (permalink / raw)
To: Martin J. Bligh; +Cc: linux-kernel
Martin J. Bligh wrote:
> drivers/net/sis900.c: In function `set_rx_mode':
> drivers/net/sis900.c:2100: warning: passing arg 2 of `set_bit' from incompatible pointer type
>
> I just cast this. Seems to work fine at the moment, so presumably it's
> correct.
Nope -- set_bit wants to work on a real unsigned long. While your patch
will work, the proper fix is to not use set_bit :)
Jeff
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] fix warning in drivers/net/sis900.c
2003-03-01 17:23 ` Jeff Garzik
@ 2003-03-20 7:34 ` Martin J. Bligh
0 siblings, 0 replies; 3+ messages in thread
From: Martin J. Bligh @ 2003-03-20 7:34 UTC (permalink / raw)
To: Jeff Garzik; +Cc: linux-kernel
>> drivers/net/sis900.c: In function `set_rx_mode':
>> drivers/net/sis900.c:2100: warning: passing arg 2 of `set_bit' from incompatible pointer type
>>
>> I just cast this. Seems to work fine at the moment, so presumably it's
>> correct.
>
>
> Nope -- set_bit wants to work on a real unsigned long.
> While your patch will work, the proper fix is to not use set_bit :)
Fair enough. How about this? (compile tested, but not machine-tested)
mc_filter is declared as this ...
u16 mc_filter[16] = {0}; /* 256/128 bits multicast hash table */
so I just split off the high & low parts, and use them seperately ...
M.
diff -urpN -X /home/fletch/.diff.exclude virgin/drivers/net/sis900.c sisfix/drivers/net/sis900.c
--- virgin/drivers/net/sis900.c Mon Mar 17 21:43:45 2003
+++ sisfix/drivers/net/sis900.c Wed Mar 19 23:27:49 2003
@@ -2094,10 +2094,13 @@ static void set_rx_mode(struct net_devic
use Receive Filter to reject unwanted MCAST packet */
struct dev_mc_list *mclist;
rx_mode = RFAAB;
- for (i = 0, mclist = net_dev->mc_list; mclist && i < net_dev->mc_count;
- i++, mclist = mclist->next)
- set_bit(sis900_compute_hashtable_index(mclist->dmi_addr, revision),
- mc_filter);
+ for (i = 0, mclist = net_dev->mc_list;
+ mclist && i < net_dev->mc_count;
+ i++, mclist = mclist->next) {
+ int index = sis900_compute_hashtable_index(
+ mclist->dmi_addr, revision);
+ mc_filter[index/16] |= (u16) (1 << (index & 0xff));
+ }
}
/* update Multicast Hash Table in Receive Filter */
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-03-20 7:23 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-03-01 17:11 [PATCH] fix warning in drivers/net/sis900.c Martin J. Bligh
2003-03-01 17:23 ` Jeff Garzik
2003-03-20 7:34 ` Martin J. Bligh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox