Message ID | d357fca843f8d3cc36a048732585de24d379a292.1698081019.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1509718vqx; Mon, 23 Oct 2023 12:33:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFyxSaiw4dREmdmp4Y7QqokF6xpKA7KNi9YvsrI7D9/nL/VWZqvhVgxwVRp1nDeL8Crp24V X-Received: by 2002:a62:b610:0:b0:68a:6d34:474b with SMTP id j16-20020a62b610000000b0068a6d34474bmr15155661pff.15.1698089630195; Mon, 23 Oct 2023 12:33:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698089630; cv=none; d=google.com; s=arc-20160816; b=UpqLKrHdtdPVCoF+mIY1kCtf6kZAttcMfo3mZ2CaUeNhG9zMukcP3+8B1ZI/SWZRgo dx74An1muZ/Zhi6YFuv2owA07PosMP1FAhdyXfwBHFXmnzwu5lfwxW4YH4/HFO/MPBk6 EcCMExgCI5lKYkviUMpxjJnmqUeqUCW0rxcwrYS0rbpvwaMvYh5CB66QTlcw04JGHR/x +tNhrruq9QBUqtGdoBiuBIVnLKp9FMHDqi8QESsykXIPsM7rNE7QRsuGyHNXECl4tni4 /WnkgcttkJ9Ic+bpAAZYOzWXd1t3VKRq64eRSuqIAl+rnZ9khBlXhrAxmjWuIHpLrFVt /RHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/5Qo3nS8waaAiEey/mOoHQa+DwKTxtDvbnHYmE4+GsM=; fh=BqhVhkt11hdmkbujRH8QIfD2cez9lYpeRoddPZBJma8=; b=LeE1ezREIwVljikZYhV4n8J0pSDpzOoJvDtJwX++oJWTJe/ez/BmC/louSwZaXUBCu 1Qqc0lRYv1mCi6HQP+RWPp2/lS9aFfSGuRwMm29dmoU4e7LawJ744ua8tmWChd+2FGK+ 1DYcet4SInvfJBkjUq8SGZQU6zM5bfOKyCdTps3zKKMatKrPHxdgof7gMCeYmILpqcg9 L/rZCXHu7dWXdJ6+ygKM5J7YQhYxrpN+vvMO/o0uTjIBTe4fNGX/zv937ICCXpONoF44 qSCx/i072ZE8iKrq3KWIhp8vXD2Cc891o/zAPFOvNy/iLzRxglHhJY4GiQKHTuqVrziB g7iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="iP/bKu14"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id d22-20020aa797b6000000b0068fe12b361dsi6698162pfq.249.2023.10.23.12.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Oct 2023 12:33:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b="iP/bKu14"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=wanadoo.fr Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id E6726809B0BB; Mon, 23 Oct 2023 12:33:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230353AbjJWTdc (ORCPT <rfc822;aposhian.dev@gmail.com> + 27 others); Mon, 23 Oct 2023 15:33:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbjJWTdb (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 23 Oct 2023 15:33:31 -0400 Received: from smtp.smtpout.orange.fr (smtp-23.smtpout.orange.fr [80.12.242.23]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FFA2B4 for <linux-kernel@vger.kernel.org>; Mon, 23 Oct 2023 12:33:29 -0700 (PDT) Received: from localhost.localdomain ([141.170.221.62]) by smtp.orange.fr with ESMTPSA id v0fzqGEQclciav0g4qWHEJ; Mon, 23 Oct 2023 21:33:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698089608; bh=/5Qo3nS8waaAiEey/mOoHQa+DwKTxtDvbnHYmE4+GsM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iP/bKu14gUhGjswtz4l38t2ht/2Tcp77Pltkl5s8fh2CbTDC3k+5SxHNQw8oSj4Q0 ImbJS7ubWWo7ZyBd+EbHnjPYcHXocTMqD42S7miGBjMv85zuknLVGSZnuFs6t+H2G+ 5aAp6lTX+7wPIfLmMt4BH3FtovjY8jktzW2yihDchkpC9t2APtudx3rPK6XLxjQ4dP 052FHs+M3uNsazOSc2hEUNk7eJ01TjzZzzwSOm9Smj/OiKPkfyTMaswnvIV+z9nHWM k26E1DIo/DfM6JyJA9UtjIDmz+9HCOnKgUvpbTwiW56ITasuxPVxfBwREJmtOE7aNh GyTo42AJXguFw== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 23 Oct 2023 21:33:28 +0200 X-ME-IP: 141.170.221.62 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: rafael@kernel.org, lenb@kernel.org Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr> Subject: [PATCH 3/4] ACPI: sysfs: Remove some useless trailing NULL writes Date: Mon, 23 Oct 2023 21:33:17 +0200 Message-Id: <d357fca843f8d3cc36a048732585de24d379a292.1698081019.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.32.0 In-Reply-To: <cover.1698081019.git.christophe.jaillet@wanadoo.fr> References: <cover.1698081019.git.christophe.jaillet@wanadoo.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:33:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780576031897986852 X-GMAIL-MSGID: 1780576031897986852 |
Series |
ACPI: sysfs: Fix some issues in create_of_modalias() and create_pnp_modalias()
|
|
Commit Message
Christophe JAILLET
Oct. 23, 2023, 7:33 p.m. UTC
'modalias' is only written with snprintf(), so it is already guaranteed to
be NULL terminated.
Remove the unneeded (but harmless) writes of a trailing '\0'.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/acpi/device_sysfs.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 7ec3142f3eda..1cf6568a813f 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -177,7 +177,7 @@ static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalia len += count; size -= count; } - modalias[len] = '\0'; + return len; } @@ -237,7 +237,7 @@ static int create_of_modalias(const struct acpi_device *acpi_dev, char *modalias len += count; size -= count; } - modalias[len] = '\0'; + return len; }