Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1121012lqp; Fri, 22 Mar 2024 06:20:34 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZKGUemaE3O2HZwpEnOgUuks7Xvu/QR0RBT3FtmFAhRd4IWhCzF5bGVvAIviiC/7Fefh0RimDqDM+8SxBhw1N87MaEI/jMf2So186gJg== X-Google-Smtp-Source: AGHT+IHYZ8v2dJj6I49vZtgH7tzVUicWesNdfpxcqF68L8d/wQH1WfDE6g2n8QhGk8ST6i9KVjH9 X-Received: by 2002:a05:6214:5195:b0:696:1a23:8b6d with SMTP id kl21-20020a056214519500b006961a238b6dmr2346535qvb.9.1711113634024; Fri, 22 Mar 2024 06:20:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711113634; cv=pass; d=google.com; s=arc-20160816; b=Nzk4jfvDVjnHEv5rI7a2ZfV2yNFEmmCoL3z1sdPCu5DIvG8+TWb2vsSOiqbTS11QPi JpY8iu9/VacAbyIyuv6k72+5oqvl9iU//liFJTJyatMhAirLeq069SqCDOZg1xZDJEh6 iIqVnmeVXGPMSCQpILZ5zMk85zRuwFvSImsJf5YgwIC9x346j70OZVaGwTUEHT8KSsDK nO+moUHSuL4pe4OtDmd0FDwEeEgVuX74PVBOPvvFXkjNq+oI26sHAEWTwPiKarsqQo+i EtjhbibJPLU7XEgRvoNdRzsUFeDdNFpNGaGqz7XSywxIBk+LWfC+6XyEaEzbNWiTNsWl 1+lQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=oAmJ/ZKujA5Yi8Yfv8SeEs/bE+eHxd1MNgHiPAkh8Wo=; fh=qFeVYm3EU04qgUaMW14x9Miq4L9wqmdd3DaC+zEHfa4=; b=VapDiy43ta3ecLgXrDRQhJS5nZj4Oymb26cMEdRPWDNZkPjhzLWGzGpFiFXBzxTmSy UKujof/1dRZT9UY9sIUBmsGT8/qMnYcOIa96WrmYg4IcGm0u2dN2+4LY5ccjK0Bbfopq auciqnQ1JWIxZemC1uCKV9zBJ8qQiexYnopGH9NcX9ttbUdbqCDfFtv7JkA5sP3eSSAw cxBFczQvzqN0nEpbN28FbimiUZEND3fWvPgrGwf2dPj2KvSog5ipU2pJwuinuRkKZPRU ZlJzHBKJk1A7lt/l/aOfrvI00toBcTnR+yIClG5O5Mur+jBrwFxmMdHiYVlkkAwtWrN/ M6UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y91k3fo+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id qm15-20020a056214568f00b006961cc9c642si1915414qvb.390.2024.03.22.06.20.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 06:20:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Y91k3fo+; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111462-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111462-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 4D9651C212B9 for ; Fri, 22 Mar 2024 13:20:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2740245C04; Fri, 22 Mar 2024 13:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Y91k3fo+" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4B2DF4501C; Fri, 22 Mar 2024 13:20:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711113620; cv=none; b=TyynmqGVdfQz/u865NDFUYfmtBx3Muegc3X1GiMdRRMTBDSlK1WBbKeiypES2NYHS5+Ox/acQg2NkM5MxXDSnR77f7DCrN4yALahnQ5Pel6vJXwxt9fux2XLt+DtjwBB1zotnnAqBSy2IWQiV9n/BjV8TzNz/H4BM4XMumFVq6c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711113620; c=relaxed/simple; bh=EEJlkqbFRKdutJiIhqb15BoNHeyy0W43DVSF26lWl08=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=JpyBpYCGb4S8KTIRFxN+qy+s47wIectoA1NH7K2gvYccNPQtUK2CAf7IYML1PHyCdwyVN5B1CPysiokAhlUxk8JsxZn3IZbtgo1g293gixS6a1Zo1oKNJi00aJfwRFQMOMaycYwXeDBcdrBuZmc6/EAJrQWPdVJbPxUGHyJvYkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Y91k3fo+; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6887FC433F1; Fri, 22 Mar 2024 13:20:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711113619; bh=EEJlkqbFRKdutJiIhqb15BoNHeyy0W43DVSF26lWl08=; h=From:To:Cc:Subject:Date:From; b=Y91k3fo+UgGLFpJEMeLTwOztmBVaIzbRbC2bvNmlLzsbTRzUA4innhjnIMM7+kuVQ 5AB8mUKTls/OeC1KsWS1U13jpEl4MCg6W5nIt94kpqauIYdKDNTb4NFW9XBbflOPxY N2m7SyG5SA/bjR/cqmL51I2GAbC7uakQL/e9VkiKCGf07kRZQp23pA7wqbcwaNSUtM GFJIp4lqKl639NlPyzesF0xaHRXvdZkDf0TAbOHlHbEJd72+9PuVtEsfh4KSJh93ga A5B/SxAPVviWmANwyl+++nVOO1+shLU0PfLhBw4w0fGl6PGBmWgHewqVt/ChuYPbx7 pg8pbgj6b3fIA== From: Arnd Bergmann To: Luis Chamberlain , Greg Kroah-Hartman Cc: Arnd Bergmann , linux-modules@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: [PATCH] module: silence warning about unused 'no_warn' variable Date: Fri, 22 Mar 2024 14:20:05 +0100 Message-Id: <20240322132014.906097-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann The sysfs_create_link() return code is marked as __must_check, but the module_add_driver() function tries hard to not care, by assigning the return code to a variable. When building with 'make W=1', gcc still warns because this variable is only assigned but not used: drivers/base/module.c: In function 'module_add_driver': drivers/base/module.c:36:6: warning: variable 'no_warn' set but not used [-Wunused-but-set-variable] Add an explicit cast to void to prevent this check as well. Cc: Luis Chamberlain Cc: linux-modules@vger.kernel.org Cc: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" Fixes: e17e0f51aeea ("Driver core: show drivers in /sys/module/") See-also: 4a7fb6363f2d ("add __must_check to device management code") Signed-off-by: Arnd Bergmann --- I'm not entirely sure what bug the __must_check on sysfs_create_link() is trying to prevent, or why the module loader code is allowed to ignore this. It would be nice to have an Ack from the sysfs maintainers on this. --- drivers/base/module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/base/module.c b/drivers/base/module.c index 46ad4d636731..0180dbcf2240 100644 --- a/drivers/base/module.c +++ b/drivers/base/module.c @@ -67,6 +67,8 @@ void module_add_driver(struct module *mod, struct device_driver *drv) driver_name); kfree(driver_name); } + + (void)no_warn; } void module_remove_driver(struct device_driver *drv) -- 2.39.2