|
16 | 16 | #include <linux/hte.h>
|
17 | 17 | #include <linux/interrupt.h>
|
18 | 18 | #include <linux/irqreturn.h>
|
19 |
| -#include <linux/kernel.h> |
20 | 19 | #include <linux/kfifo.h>
|
21 | 20 | #include <linux/module.h>
|
22 | 21 | #include <linux/mutex.h>
|
|
25 | 24 | #include <linux/poll.h>
|
26 | 25 | #include <linux/seq_file.h>
|
27 | 26 | #include <linux/spinlock.h>
|
| 27 | +#include <linux/string.h> |
28 | 28 | #include <linux/timekeeping.h>
|
29 | 29 | #include <linux/uaccess.h>
|
30 | 30 | #include <linux/workqueue.h>
|
@@ -1215,7 +1215,7 @@ static int gpio_v2_line_config_validate(struct gpio_v2_line_config *lc,
|
1215 | 1215 | if (lc->num_attrs > GPIO_V2_LINE_NUM_ATTRS_MAX)
|
1216 | 1216 | return -EINVAL;
|
1217 | 1217 |
|
1218 |
| - if (memchr_inv(lc->padding, 0, sizeof(lc->padding))) |
| 1218 | + if (!mem_is_zero(lc->padding, sizeof(lc->padding))) |
1219 | 1219 | return -EINVAL;
|
1220 | 1220 |
|
1221 | 1221 | for (i = 0; i < num_lines; i++) {
|
@@ -1629,7 +1629,7 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip)
|
1629 | 1629 | if ((ulr.num_lines == 0) || (ulr.num_lines > GPIO_V2_LINES_MAX))
|
1630 | 1630 | return -EINVAL;
|
1631 | 1631 |
|
1632 |
| - if (memchr_inv(ulr.padding, 0, sizeof(ulr.padding))) |
| 1632 | + if (!mem_is_zero(ulr.padding, sizeof(ulr.padding))) |
1633 | 1633 | return -EINVAL;
|
1634 | 1634 |
|
1635 | 1635 | lc = &ulr.config;
|
@@ -2411,7 +2411,7 @@ static int lineinfo_get(struct gpio_chardev_data *cdev, void __user *ip,
|
2411 | 2411 | if (copy_from_user(&lineinfo, ip, sizeof(lineinfo)))
|
2412 | 2412 | return -EFAULT;
|
2413 | 2413 |
|
2414 |
| - if (memchr_inv(lineinfo.padding, 0, sizeof(lineinfo.padding))) |
| 2414 | + if (!mem_is_zero(lineinfo.padding, sizeof(lineinfo.padding))) |
2415 | 2415 | return -EINVAL;
|
2416 | 2416 |
|
2417 | 2417 | desc = gpio_device_get_desc(cdev->gdev, lineinfo.offset);
|
|
0 commit comments