Re: [PATCH] d80211: fix some 0 vs. NULL comparisons

2006-08-14 Thread Jouni Malinen
On Mon, Aug 14, 2006 at 03:20:58PM +0200, Johannes Berg wrote:
> Johannes Berg wrote:
> >-if (!local->hw->passive_scan) {
> >+if (local->hw->passive_scan == NULL) {
> 
> Alright, this is icky. I'll make another pass and change it all to if 
> (x) or if (!x) instead of comparing to NULL. Don't hold your breath 
> though, earliest next weekend.

Well.. I'm perfectly fine with comparing function pointers to NULL in
this kind of case.. In many cases, I find fp == NULL to be clearer than
!fp, but for the fp != NULL case I would rather not see != NULL.. Not
very consistent, but can't really help with that on this kind of coding
style opinions. Anyway, replacing 0 with NULL is a good change.

-- 
Jouni MalinenPGP id EFC895FA
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] d80211: fix some 0 vs. NULL comparisons

2006-08-14 Thread Johannes Berg

Johannes Berg wrote:

-if (!local->hw->passive_scan) {
+if (local->hw->passive_scan == NULL) {


Alright, this is icky. I'll make another pass and change it all to if 
(x) or if (!x) instead of comparing to NULL. Don't hold your breath 
though, earliest next weekend.


johannes
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] d80211: fix some 0 vs. NULL comparisons

2006-08-14 Thread Johannes Berg
This patch fixes places where pointers are compared against 0 and 
unifies it a bit.


Signed-off-by: Johannes Berg <[EMAIL PROTECTED]>

--- wireless-dev.orig/net/d80211/ieee80211_scan.c2006-08-12 
10:11:21.069644280 +0200
+++ wireless-dev/net/d80211/ieee80211_scan.c2006-08-12 
10:11:44.619644280 +0200

@@ -117,7 +117,7 @@ static void ieee80211_scan_start(struct
struct ieee80211_channel *chan = NULL;
int ret;

-if (local->hw->passive_scan == 0) {
+if (local->hw->passive_scan == NULL) {
printk(KERN_DEBUG "%s: Scan handler called, yet the hardware "
   "does not support passive scanning. Disabled.\n",
   dev->name);
@@ -293,7 +293,7 @@ void ieee80211_init_scan(struct net_devi
struct rate_control_extra extra;

/* Only initialize passive scanning if the hardware supports it */
-if (!local->hw->passive_scan) {
+if (local->hw->passive_scan == NULL) {
local->scan.skb = NULL;
memset(&local->scan.tx_control, 0,
   sizeof(local->scan.tx_control));
@@ -344,7 +344,7 @@ void ieee80211_stop_scan(struct net_devi
{
struct ieee80211_local *local = dev->ieee80211_ptr;

-if (local->hw->passive_scan != 0) {
+if (local->hw->passive_scan != NULL) {
del_timer_sync(&local->scan.timer);
dev_kfree_skb(local->scan.skb);
local->scan.skb = NULL;

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html