Search Linux Wireless

Re: [RFC V4] cfg80211: introduce critical protocol indication from user-space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/05/2013 12:19 PM, Arend van Spriel wrote:

+    trace_rdev_crit_proto_stop(&rdev->wiphy, wdev);
+    if (rdev->crit_proto_started) {
+        ret = rdev->ops->crit_proto_stop(&rdev->wiphy, wdev);
+        rdev->crit_proto_started = ret != 0;

Maybe:  rdev->crit_proto_started = !ret;

Maybe not. If ret == 0, crit_proto_started should be false. If ret != 0, ie. crit_proto_stop() failed, it should remain true. It is a bit of reverse logic. I
could change it to !!ret or make it more clear using !ret ? false : true. Another idea is changing the return type of crit_proto_stop() to void and always set
crit_proto_started to false.

Well, I had a hard time figuring out what that code was supposed to do (obviously).

Maybe just:
	if (ret == 0)
		rdev->crit_proto_started = false;

Or just require that the driver not fail this operation ever and always set crit_proto_started to false.

Thanks,
Ben

--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux