[Nut-upsdev] nut + usb + udev with kernel 2.6.22

Arjen de Korte nut+devel at de-korte.org
Mon Oct 8 17:22:35 UTC 2007


>> As long as SUBSYSTEM is equal to "usb" or "usb_device", that doesn't
>> matter. If not, if BUS either doesn't exist or is not equal to "usb", we
>> should probably skip the remainder.
>
> I mean why don't you just write:
>
> SUBSYSTEM=="usb_device", GOTO="nut-usbups_rules_real"
> SUBSYSTEM!="usb", GOTO="nut-usbups_rules_end"
>
> instead of:
>
> SUBSYSTEM=="usb_device", GOTO="nut-usbups_rules_real"
> SUBSYSTEM=="usb", GOTO="nut-usbups_rules_real"
> BUS!="usb", GOTO="nut-usbups_rules_end"

Well, one reason that comes to mind is that mixing positive ('equal to')
and negative ('not equal to') logic is prone to (human) errors. If the
following comparison to the BUS variable is useful, is something that I
don't know, but I surely wouldn't like to follow your example here.

Best regards, Arjen




More information about the Nut-upsdev mailing list