Won't this mean that when chan == -1 it will fail with an error?  If so, why do you bother with this case below?

```
	if (chan != -1) {
```

Also, you're introducing warnings.  The code you removed was using `(u32)-1` for a reason.  Although, I suppose maybe `chan` should just be an `int` instead of `u32`.

-[Unknown]