Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1148421lqp; Fri, 22 Mar 2024 07:03:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVe4KEEzlnY0a57sgcHCtMaXG+FDdKRdzTqf4wia8ev/pCa8k2whx5su9jkKba7LlqWM3okoZpRSMEStoUK6WW4hoqhVkTT57nmJxAx0A== X-Google-Smtp-Source: AGHT+IEXNbCr+CKkg9EmoUpTgx/GlXn6G1MjphQEpM0jFB4KduFGrRpiHcqBp5+qIgQRHwa/jU57 X-Received: by 2002:a17:90a:df03:b0:2a0:409e:368 with SMTP id gp3-20020a17090adf0300b002a0409e0368mr939597pjb.3.1711116194276; Fri, 22 Mar 2024 07:03:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711116194; cv=pass; d=google.com; s=arc-20160816; b=bKrm1NyJIOiugQJCfMAKiaT6yVcwxBd/Jnrph4pjCNc0TCR9WiSiCq2b35lHlg04Rg IMEuGZ48f6w0Zef716muhYf+0Rf82qKxnys5U55E1TAbbQodagQ8fVkTCedmouf8at2H GjMwCskIFyWtc89YGriJIMLuLekNYJY/6AtcU7slXMpTHSUvrL6lFcu5luzFuR53c0ys Fd7kJUaGNKiHp4hBLoE2gA3bux5xyIHMwhvAK87G7IjBOsNVBcTE+/fa90g3bE2355n1 0F9FK3y8uXyilFV/KvTMUZgkowSEXh/VZhK0zdLZyPQfMVtEmmzy5gu3DxBpdufDs7N7 vQ8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=60EZoCaliKRpmmDItTZzreTHqhEk7bzsxmTU1aydUD0=; fh=t+K/9lefMhZOdauPSvOP1anRNp+UWZW874wYfMoe6iY=; b=Aa/ij38URDVB/QU1CYaY+sqiNPxP3FY2mTpBMhCkd6I7xeylz3YvsLHL2T2u1xKvBF FiY4aQ+aNgqhPGYFSsr2A/5wsrR1089VOavTJQBfUNEV6+vEv1DIz2NqbZcag1BEzwKG p1dmdLqUdvDm3k0Fcn2rp2N8iIgCwxvCW22horoUHoo0JKVsHRu+cVpoSQ5mtnplVxew 8EOuarEYly8cY0VcuI0q37XVo427K93AMH03Ll026vK/2KKYDuagvCieK8HpJybcnEY2 wdcWLZO+IasGP8TvCqG/kq1nAuZz7PVaQbhbP4wbdAQz8aqEX3RF0u0K/4igb43Ox/t9 r3DQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IVexsGSj; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-111565-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111565-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id pi6-20020a17090b1e4600b0029dd77f6feasi2160458pjb.54.2024.03.22.07.03.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 07:03:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111565-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IVexsGSj; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-111565-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111565-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 1EBAAB21593 for ; Fri, 22 Mar 2024 13:47:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AC7F845BFF; Fri, 22 Mar 2024 13:47:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IVexsGSj" 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 8DEDF3B2AD; Fri, 22 Mar 2024 13:47:07 +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=1711115227; cv=none; b=iYcUBosjpB1Y1rF/fCLhWUtTwxEN7ocSi6nwEs7+tvBf1za6eqgza1N34WG+yeGb9UDha96VQ3RVxgS60SfxyO04QXhJILvEJDYk+tuJsMP4TNZD9x+Hjd8QBxX3bxK58Yc/X8Y6GlCu6FWO//JNM6yZb0BkSxGNF9msmxwtnNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711115227; c=relaxed/simple; bh=s3azQ8hw9tbONDOE3SHRMvTzgqDXLaEClwuAjV8vnZQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ulbN86QmhuFEiaIteXRvtFv352sxSb02UzWtG9J/xLjsiR7IYHONhcck4KaGlrarbtrS8UtoqWSyiSt1S2dKKbhsn5KsVEe77EUllwKqGUcyNFB4vGf+Yv86T81gyC8nOB7taR1BOTqGI/MZHxfK9F9PEgBDmbKukPLbhYaH/Xk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IVexsGSj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 838CBC433C7; Fri, 22 Mar 2024 13:47:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711115227; bh=s3azQ8hw9tbONDOE3SHRMvTzgqDXLaEClwuAjV8vnZQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=IVexsGSje2RXC0xRat8lqPLOX9S0ZFGeT6dF1V+6QH1rtqCDW+uNwpQBVok1r26yD 7wEmS1Otg+YNp+pjfOVh+ZpAI1tD81+IUz9ntpA4jzJWOUhle99drUtrY5wgcqtrJn YoZYrgA7Y2s+zUYwB3UsQ6yMWYdBMluby9K5Iazk= Date: Fri, 22 Mar 2024 14:47:03 +0100 From: Greg Kroah-Hartman To: Arnd Bergmann Cc: Luis Chamberlain , Arnd Bergmann , linux-modules@vger.kernel.org, "Rafael J. Wysocki" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] module: silence warning about unused 'no_warn' variable Message-ID: <2024032224-equator-calm-5f3a@gregkh> References: <20240322132014.906097-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240322132014.906097-1-arnd@kernel.org> On Fri, Mar 22, 2024 at 02:20:05PM +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] > > 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. No, let's fix this properly and unwind if we can't create the link. You are pointing at something from 2006, so I guess we always thought "this can not fail" and never did anything about it since then. thanks, greg k-h