[PATCH] powerpc: remove useless spinlock from mpc83xx watchdog

Kumar Gala galak at kernel.crashing.org
Fri Jan 20 01:21:14 EST 2006


On Jan 19, 2006, at 3:49 AM, Alan Cox wrote:

> On Iau, 2006-01-19 at 00:58 -0600, Kumar Gala wrote:
>> Since we can only open the watchdog once having a spinlock to protect
>> multiple access is pointless.
>>
>> Signed-off-by: Kumar Gala <galak at kernel.crashing.org>
>
> NAK
>
> This is a common mistake.
>
> open is called on the open() call and is indeed in this case 'single
> open', but file handles can be inherited and many users may have  
> access
> to a single file handle.
>
> eg
>
> 	f = open("/dev/watchdog", O_RDWR);
> 	fork();
> 	while(1) {
> 		write(f, "Boing", 5);
> 	}
>
> Alan

Thanks, you learn something new every day.

- kumar




More information about the Linuxppc-embedded mailing list