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

Re: Hard Drive light



According to Colin Leroy, on Sun, 5 Dec 2004 14:42:33 +0100, 
>On 06 Dec 2004 at 00h12, Cedric Pradalier wrote:
>
>Hi Cedric, 
>
>> +	return sprintf(buf, "%c\n", pmu_blink_led_activated?'1':'0'); 
>
>why not simply sprintf(buf, "%d\n", pmu_blink_led_activated) ?

I like to ensure that whatever the implementation of this boolean, the textual output
stays the same.

>
>> +	pmu_blink_led_activated = newact?1:0;
>
>pmu_blink_led_activated = (newact != 0);
>is enough and more nice imho.

I wanted to have either 1 or 0 in this boolean, not whatever int sent in the buffer.

>
>> +	device_create_file (&of_hd_dev->dev, &dev_attr_blinking_led);
>
>where is dev_attr_blinking_led defined ?
>
 +static DEVICE_ATTR (blinking_led, S_IRUGO | S_IWUSR, 
 +		show_blinkingled_activity, set_blinkingled_activity);

Note that the patch is made from a compiled and tested pmac.c ;o)




-- 
Cedric Pradalier
Research Engineer
CSIRO - ICT Centre



Reply to: