From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D02EC33E36A; Sat, 30 May 2026 17:36:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162587; cv=none; b=toNuEDx4g7U1dhPN61BwgS/9oCcnKVjlFIAycxvM3q5oW4EEJxx82XMfyHE4qVhw7xX88DPn0V1fI891SK8VS6npQRsz0/OleL37LQC/g2mLW0b1yBrmYB4gP/MOD+b/9OisqFbWo9JJD1EjiH2Ai2R/uqZnv39dyDs1RWsPsRc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780162587; c=relaxed/simple; bh=0LXG9/FsczzDgiNQ9MrAhugRzGxVE1jQNtGGG8ZfV78=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ihzd06Op6nBIX2m2x+I/qO/JGzNWv+0mgCqcWJ07aSh4S0OuS6/NUywdwvIEMy7nmp+ELSomL3Zj7O0h4FbA0SQMP2L+WDC9HGx1xhLq5X84jq2iRec5kAz/CagY5pqHmgy7mpEPIYhCW1KQ+JKyD76/1+NguIsI0Aa5vcZfWC0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IDq0bmO8; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IDq0bmO8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20D8A1F00898; Sat, 30 May 2026 17:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1780162586; bh=x797TKxR9Zr4ysf6YPLancIDUlxp26mGDCsGfXv/cyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IDq0bmO8LjgeSoAnh2+xAB1ezDFofQgOfJ9OgGEJFOnwqOS2DxKMjePztdh2W9QuB 3IoB6mWHL8qrcgKODNZqnFv6ehZX6h77d9EXOR53LQUxxLdP2CLHp6Fz61H0SsK2Lk YSQpP/2FUF4qTvfjDiIXNeagXcsaZ8A1T98JWq5M= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Andy Shevchenko , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 6.1 966/969] gpiolib: cdev: use !mem_is_zero() instead of memchr_inv(s, 0, n) Date: Sat, 30 May 2026 18:08:10 +0200 Message-ID: <20260530160327.452345769@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530160300.485627683@linuxfoundation.org> References: <20260530160300.485627683@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Shevchenko [ Upstream commit e106b1dd38e723ec2bb2bf57ea9b2aff464b9423 ] Use the mem_is_zero() helper where possible. Signed-off-by: Andy Shevchenko Link: https://lore.kernel.org/r/20241110201706.16614-1-andy.shevchenko@gmail.com Signed-off-by: Bartosz Golaszewski Stable-dep-of: 3e6ccd790ed6 ("gpio: cdev: check if uAPI v2 config attributes are correctly zeroed") Signed-off-by: Sasha Levin --- drivers/gpio/gpiolib-cdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpio/gpiolib-cdev.c b/drivers/gpio/gpiolib-cdev.c index 897d20996a8c6..944aa0c1cd5c7 100644 --- a/drivers/gpio/gpiolib-cdev.c +++ b/drivers/gpio/gpiolib-cdev.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -25,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -1339,7 +1339,7 @@ static int gpio_v2_line_config_validate(struct gpio_v2_line_config *lc, if (lc->num_attrs > GPIO_V2_LINE_NUM_ATTRS_MAX) return -EINVAL; - if (memchr_inv(lc->padding, 0, sizeof(lc->padding))) + if (!mem_is_zero(lc->padding, sizeof(lc->padding))) return -EINVAL; for (i = 0; i < num_lines; i++) { @@ -1781,7 +1781,7 @@ static int linereq_create(struct gpio_device *gdev, void __user *ip) if ((ulr.num_lines == 0) || (ulr.num_lines > GPIO_V2_LINES_MAX)) return -EINVAL; - if (memchr_inv(ulr.padding, 0, sizeof(ulr.padding))) + if (!mem_is_zero(ulr.padding, sizeof(ulr.padding))) return -EINVAL; lc = &ulr.config; @@ -2541,7 +2541,7 @@ static int lineinfo_get(struct gpio_chardev_data *cdev, void __user *ip, if (copy_from_user(&lineinfo, ip, sizeof(lineinfo))) return -EFAULT; - if (memchr_inv(lineinfo.padding, 0, sizeof(lineinfo.padding))) + if (!mem_is_zero(lineinfo.padding, sizeof(lineinfo.padding))) return -EINVAL; desc = gpiochip_get_desc(cdev->gdev->chip, lineinfo.offset); -- 2.53.0