提交 7c327857 编写于 作者: M Michael Hennerich 提交者: Greg Kroah-Hartman

Staging: iio: iio_trigger_find_by_name: Skip trailing newline if available

Skip trailing newline if available.
Signed-off-by: NMichael Hennerich <Michael.Hennerich@analog.com>
Acked-by: NJonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 a05d7ce3
......@@ -156,6 +156,9 @@ struct iio_trigger *iio_trigger_find_by_name(const char *name, size_t len)
struct iio_trigger *trig;
bool found = false;
if (len && name[len - 1] == '\n')
len--;
mutex_lock(&iio_trigger_list_lock);
list_for_each_entry(trig, &iio_trigger_list, list) {
if (strncmp(trig->name, name, len) == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册