Re: [PATCH v2] iio: tools: generic_buffer: auto-enable channels

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

 



On Tue, Apr 12, 2016 at 11:14 AM, Peter Meerwald-Stadler
<pmeerw@xxxxxxxxxx> wrote:

>> +int enable_disable_all_channels(char *dev_dir_name, int enable)
>
> could be static?
> well, nothing in generic_buffer.c is...

OK I will make it static, and then submit a separate patch to staticize the rest
of generic_buffer.c local functions.

>> +     dp = opendir(scanelemdir);
>> +     if (!dp) {
>
> maybe perror() can be used here, it's used for closedir() check

perror() does not support arguments.
perror("foo"); is OK.
perror("%s: foo", __func__); does not work.

So we have to use printf(stderr, ....);

>> +     int autochannels = 0;
>
> maybe an enum for autochannels? it can be 0/1/2

OK. It breaks a bit with the style of the file, but I will
submit a version like so.

>> +static inline int check_suffix(const char *str, const char *suffix)
>
> prefix with iioutils_ maybe?

OK

>> +     return strlen(str) > strlen(suffix) &&
>
> it should be >= probably such that
> check_suffix("abc", "abc") is 1, currently returns 0

OK fixed it, nice catch!

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux