Messages in this thread | | | Date | Sat, 10 Apr 1999 09:40:20 +0100 (GMT) | From | Riley Williams <> | Subject | Re: QUESTION about devices.c |
| |
Hi there.
> I've got a question about function register_chrdev in > /usr/src/linux/fs/devices.c file.
> In line 135 of the function register_chrdev there is a logical > operator &&:
> if(chrdevs[major].fops && chrdevs[major].fops != fops) > ^^
> Is it supposed to be a bitwise operator &? Am I correct?
I don't think it would make sense as a bitwise operator since the right hand side thereof is the result of a != test. I would read that as if it had been written as follows:
Q> if ( (chrdevs[major].fops != 0) && (chrdevs[major].fops != fops) )
Note that naming an integer type variable as a condition is the same as applying a test for non-zero to that variable, and naming a pointer type variable is the same as applying a test for non-NULL.
Best wishes from Riley.
+----------------------------------------------------------------------+ | There is something frustrating about the quality and speed of Linux | | development, ie., the quality is too high and the speed is too high, | | in other words, I can implement this XXXX feature, but I bet someone | | else has already done so and is just about to release their patch. | +----------------------------------------------------------------------+ * ftp://ftp.MemAlpha.cx/pub/rhw/Linux * http://www.MemAlpha.cx/kernel.versions.html
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |