Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2948039rdb; Tue, 13 Feb 2024 02:04:16 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXsKZeXasOWoHujlaSfAgaOBd6MR6KxREf9Qtz4JJ36CSWsuhGj/xbqQyIq5bNDYSWv7Gafm2X/d6cU/NnkpDSMSYf652et/unbWFhv6g== X-Google-Smtp-Source: AGHT+IG81k7gFecYv8hWxlBHOc7fVPII7suBn4cysee/BILS03mpshgIPha5nmcU7t3ptArasxHT X-Received: by 2002:a17:906:134d:b0:a3c:ccb9:e472 with SMTP id x13-20020a170906134d00b00a3cccb9e472mr2790873ejb.27.1707818655964; Tue, 13 Feb 2024 02:04:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707818655; cv=pass; d=google.com; s=arc-20160816; b=calThSDXfLzFCqggvuJ0Z1BcJikH4bfS731k81Ubc2ZtMVa9xG2xjJ7yU5wB4xzfgE EcHnNdJRgIKplrqG/YFVfGhQRMeK4ZcZlJSRHCYFMR98CSaV3fLWXnhwi/YBAK97dQ75 WgMOCbAFbmA8i1GwqhBfiH3X6rnpeVKw+uK9zNGBMauwtxpXIYx6ew64TPdqP2vzA9lT xZuy9ErC/lwWIXGK/PK46c6VkoGnODd2504+JbzhwPdX1LCrx85PhkPA+9XZmS1X3igl bUWNE/NQV58I/W7+cQZPEsdVWvUKxP04TX8YuSvThYkTJHcbAp4KmiwCvLzhVKyJVgdb qNXw== 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=cqRDeYC1j0yuZ1WB/1vqEBRZDrNDOrnVwjJxfP9Fwi0=; fh=OvphTj7VEeQTXjapI2QVNHj96lAXPqR22Od2qUNgKoY=; b=UsKd34fUnS0kwvWNo4YxrVHuc4WKGVCds5oZcmorskMEo0EAFrfKSutcwAC2LKhtHP mVxXKaK3mlNrR6yrslJ/tj6mr0wTRYs7n2LJAeLdGr2zd0CgTZ1bzSXULVDTJ0w8zCsi 9z7JH8DXfSiHIR0nhMwdKbcy6SeZj1pRTZSM44jKcmt+t+CBHKr6aSj37pF0v6rq0yuw RuiyLsizVqbkl8En2uZmCjd6UA6o5jz1fyJVxBPwf+N25vMpgMhAPAQU4CPRAY4i+QRi U5ZkewBM83A+NEE08b2zjvFFALpE3YlbCOSeHOF9mpOhdDlIQ8+V2bUQSDwM9t4Xfc8m 1H9w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=S7OXrFkF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63299-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCW9an7I3JWisg9VllNUNB/BbC/B+MKoDriTBYQRhnCIDcMS9iD5BtuEyT4L02XQA4ICOHBzqzmEHiScCroExVw5hCEUXq0H1PM4Gz4ZBA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f22-20020a170906085600b00a38285ad843si1134627ejd.554.2024.02.13.02.04.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 02:04:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63299-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=@kernel.org header.s=k20201202 header.b=S7OXrFkF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63299-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63299-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 am.mirrors.kernel.org (Postfix) with ESMTPS id B32781F214A0 for ; Tue, 13 Feb 2024 10:04:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 13CB7225A4; Tue, 13 Feb 2024 10:02:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S7OXrFkF" 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 3F6D8225AD; Tue, 13 Feb 2024 10:02:43 +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=1707818564; cv=none; b=NJTKzv7bbpBuPFOgrgkEsD9zwORTnSG6P5mfBc4umbHkabMGo7U97MOTMWpL1nVLaOgd1nd6OnaHFUAEHEsLOyQslS7gb5uJLD7COmygMUqruft86u+/ipvB+7gi3lS0sW4WRcju11nwOMSWFcKZcQCaoiyBBMzxlaxlfIgEZMM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818564; c=relaxed/simple; bh=PoqpGDtl2PNN6stViwRE7OniT1lnZ+4h8gX5yvog+rE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=GOaCmLFaoeeXTz0ROpv1S10LY06iadSt3BjM3yCM1tbkJepUpntSSG0kpG2qFuYgAmeLQ6rbvldXdVffBFsG12Uq17UlUD79uwcBcTwLaMWJEznucRXn2a/FEVae3ohSSCJ1sSM3alzmclgDgA6Ok6xHJ85wnTxs+qFUFxbW/tk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S7OXrFkF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A3B67C433F1; Tue, 13 Feb 2024 10:02:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707818563; bh=PoqpGDtl2PNN6stViwRE7OniT1lnZ+4h8gX5yvog+rE=; h=From:To:Cc:Subject:Date:From; b=S7OXrFkFbOzm1aNy2U+MLDP9ayyBBmRGmQfSVM8f1Tif1Y8g9elXuZPfh2PUVEYwY BjYNxTJZe0dHRrM9RKHACdg6U6p+cds+ENiAkUyGzmgrlMv6DKThg4eC83XSXtC1Lh LK0IEdGdtyFc3PpyhG29mXS0z45PYM7eO6gi1x9QLgHvYDNc0WYtJIX4WG4XSb+t1s Iyzn8gQ+Tm8dk9GKE+yHB40cV50q2wFDw+oF0gxTJvvACP+ZYaymwxiObS6XYUV+0U YjfnWengG31dmMXad3PNOu1ituvRuWAOr8lwXFTItyePpDRSWHF7L0Rfru14aWT6kt 1SKHmmbDTdmeQ== From: Arnd Bergmann To: Jean Delvare Cc: Arnd Bergmann , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] firmware: dmi-id: add a release callback function Date: Tue, 13 Feb 2024 11:02:17 +0100 Message-Id: <20240213100238.456912-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 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") Signed-off-by: Arnd Bergmann --- 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