From patchwork Tue Feb 13 09:57:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 200315 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp432769dyb; Tue, 13 Feb 2024 01:59:37 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCULSdOD2fgDj+9E5s1Hl0qniFHmq5btrJLUIgIiSA+yGbVADdm6VynzI4HwAHHOchI/F9HSnIFfUox9hVaY4OAoLiyz/Q== X-Google-Smtp-Source: AGHT+IH5KfDFgtgwSoiqm5rZ1DVzMCIBCMgSoLk71MJr+/IVwWCcrKZOUPLpANyX4pduL3+ajHI1 X-Received: by 2002:a05:622a:1a0c:b0:42c:7fe9:9edf with SMTP id f12-20020a05622a1a0c00b0042c7fe99edfmr3060317qtb.30.1707818377590; Tue, 13 Feb 2024 01:59:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707818377; cv=pass; d=google.com; s=arc-20160816; b=Bu9q8KrVFmnefXTzlh308vfFbZypgoyDAlFGJ5puqzQaGFwf0ykGyrDEY2jeeiXZ8m +fr2hITdrCRoEwrGSqLmOSMSEm0g7KiI7Tha20tXiSHJU0LEB0oZANKzScG00e7oiDDO 88CQKL1PdmYdtpLTVt83z/CrsVhu82N7ribdc3jUa4tGEUg6htjUCLE5QCgBwxKKo/AN JvdVmX52VlNZRsgbjhE/0xG+TzMEGBt0W3LQBev0px6cJFGYXGKHMaS+M5cHhxvl/3rk rsZLPHzFm5Bs16zHGVT+LGKQ4LyXdGPYqB40eLuysKsqOzwfhIFu3qgxZu5pJtSR22hr RwLA== 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=6noDLLXGK0QNemnr07WGrJQ2KoYnpnwq5XzOzKaUnis=; fh=b5K1posid2OlS014S1A8z74dre7qnNfL0qbgsFhQqWg=; b=rWszFeJ2qJQ1U+NxrU4IyMYL21gAFg9FSzctc7xLrXOe0r11HwmE93teWD2pePIlt/ 7OC7twQvDx5bSR7nd0UlCl6pt7wOm/9yXm+tzzff39ZFtiut8v3bTlLXMAEfRTONea9g +v/qRMiGdHsd8vJwcTW74zjEOi8A+jsoNiZ4Kgw1Qup6L7CCmgtzdlz7bU4A2824qCNh ggfkcYjoJUt3KQvOBE8eaoI8j9Non61DXWFLhveKnAOecr8moXOcjtKWIGszMN7BoGat 1Uoa4Wu2uIs/IHUr0bYGdEn9IQ5v59qQZDej9WTGKu8olMgVFp+BE9GD7ZJKpZHdMkAu 2VdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZD68QcUv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63286-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63286-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCWBZB4w1PerPtGd4owfPFe+0NKZd02H1XcPDqy4icT76drn/gYTus3YYNo2WMfuDUNcN/Ybaq6uVigif3I5DtKzhsLj8A== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id f13-20020ac8470d000000b0042c2ada4b7dsi2316482qtp.749.2024.02.13.01.59.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 01:59:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63286-ouuuleilei=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=ZD68QcUv; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-63286-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63286-ouuuleilei=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 61E701C20849 for ; Tue, 13 Feb 2024 09:59:37 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7BB43225D5; Tue, 13 Feb 2024 09:58:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZD68QcUv" 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 CC07D224C6; Tue, 13 Feb 2024 09:57:59 +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=1707818279; cv=none; b=rTx9pxTsNXN+OtZ/lAvYx7rKmmj8hmtVilO7XvL8FkuqM0ctvGKE/arNaFcRkKbETSnyFV/P+EcP2kDVF2Jmex5H3I3d1C46kOK/PaFvKH4qPrFY8AaeofIbIi+fcb1Th4maVSvYXsyoPwaNZ3PSZm+sw3MRZ3zaklwYylmqv1M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707818279; c=relaxed/simple; bh=Glcc2MGW7elmBxt2g9iRaVB3TCJHQ7FpBrYtJp1jN/s=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=meD8I7EQcGs4CGAEcYFJy0reMw1mPI9NX8UHrVt6r/KGep/dpDesYmFRty2I+X/Wjg7T5ijLA2yO70Lge8bpYUeCvSuTHem8LyVO00Bs2MQDSL20cZuxlGf3VVyT5WTPLhQju5YH6cIjnQkTrsIj3kXPUy22svRgae/msKwRW7M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZD68QcUv; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2E178C433F1; Tue, 13 Feb 2024 09:57:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707818279; bh=Glcc2MGW7elmBxt2g9iRaVB3TCJHQ7FpBrYtJp1jN/s=; h=From:To:Cc:Subject:Date:From; b=ZD68QcUv2ZwGhDjFT+aX2PpfQ0DNORu4GNAQoEqkZcUP5+/AKgE8mLG6d5P+Ala/2 JgsEzVcOHxTLoiZS/JJa0v+ed59naCZ+hJgCDf/8QvC+C8+QfIXm+SnV1ol1EfdYgU 69ueNLZZTxa9OsqmWkri/TRLM7yaydQIeYZDTIMQqGfqV+XiCEQo3nf3oJaYUvwT6D hx92u6Dd/yAG6nP2/dJ5Je9ptkKV4AGtYYCyxqNzOYkLgZReLTChxkUMtJ4dSIszum kUZ0r1tK7DZoezWKznY/o55nG1ArKoFbSH/fWYOxK/rliNgBuPgNX/ech4pFC6lb1Q APD1uBMpOdQmw== From: Arnd Bergmann To: Karol Herbst , Lyude Paul , Danilo Krummrich Cc: Arnd Bergmann , David Airlie , Daniel Vetter , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , Ben Skeggs , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: [PATCH] nouveau: fix function cast warnings Date: Tue, 13 Feb 2024 10:57:37 +0100 Message-Id: <20240213095753.455062-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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790777362854426478 X-GMAIL-MSGID: 1790777362854426478 From: Arnd Bergmann clang-16 warns about casting between incompatible function types: drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c:161:10: error: cast from 'void (*)(const struct firmware *)' to 'void (*)(void *)' converts to incompatible function type [-Werror,-Wcast-function-type-strict] 161 | .fini = (void(*)(void *))release_firmware, This one was done to use the generic shadow_fw_release() function as a callback for struct nvbios_source. Change it to use the same prototype as the other five instances, with a trivial helper function that actually calls release_firmware. Fixes: 70c0f263cc2e ("drm/nouveau/bios: pull in basic vbios subdev, more to come later") Signed-off-by: Arnd Bergmann --- drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c index 19188683c8fc..8c2bf1c16f2a 100644 --- a/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/bios/shadow.c @@ -154,11 +154,17 @@ shadow_fw_init(struct nvkm_bios *bios, const char *name) return (void *)fw; } +static void +shadow_fw_release(void *fw) +{ + release_firmware(fw); +} + static const struct nvbios_source shadow_fw = { .name = "firmware", .init = shadow_fw_init, - .fini = (void(*)(void *))release_firmware, + .fini = shadow_fw_release, .read = shadow_fw_read, .rw = false, };