Re: [PATCH v2] linux: Detect the battery of bluetooth input devices.

2013-09-02 Thread Peter Wu
Hi, On Monday 02 September 2013 17:41:17 Shih-Yuan Lee wrote: > I use "if (foo = bar)" to replace the following two lines. > > foo = bar > if (foo != NULL) I meant using this instead: if ((foo = bar)) GCC warning: warning: suggest parentheses around assignment used as truth value [- Wparen

Re: [PATCH v2] linux: Detect the battery of bluetooth input devices.

2013-09-02 Thread Peter Wu
Hi, This looks fine to me, but wouldn't the compiler give a notice about: if (foo = bar) (when it thinks that you meant foo == bar instead?) On Monday 02 September 2013 16:53:14 Shih-Yuan Lee wrote: > From: "Shih-Yuan Lee (FourDollars)" > > First, checking the device path. If it contains '

[PATCH v2] linux: Detect the battery of bluetooth input devices.

2013-09-02 Thread Shih-Yuan Lee (FourDollars)
From: "Shih-Yuan Lee (FourDollars)" First, checking the device path. If it contains 'bluetooth', it is a bluetooth devices. Second, checking if there is an input folder. If there is mouse folder under the input folder, it is a mouse device. Otherwise, it is a keyboard device. --- src/linux/up-de