From patchwork Mon Oct 23 19:33:18 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 157076 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce89:0:b0:403:3b70:6f57 with SMTP id p9csp1509719vqx; Mon, 23 Oct 2023 12:33:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQQ7w0SBloL+ipvZd/jerrYox8r9hyYdwrkfcmxHfsSZmMVyqMT/N5AGKBoWy77TCtc4rv X-Received: by 2002:a17:902:e54e:b0:1c9:ddd8:9950 with SMTP id n14-20020a170902e54e00b001c9ddd89950mr13221438plf.21.1698089630363; 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=wVIYKlNG8CsgQF0MeU/ce5Xn62z4fURflS9Vjb+0I09fCg7Zp5qv4c0ygoEMSEOF1X rvGMBQp93hX6j6ziRbqnNe3cDbsBqd4YNXR/UxXbRf59jWIoakaz+K2vliqSliAjTQaF gIetD3myLvQC+qzaORJVGs05SCyXk6s6ef/9Y4lE+DtpMUvH2cuhjqMvhjn/Eh9Y25uP 2GfYMVjv0/xxoxMtZuH/G49+9ayEsC1XwuyDre2z8q6I3yRZNUpGmGvX+zgngJC0z1eX iBEct7JAz8orJUB4GZ7E4dhlhjfkFdHgyzVvJ2f4XNLqbp3xX1Q1lYcC/cdYOZZWZL+1 k36A== 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=kOczc4xzag/NnlA9XkZf9hv4EVckr0nepjgeN8+fjfE=; fh=BqhVhkt11hdmkbujRH8QIfD2cez9lYpeRoddPZBJma8=; b=PiF3cXVANaNEQ3VvMM7hNCJY7q7y5wVcKhOb6BP/YJWXHQbs03SAGpSd8Dnc5DavAO kk09FuH2CoBkpobA5W8WlRMV0jfbnjQP+gHGbFHnvYmEqdhbsuHXc+8KBV+VDkV8NbuB 8my31swFXwAf0g35TB0rMIhBdGRFMNDJZLJlMyp6QE37MQNueBi++7VIh2VoMkiuzmoM l5dV9AbiQoMPiQjseB5dpjVl0jrHbL4+749Ly5K/35iV7CCRP3g3d8ZawqRvq3c8s6w0 urw0eF9fSR+UVXTq9eV+8nYfCyhYZiZXBQZrZMhcJvKw45lYu43Wns7tHEQlnOgSKDBb YMkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=R+rP9eZt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id s17-20020a170902a51100b001c9f54d26bfsi6665600plq.516.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.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=R+rP9eZt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 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 groat.vger.email (Postfix) with ESMTP id 3F8D4807C563; Mon, 23 Oct 2023 12:33:48 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230386AbjJWTde (ORCPT + 27 others); Mon, 23 Oct 2023 15:33:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47602 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbjJWTdd (ORCPT ); Mon, 23 Oct 2023 15:33:33 -0400 Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 712E694 for ; Mon, 23 Oct 2023 12:33:31 -0700 (PDT) Received: from localhost.localdomain ([141.170.221.62]) by smtp.orange.fr with ESMTPSA id v0fzqGEQclciav0g5qWHER; Mon, 23 Oct 2023 21:33:30 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1698089610; bh=kOczc4xzag/NnlA9XkZf9hv4EVckr0nepjgeN8+fjfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=R+rP9eZtOV0Gu0NgUyXgpD5G0f7Mtnczfb9ANQB6jCAf4xSPtHm9RgbLkUnE2KTiG bMzIpIpSvRY8aVNbezdI543C0GvzU2WBn/AWvO8yTCymF+IEThHhmXyh6W2hnYgjih 47nmsTCLNMt1SjjO/t++jo/H/DcBtu2tBh45kl+XeeoQpwnjyNt3woqlqbN//11jK6 CtGtMniOzX2+jIp2J6vd40m9penXIjlljjSx21ozWTrFgNdliWCUSKO7hP1+Or8TDU LKjitwJAjSQjTlfkrtnqGvNXfrsVHmTIUD5mWrnIkAGnvWaMQn4dhqj183ecjJOEyL /8FbvSHUFvyOQ== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 23 Oct 2023 21:33:30 +0200 X-ME-IP: 141.170.221.62 From: Christophe JAILLET 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 Subject: [PATCH 4/4] ACPI: sysfs: Remove some dead code Date: Mon, 23 Oct 2023 21:33:18 +0200 Message-Id: X-Mailer: git-send-email 2.32.0 In-Reply-To: References: MIME-Version: 1.0 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 groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Mon, 23 Oct 2023 12:33:48 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780576032503485857 X-GMAIL-MSGID: 1780576032503485857 snprintf() never returns <0 values. So remove some dead code. Signed-off-by: Christophe JAILLET --- drivers/acpi/device_sysfs.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 1cf6568a813f..23373faa35ec 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -168,8 +168,6 @@ static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalia continue; count = snprintf(&modalias[len], size, "%s:", id->id); - if (count < 0) - return -EINVAL; if (count >= size) return -ENOMEM; @@ -228,8 +226,6 @@ static int create_of_modalias(const struct acpi_device *acpi_dev, char *modalias for (i = 0; i < nval; i++, obj++) { count = snprintf(&modalias[len], size, "C%s", obj->string.pointer); - if (count < 0) - return -EINVAL; if (count >= size) return -ENOMEM;