From cba326d140773b1dc0ced827072d28d8feb50c55 Mon Sep 17 00:00:00 2001 From: Tianjun Gao Date: Sun, 30 Apr 2023 16:28:05 +0800 Subject: [PATCH] etmem: Delete unnecessary count check in swap_pages_write() function driver inclusion category: cleanup bugzilla: https://gitee.com/openeuler/kernel/issues/I6ZSNM Reference: N/A --------------------------------------- The "swap_pages_write()" function checks if the "count" parameter is less than zero, which is unnecessary because "count" is an unsigned value and can never be negative. Signed-off-by: Tianjun Gao --- fs/proc/etmem_swap.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/fs/proc/etmem_swap.c b/fs/proc/etmem_swap.c index 86f5cf8c90a1..d3cf85e6a149 100644 --- a/fs/proc/etmem_swap.c +++ b/fs/proc/etmem_swap.c @@ -44,11 +44,6 @@ static ssize_t swap_pages_write(struct file *file, const char __user *buf, goto out; } - if (count < 0) { - ret = -EOPNOTSUPP; - goto out_mm; - } - data = memdup_user_nul(buf, count); if (IS_ERR(data)) { ret = PTR_ERR(data); -- Gitee