Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3384714lqp; Tue, 26 Mar 2024 07:52:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVn2d1SV2sUD6148NzR0LaWQisn5HLIhpmXaElhLHuvD2zeRRvriJLRDaYjEJKdCD8X5CgjOb6qIGWaylWWaqPMFnF1YByc0TbBoV7cBA== X-Google-Smtp-Source: AGHT+IHnNDXzQJxR6x8TWMImY/bAh/YZv1Omu0QOjaGYnW/I9TKkSt0K8Q4yY1tMPCSKS4gczbgs X-Received: by 2002:a17:90a:f411:b0:29d:fb99:7dcc with SMTP id ch17-20020a17090af41100b0029dfb997dccmr2460169pjb.18.1711464763840; Tue, 26 Mar 2024 07:52:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711464763; cv=pass; d=google.com; s=arc-20160816; b=JaDSEQy8dzoDtjscYY0eZ0D1F271DC8aIZ5P1oY6hYI3N0Cf4nL8Aqpi1uoyn2nKRL 99e4p08487i4v5WaCxzgCIxKiD9SuEFzN3Svi+GSimXTW1qDPizPvF7qitVB9QOG2+zi 4oxZwg99XDVtTr03US+rWYYgXec9LD1iZkMxgzTTkYdOue+mtM4k3N/yZBjj+pDXwkoi yntmNPl54kCunWSJzyXi8deSMA3o/VVIyZdEnuGlQpsS8XAlwSjmnKwAjoSR0j4nSrpu SC802n4NpjosW98vV8Q/G2LW/7IgD60wujNO2rjJ42SHRmqmrZw/FsiE3X0BHTg/qahJ P9Fw== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=aa9eEGRZPrZIHMB7/1ofgr0GhcPwKyfzXF+xhLvcN0M=; fh=ltVrkYRQrjvlnHtyh5936T3WyvTxfTeJkY/0AwldTTM=; b=MRQclww/dxFkJTpyS3xzPMhF5Zt0Fx8VHd9IGGhq5k6+fI1BP3XmXUN9CERuK4k9zH FW3VyT3fc1i+6wOFNc/ZjkM7gSp0+T51TMhH9Vyyp1QqWjJeaqhA1ouJ8+7yNJrjmPw7 cyoZ3HMkjMn9G8cKmdCKBnFBXvKPFPO4wKqDir9HKTYhX2+hG/r84v2gCMDJkhQTYJoI BW8Kmvc8GKeOQyeKC4B8bmWJ2BnErxqyb3EpSLffJJo2dHmaMF1rOky1Q/uMkOePhcRW 06WTXF4R+afa4iQ9g4yNg6F4uYR1AB19HAi7yI10JnNW1H8QlGVGrYBa7tWdw37HX5F8 zDaw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cUbmDVlb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id o4-20020a634104000000b005dc8961f39dsi9753175pga.69.2024.03.26.07.52.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 07:52:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-119223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=cUbmDVlb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-119223-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-119223-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 6DF35304F11 for ; Tue, 26 Mar 2024 14:52:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8A87713C694; Tue, 26 Mar 2024 14:52:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="cUbmDVlb" 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 A659013C3E8; Tue, 26 Mar 2024 14:52:37 +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=1711464757; cv=none; b=sVzkR/TWo2wicLbHD4wX6YFsgiBgQFK/Adq0UY6cPgS2X0z4KBpk/QWxPn2NFlJ5vX76mA0cQrf3Z8sPaiHJV0uNcmqfj9bahqsUcZNB27EkaNhBSqPGD9J0s9dD+iyrZGNtQpYDOtoWM6pe7warEewuk3fpS4VFMHAFYvqrLv4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711464757; c=relaxed/simple; bh=9Zh9r/IExbwuD6PUJoYWn+L19V/xILVXS9xvRzthMQY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SipAG1QgB23zZPHnSB0x5T4sy5HzPl+pj1dE4006o0V9JHDVbQgOWOoKmmbiJNc1WJh8zg+cm8ppG4Cqr3GyiPcdEhhO/vleKP0xH6isoaO40mO9n/wyJoKhhsg7FsrVQlLuZzKreSiQmRH8oZMujy6sBni2Jgb9MrrXAKWNwlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=cUbmDVlb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0A2AC433F1; Tue, 26 Mar 2024 14:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711464757; bh=9Zh9r/IExbwuD6PUJoYWn+L19V/xILVXS9xvRzthMQY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cUbmDVlbj2He+YwrB/NnIPO9G2q7g7VXGpKRaC9FlE7V/XKaIdf46bvyuAYXOsavm TB+dOCV9RYMJig9OEsF/vF6vUHGno2xQXaH5D4lrnblzQrsDj30D1WCJVmoAEBtP2V KIrbEcxFW/pgv3xr03HR86mncXQBTlOZ6XWkiikodaW+y0JgaovV8hCP+zbeEsacrn Scb0CuKcRAqc+PH4Ooh5fE/e6KURL5ZcT85/JDUjhYaj2RH4ztlXB83iOc6HN+Y+hw I90F8Sn//jAHHMjulbYqVx4d+nnNVoII9URgQzzDsVDP1j4non1RIf9DGEMXTkGh6B fWOzUYBXsC1Vg== From: Arnd Bergmann To: linux-kbuild@vger.kernel.org, Masahiro Yamada , Jean Delvare , Nathan Chancellor , Greg Kroah-Hartman Cc: Nicolas Schier , Arnd Bergmann , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH 05/12] firmware: dmi-id: add a release callback function Date: Tue, 26 Mar 2024 15:51:30 +0100 Message-Id: <20240326145140.3257163-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240326144741.3094687-1-arnd@kernel.org> References: <20240326144741.3094687-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-Transfer-Encoding: 8bit From: Arnd Bergmann dmi_class uses kfree() as the .release function, but that now causes a warning with clang-16 as it violates control flow integrity (KCFI) rules: drivers/firmware/dmi-id.c:174:17: error: cast from 'void (*)(const void *)' to 'void (*)(struct device *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 174 | .dev_release = (void(*)(struct device *)) kfree, Add an explicit function to call kfree() instead. Fixes: 4f5c791a850e ("DMI-based module autoloading") Link: https://lore.kernel.org/lkml/20240213100238.456912-1-arnd@kernel.org/ Signed-off-by: Arnd Bergmann --- I sent this before but got no comments for it --- drivers/firmware/dmi-id.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/firmware/dmi-id.c b/drivers/firmware/dmi-id.c index 5f3a3e913d28..d19c78a78ae3 100644 --- a/drivers/firmware/dmi-id.c +++ b/drivers/firmware/dmi-id.c @@ -169,9 +169,14 @@ static int dmi_dev_uevent(const struct device *dev, struct kobj_uevent_env *env) return 0; } +static void dmi_dev_release(struct device *dev) +{ + kfree(dev); +} + static struct class dmi_class = { .name = "dmi", - .dev_release = (void(*)(struct device *)) kfree, + .dev_release = dmi_dev_release, .dev_uevent = dmi_dev_uevent, }; -- 2.39.2