On Thu, 2015-12-17 at 03:01 -0800, Joe Perches wrote:

> Following patterns is good, I just think the
> pattern could be trivially improved.

It's a question of what makes sense though - nobody implements stop_xyz
without implementing start_xyz, and even if they do it's pointless.
It's just that if you have start_xyz most/all of your functional tests
might work, but we'd really like to have stop_xyz as well.

It's not *worse* to check for the XOR (like you suggest below), but
it's not really any better either.

> The test is a runtime check on what would ideally
> be done at compile time.

If you have any suggestions how to do that then that'd be great :) I
don't really see a way of doing that since this depends on the driver
and the driver might even fill the struct at runtime (like hwsim does
IIRC)

> Using
>       WARN_ON(!a ^ !b)
> which is logically the same as what I wrote above
> for clarity is simply a bit more coverageĀ and maybe
> even a bit run-time faster.

Don't think we have to worry much about the runtime overhead, but
that's a nice idea. As I said above though, I don't think it really
makes a difference.

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

Reply via email to