Received: by 2002:ab2:3350:0:b0:1f4:6588:b3a7 with SMTP id o16csp1189736lqe; Mon, 8 Apr 2024 01:02:47 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4tSBMFN/Q4eDbntMG/00I6KtS12FX+vaoxpWMLHWVDXwT/0CrkdAEkdUK46Y9AGPdiclL4HeUQeJXP3NoxuuGFlowOJq3JoSEWcyBUg== X-Google-Smtp-Source: AGHT+IFodoFAis++qxGVy6VzmsxW/fGc/seHiXSRjKH2kGhnA+UKExMNAeG/CHUrPL+5QOyNu+SG X-Received: by 2002:a17:906:4f06:b0:a51:e16d:4652 with SMTP id t6-20020a1709064f0600b00a51e16d4652mr53652eju.71.1712563366877; Mon, 08 Apr 2024 01:02:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712563366; cv=pass; d=google.com; s=arc-20160816; b=qcDK+HdiBzaOXhYYC0nRhsou/U9wSeLrYaKAPiJo0oUGdcbgnkbMyfak54wVlqGO+0 Ks+tKa/ME56thQqJMmiYamXsQa6i1GjkM8yhDw9CdjcTggyJiqJcxfz03LRUZYnvVgWM mVRWbLLL7bbJDfkVywbOh5EIKatUI54DpDh8GTFltsezlDQkkSV6Zn4mthaHniIxOewT D1mcb/VdD76BgvNNP9FgmF2Wqr2K4JIBxWKogemGJaSRyCbH7CbMOW/DRLfiz2sMrjet a0y52AwOxhhhFv0YC+NIzAs1PEJkRY+/j9R2ijIKBCmo8glnlN0w4o4Fwja6/Nmzm9vK US2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=353KQRVAV2Vp7+I9XXlJcOEzq1lBks9gDh0CvvTWW/0=; fh=byHk6BBtKzV/703at67XCqgZyc//Eyi1XyN/dmZAVzo=; b=sn+p43fyb4wGYQ0SVzc/+mGBFIMCS6CWUwu62aVU7zf0A7zEJ17FaDjDhOhSi1TsIN /bLDb94YuJ9Zs0ZCajp7t3Xuh3WasILldWnPrMmKhwBvDlXCAhPoOmKbJzk0q4B4Hxiz j2y5a8de9zZHlWjRpGUafT9ZwilnqjUjAzSVhgT4jYfyVyCQoiD7+CBbfmFvcOIu2DaQ VSpP7QSAzfcEV0A+t2qwh0Mc65Fwy5eNPrEuaVYdXyrAEyySxkrdjaJ6GwY+hhx480K4 5FBq+s+LKWtybL5fRC45kFPtY1Ylr3t0Z3cBHD5iHzYj0ePKzeqpIyHkOiSl1qYUAob2 xSGA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=nsKkW6FL; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=EWrFlLHI; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-134987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id di13-20020a170906730d00b00a4e0eaee044si3422716ejc.814.2024.04.08.01.02.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Apr 2024 01:02:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-134987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm2 header.b=nsKkW6FL; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=EWrFlLHI; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-134987-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-134987-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 74F821F218A2 for ; Mon, 8 Apr 2024 08:02:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0FA02C197; Mon, 8 Apr 2024 08:02:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="nsKkW6FL"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="EWrFlLHI" Received: from fhigh4-smtp.messagingengine.com (fhigh4-smtp.messagingengine.com [103.168.172.155]) (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 279E433981; Mon, 8 Apr 2024 08:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712563359; cv=none; b=KdVhCle2Q9t4Jy6eyBNFOO611rAaoXLEJupcfdg7sWc5Qc40CIi3PRnf14u7qXHvO0j+447PLgunBg/0Tk6HHiZT5BBbzfKeIHOLLKx9yfOc5Q8LHJKW0M+guUQGsILWc5yF3RaV2emUvh7HNX9QNtuFU44oKPEx0WWj8zx4XQg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712563359; c=relaxed/simple; bh=ONVCO97q0NUpcIKzKBU0FPe0s0GFuXeW+BnFifgu3xY=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=QVyzkOqG764kzRnlbZwCCPoN/iAb1C9DDFPEhIGUWFEU4LB8F1aRkB78mF/ojZ0aHmkLlzVNZaS6uYwgScAfVCWepTlZSXBqaCaNSTPtxcM4HI04+VAd3b9kCSA3CzQLBH9t/Of2Y+VguxvcmvCLr18236yNrIdD7BffUyKdQkU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=nsKkW6FL; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=EWrFlLHI; arc=none smtp.client-ip=103.168.172.155 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 3767E1140083; Mon, 8 Apr 2024 04:02:37 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Mon, 08 Apr 2024 04:02:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm2; t=1712563357; x=1712649757; bh=353KQRVAV2 Vp7+I9XXlJcOEzq1lBks9gDh0CvvTWW/0=; b=nsKkW6FL2r2tnPuQpDnAidkQhs LL3HSoM+e6C0oZ0OxTM1WH0kFDXQaplxMk/9onG4HREKvUBpbU/3NN0N0jm+zp+N FUFbrPs7xjZYr0zG0rLD/m0rcGNGliVJ6gOYX5NTp+aL2Ze+R2pa0b7LfoXcbfF1 m0k2WzRL1cf81/4qPYCtiZurlwDMFsCVX+kVd5nv9h08sIYvtEIiHxjenGtH7Yfv wdDEgSo+vODN2Ys7GvcmbXeWBN3yEG7KqoQSDgNzDgcO6pXM6vP0QmtrMa18F/re kwaUvKF+GQLnbxPxjaFyGgWPvmevwb5YLUbibrMWL8OMky7Q341Mbf/hGzVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1712563357; x=1712649757; bh=353KQRVAV2Vp7+I9XXlJcOEzq1lB ks9gDh0CvvTWW/0=; b=EWrFlLHIQsyNwfytwwCpBq0y8szxw6wp9EfltAmhQPCm S1vxG9bnKhMz+C8zoQcj1EANhgy/Eo02LOpryePrQZJTNVesalw8a+cP29zsBRiF mzQjnnzOCJcOwxAxXh89X9NmiH+yR9PKdljGGIoRpId/LkX32B8VbYM9KPo5U+AS ypP170QCiytQurLxkdsxx3aU40Nnf5dX2dUP/3Z6StDR4N+0zoEQ+HgH3b8YQ7E9 dSb/u9DkwmRiwwJhXyeHku50DBmx/fxFX2N3zT+6CgxP7TjU7fVCUCZjLd4YJNe/ 6cu6qUJLmm1YJr5YXbFsY/rPZVf9VWe4REA5RINQ1w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudeghedguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdet rhhnugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrg htthgvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedt keetffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe grrhhnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 6CE04B6008F; Mon, 8 Apr 2024 04:02:36 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-368-gc733b1d8df-fm-20240402.001-gc733b1d8 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: In-Reply-To: References: <20240326145733.3413024-1-arnd@kernel.org> Date: Mon, 08 Apr 2024 10:02:15 +0200 From: "Arnd Bergmann" To: "Andy Shevchenko" , "Arnd Bergmann" Cc: "Greg Kroah-Hartman" , "Luis Chamberlain" , linux-modules@vger.kernel.org, "Rafael J . Wysocki" , "Jens Axboe" , "Ricardo B. Marliere" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] [v3] module: don't ignore sysfs_create_link() failures Content-Type: text/plain On Tue, Mar 26, 2024, at 16:29, Andy Shevchenko wrote: > On Tue, Mar 26, 2024 at 03:57:18PM +0100, Arnd Bergmann wrote: >> 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] >> >> Rework the code to properly unwind and return the error code to the >> caller. My reading of the original code was that it tries to >> not fail when the links already exist, so keep ignoring -EEXIST >> errors. > >> Cc: Luis Chamberlain >> Cc: linux-modules@vger.kernel.org >> Cc: Greg Kroah-Hartman >> Cc: "Rafael J. Wysocki" > > Wondering if you can move these to be after --- to avoid polluting commit > message. This will have the same effect and be archived on lore. But on > pros side it will unload the commit message(s) from unneeded noise. Done > >> + error = module_add_driver(drv->owner, drv); >> + if (error) { >> + printk(KERN_ERR "%s: failed to create module links for %s\n", >> + __func__, drv->name); > > What's wrong with pr_err()? Even if it's not a style used, in a new pieces of > code this can be improved beforehand. So, we will reduce a technical debt, and > not adding to it. I think that would be more confusing, and would rather keep the style consistent. There is no practical difference here. >> +int module_add_driver(struct module *mod, struct device_driver *drv) >> { >> char *driver_name; >> - int no_warn; >> + int ret; > > I would move it... > >> struct module_kobject *mk = NULL; > > ...to be here. Done Arnd