From patchwork Thu Feb 22 18:00:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204921 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp112798dyb; Thu, 22 Feb 2024 10:04:44 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWtvrABOvELf88Yqy9WEd0D9KOlx+D6csEARpjVUiv/HLighqphLkl/MOSiu4zOPSVwf9o0FK8A1U4iCW/+ypaTUV20Vg== X-Google-Smtp-Source: AGHT+IGgiJki538qb4shR3ZKk1jYwFiPW51ZeDuTDCPzdR1/PGs7zlP9YapxYn7ppvU5FxyldbkP X-Received: by 2002:a05:6602:2c95:b0:7c7:4061:1323 with SMTP id i21-20020a0566022c9500b007c740611323mr18326168iow.12.1708625084019; Thu, 22 Feb 2024 10:04:44 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625084; cv=pass; d=google.com; s=arc-20160816; b=UrkFURyRmh+OMIvBtkx3sduJE8qGu/uvxsI/YPE0+GcSAV+Tx9BCVZtIAfKrgQ5tAC rwk73o16euwOBEZD3pbqd1ey9Y6E+i79QWV6pb/h0f8eBVNHIh4Cn+mIlYPgcWfcPJ4Z MldB9je4WLjNUzCi6CI3loCCSW2OR0Tw6BBhmb39CX+PR49Uc0e43tziFF3srqTPhMZK 3uyc0+nnjRduQ7EeZyoPn1/SF+/SIdL9X6kZgpGSdMcpEek6GU7YFn7BfsbTEO28JnWq PwwzmC80V+XJWFomZOWYrVjYn/LtxMgdOPVXCLrMPH13wYytzuShZ+GPRvQwGCWVl33K TPyw== 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=2oOJN+KlMCgqc/dt8oiHJLksH27lD5aUFyLRA+1xMcM=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=Zw6hF2T7uaHoRcEreIcF1dOLyrivDIjSOc5ueedYUi60w282LOkcXLTOD39Re6Yd41 +hOTNYcaa/iZQFlVatvnLmGPIrY9ohbAcdaCaZoiMzrm6serlDIvRfdYse2N0JIzJ7wZ mgSyQYUF1RYfTUPebTqMC0dby4PNxwm2+A6pGHSApPypU362YtyTogroBUDSOHgukw6D rViw1dw7OcYHCsVuZ564oOPIprkMpTihgVLtXwEJEakYZ/jY4LH/e2IxJjXi+iXbK0jO CtVaccEJzaUCZq8m9zRcNt29fvunYZg5fRZHLQXdS+lLoPLBYp823Z3Ebvxltrjs8eUb KeYQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MhbNbS9t; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77029-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77029-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v22-20020a05663812d600b00474509f7756si935128jas.189.2024.02.22.10.04.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:04:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77029-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=MhbNbS9t; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77029-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77029-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 88D7E28694F for ; Thu, 22 Feb 2024 18:01:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 22935157E65; Thu, 22 Feb 2024 18:01:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="MhbNbS9t" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 03BAE14900B for ; Thu, 22 Feb 2024 18:01:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624868; cv=none; b=p5GC0WK9KplOKb4wiyrcdiU8sArO7h+SfasbAJWbFPtMQOqvwhJf5lHyQugtw4wsicfUllQJGD671DuaWsmYOrZ3A1xWKHhg3Y6ryClmw5m/e5k6zVcB3RS+oYV5XEw5XDqiAKhcC/8lEiyklDrPabcf+cRlc5jPijLsW2dO31E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624868; c=relaxed/simple; bh=0wPvoAeCpIhFyI99ib8KnWgxwHnATtwrLoUCe3nCOHw=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UfxHeaThJRVINgW1xkSAXrpy5HGBwWWk8TgO+eK44K6zgJqFYuoIPb9URCB+IAbqkmFkqo9HZaqN3VvSuMvh/6prslwwy0O2NREq4NoAg7CZvV1EjnZyD6Y3pxYRN8X/CLbTe50GRPm+0jEzOearzV5xf0pRcbwUisGkLjcU484= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=MhbNbS9t; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MGtKnl005491; Thu, 22 Feb 2024 18:00:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=2oOJN+KlMCgqc/dt8oiHJLksH27lD5aUFyLRA+1xMcM=; b=Mh bNbS9toyDwwh1UePpvj9aZMVub8XlWBYpTS8zOfxdXjBZOTDz19HJEnEzWuxP0cs CqSJpsjAC0t+O0U08rtEailohsYld/Qz+szedisQHqOZwEWS+dwmolUqwE4y3736 tkchv4nzEHVuRzq9F5bnzy8JuMXoOIHU1yCcU+TPsb/Li5p6uNtKkxTNXZf7fQBt UbVvcrCXPm2wWy3fU+Y4iNZStQ857Usq5bz0wCcEb/9oZE4oQxIVJjon63cINzMp nxykiMZxL298sYY1S2E0W0RgvtoHXAgsrQKls+lVVD70x2Gox7Eh4lOy6KhBamOA rDXtA+WMEtqQoUgMMLKw== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wea7crau6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:00:59 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI0xYx016064 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:00:59 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:00:56 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 1/8] firmware_loader: Refactor request firmware lower level functions Date: Thu, 22 Feb 2024 23:30:26 +0530 Message-ID: <20240222180033.23775-2-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: OXfnhS_-R6U3g2-8LxHC28-ExGFin0qa X-Proofpoint-GUID: OXfnhS_-R6U3g2-8LxHC28-ExGFin0qa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 mlxscore=0 suspectscore=0 adultscore=0 impostorscore=0 malwarescore=0 phishscore=0 spamscore=0 bulkscore=0 lowpriorityscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623256016133186 X-GMAIL-MSGID: 1791623256016133186 Refactor low level api's to do code reuse. Signed-off-by: Mukesh Ojha --- drivers/base/firmware_loader/main.c | 88 +++++++++++------------------ 1 file changed, 34 insertions(+), 54 deletions(-) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index da8ca01d011c..645d658facae 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -739,7 +739,7 @@ int assign_fw(struct firmware *fw, struct device *device) * or a negative error code */ static int -_request_firmware_prepare(struct firmware **firmware_p, const char *name, +__request_firmware_prepare(struct firmware **firmware_p, const char *name, struct device *device, void *dbuf, size_t size, size_t offset, u32 opt_flags) { @@ -851,9 +851,9 @@ static void fw_log_firmware_info(const struct firmware *fw, const char *name, /* called from request_firmware() and request_firmware_work_func() */ static int -_request_firmware(const struct firmware **firmware_p, const char *name, - struct device *device, void *buf, size_t size, - size_t offset, u32 opt_flags) +__request_firmware(const struct firmware **firmware_p, const char *name, + struct device *device, void *buf, size_t size, + size_t offset, u32 opt_flags) { struct firmware *fw = NULL; struct cred *kern_cred = NULL; @@ -869,7 +869,7 @@ _request_firmware(const struct firmware **firmware_p, const char *name, goto out; } - ret = _request_firmware_prepare(&fw, name, device, buf, size, + ret = __request_firmware_prepare(&fw, name, device, buf, size, offset, opt_flags); if (ret <= 0) /* error or already assigned */ goto out; @@ -932,6 +932,19 @@ _request_firmware(const struct firmware **firmware_p, const char *name, return ret; } +static int +_request_firmware(const struct firmware **firmware_p, const char *name, + struct device *device, void *buf, size_t size, + size_t offset, u32 opt_flags) +{ + int ret; + + /* Need to pin this module until return */ + __module_get(THIS_MODULE); + ret = __request_firmware(firmware_p, name, device, NULL, 0, 0, opt_flags); + module_put(THIS_MODULE); + return ret; +} /** * request_firmware() - send firmware request and wait for it * @firmware_p: pointer to firmware image @@ -956,14 +969,8 @@ int request_firmware(const struct firmware **firmware_p, const char *name, struct device *device) { - int ret; - - /* Need to pin this module until return */ - __module_get(THIS_MODULE); - ret = _request_firmware(firmware_p, name, device, NULL, 0, 0, - FW_OPT_UEVENT); - module_put(THIS_MODULE); - return ret; + return _request_firmware(firmware_p, name, device, NULL, 0, 0, + FW_OPT_UEVENT); } EXPORT_SYMBOL(request_firmware); @@ -983,14 +990,8 @@ EXPORT_SYMBOL(request_firmware); int firmware_request_nowarn(const struct firmware **firmware, const char *name, struct device *device) { - int ret; - - /* Need to pin this module until return */ - __module_get(THIS_MODULE); - ret = _request_firmware(firmware, name, device, NULL, 0, 0, - FW_OPT_UEVENT | FW_OPT_NO_WARN); - module_put(THIS_MODULE); - return ret; + return _request_firmware(firmware, name, device, NULL, 0, 0, + FW_OPT_UEVENT | FW_OPT_NO_WARN); } EXPORT_SYMBOL_GPL(firmware_request_nowarn); @@ -1008,14 +1009,9 @@ EXPORT_SYMBOL_GPL(firmware_request_nowarn); int request_firmware_direct(const struct firmware **firmware_p, const char *name, struct device *device) { - int ret; - - __module_get(THIS_MODULE); - ret = _request_firmware(firmware_p, name, device, NULL, 0, 0, - FW_OPT_UEVENT | FW_OPT_NO_WARN | - FW_OPT_NOFALLBACK_SYSFS); - module_put(THIS_MODULE); - return ret; + return _request_firmware(firmware_p, name, device, NULL, 0, 0, + FW_OPT_UEVENT | FW_OPT_NO_WARN | + FW_OPT_NOFALLBACK_SYSFS); } EXPORT_SYMBOL_GPL(request_firmware_direct); @@ -1032,14 +1028,8 @@ EXPORT_SYMBOL_GPL(request_firmware_direct); int firmware_request_platform(const struct firmware **firmware, const char *name, struct device *device) { - int ret; - - /* Need to pin this module until return */ - __module_get(THIS_MODULE); - ret = _request_firmware(firmware, name, device, NULL, 0, 0, - FW_OPT_UEVENT | FW_OPT_FALLBACK_PLATFORM); - module_put(THIS_MODULE); - return ret; + return _request_firmware(firmware, name, device, NULL, 0, 0, + FW_OPT_UEVENT | FW_OPT_FALLBACK_PLATFORM); } EXPORT_SYMBOL_GPL(firmware_request_platform); @@ -1086,16 +1076,11 @@ int request_firmware_into_buf(const struct firmware **firmware_p, const char *name, struct device *device, void *buf, size_t size) { - int ret; - if (fw_cache_is_setup(device, name)) return -EOPNOTSUPP; - __module_get(THIS_MODULE); - ret = _request_firmware(firmware_p, name, device, buf, size, 0, - FW_OPT_UEVENT | FW_OPT_NOCACHE); - module_put(THIS_MODULE); - return ret; + return _request_firmware(firmware_p, name, device, buf, size, 0, + FW_OPT_UEVENT | FW_OPT_NOCACHE); } EXPORT_SYMBOL(request_firmware_into_buf); @@ -1116,17 +1101,12 @@ request_partial_firmware_into_buf(const struct firmware **firmware_p, const char *name, struct device *device, void *buf, size_t size, size_t offset) { - int ret; - if (fw_cache_is_setup(device, name)) return -EOPNOTSUPP; - __module_get(THIS_MODULE); - ret = _request_firmware(firmware_p, name, device, buf, size, offset, - FW_OPT_UEVENT | FW_OPT_NOCACHE | - FW_OPT_PARTIAL); - module_put(THIS_MODULE); - return ret; + return _request_firmware(firmware_p, name, device, buf, size, offset, + FW_OPT_UEVENT | FW_OPT_NOCACHE | + FW_OPT_PARTIAL); } EXPORT_SYMBOL(request_partial_firmware_into_buf); @@ -1162,8 +1142,8 @@ static void request_firmware_work_func(struct work_struct *work) fw_work = container_of(work, struct firmware_work, work); - _request_firmware(&fw, fw_work->name, fw_work->device, NULL, 0, 0, - fw_work->opt_flags); + __request_firmware(&fw, fw_work->name, fw_work->device, NULL, 0, 0, + fw_work->opt_flags); fw_work->cont(fw, fw_work->context); put_device(fw_work->device); /* taken in request_firmware_nowait() */ From patchwork Thu Feb 22 18:00:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204917 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp111131dyb; Thu, 22 Feb 2024 10:02:42 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWP5hGgKKarBUFBTf42GEU1zT5Ju/W9oIZo7KU+Hxvi0ZePJqnwWKy2KV0hZde9xKgc7jQqzD9AcY/w14sT2qYjvA00Sg== X-Google-Smtp-Source: AGHT+IE/cu8JRXdrwRrb1eJCaGPkwpzu7ej7bbRnSJeg1jYJasPndLH9P34aThD1mbkxGJPEoB4L X-Received: by 2002:a05:690c:6:b0:608:922:4001 with SMTP id bc6-20020a05690c000600b0060809224001mr18596509ywb.5.1708624961862; Thu, 22 Feb 2024 10:02:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708624961; cv=pass; d=google.com; s=arc-20160816; b=GCe/ul9n5HrWEMoe4IW49SxgzzQVxbU8CExzBSqjkO74vAzdziIPMcv1X4lWC/qYt9 4VR86Yt4cI0X0/WGgZqkBB4nHQgJ1EuehodvKtlgiMRqz0ZBqU1/ZPs4UyF3Dhvup3Uf Y3JO0hUfvhuw0XduDhiSK3+9ai3S/dWyD/mjPk56iUfkWzG3Ppr705uKrttdKUJyi7ot /QgF01AxwyHZwT60CWlq3E9BikuoCYe0XULseXwgbrXU6TebQZh+ufJj1Vf9oxvfK9M2 g9AAt50/kGbPysFBYA0Lhve8jboTqUnpwYY/fnK8CKB+kVq43KRqR5WemdQOztak9gqy Jiog== 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=yzfPZ40K2EM64idCJvQoRhRLo+OrI7ETQVCz/2ZJqpE=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=nJXhzcegiHJvyFouqgI6bQYfjzvPfJvhqUNM7pjiyhQZhGDf2OXhvhT9FWH5DvUifJ Qekl+efKvJyMqGCsgl4I3xAmEuob62VwDhkTlsiaTZkSmPk9PkiQBPnaqJo4AT7wzXEP QCMSRT6+ETmPm03Zq1SJH93o8Xd2MafSq2ouxa9WdHFSUfDiTOnBrI1DuXeu32yG0/VR JzRjEoXQSaQEq7+k6D6OlXPAHVozfsejyr/wY2H8ycRZ4NW3bKoRWcjwdsOS7tJPJ/MN QNkC8N13Vo7Tjmyf+txDS1gJbqfjuyMpDVbVdUh/aMv2jLzLymrXYLPeEljm3jlGGkqj tOlA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jiNxN660; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77034-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77034-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id hd10-20020a05690c488a00b0060421a5c70dsi6286428ywb.481.2024.02.22.10.02.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:02:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77034-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=jiNxN660; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77034-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77034-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 91EB21C210F1 for ; Thu, 22 Feb 2024 18:02:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1682B159566; Thu, 22 Feb 2024 18:01:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="jiNxN660" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 E8B3B1586F8 for ; Thu, 22 Feb 2024 18:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624882; cv=none; b=izYc3XUDbOUS2/s7WmCyv7C/x9bw0FYGuWEv86tYmsjU10GD23zW5dotPDwGuytlv6OQ4S9tAbI0wYeC53mmmR0vrPn0fi1cck6uwnpaeCOTmrYMPZWLBI5EhgOWeZeNP76kJCrQVsp62cBwMK0+kijMdj4Pau7XH2yh+fdqBTk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624882; c=relaxed/simple; bh=th9s6yw/+ZCI+/RwbKrTbxk+HzgJy20Rh4Mafx057bk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=NhVy2TLRQTIGgn3hRx2IaMnBq/yNq4QfImVYm9zYoFlHeWDcOzHsnaV4uXylds7PL9M4iePyyk9Rdg3IbEW8AIGsNWjNDHaEOscIqVBOQ9asLcROqRskvFoa3U1wmFkfp0lJrs4xT6p79T3cm8jAk0LIKx066FxSxZ8hANCzRrs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=jiNxN660; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MEp3Bg028257; Thu, 22 Feb 2024 18:01:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=yzfPZ40K2EM64idCJvQoRhRLo+OrI7ETQVCz/2ZJqpE=; b=ji NxN660k3g7wv7cPg3MnD2GI2PkMjx+GFExSHagUYGougOTytTZE1hv5F47abDzhv 680I06OTRXwHK6AahYiau5bp6GBzFi1qi7d1wUUAgCQIBTJ47ySuCjzoRUG4/FL/ T0346yAM8ZxSst78FeKcAgdVSTvky4r045QGjhwGNK33e3O2yCwnJdT8tw9Z9bzm 9Ev/gXI2JgPKhnYXiDf9mLFyRibY+uHG4ys7kCu8YzcWeOmq3b7Dp/BeIJWHpMXs lVS4KqZn9LkkLyovMSB1jh0WGSPLqfn4fV6e9C+dQ1GORREbIG0eM/BxCBEXw99Q nMZVEnRyYanjYKZp1feQ== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wdvwwagr7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:05 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI111a006299 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:01 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:00:59 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 2/8] treewide: rename firmware_request_nowarn() Date: Thu, 22 Feb 2024 23:30:27 +0530 Message-ID: <20240222180033.23775-3-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: Pdgh1tnGUlPnY_xse7YC_5nrFtnY64_X X-Proofpoint-GUID: Pdgh1tnGUlPnY_xse7YC_5nrFtnY64_X X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 spamscore=0 impostorscore=0 mlxlogscore=999 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623127696808705 X-GMAIL-MSGID: 1791623127696808705 Rename firmware_request_nowarn() to align with other request_firmware family functions. Signed-off-by: Mukesh Ojha --- Documentation/driver-api/firmware/request_firmware.rst | 4 ++-- drivers/accel/ivpu/ivpu_fw.c | 2 +- drivers/base/firmware_loader/main.c | 6 +++--- drivers/bluetooth/btbcm.c | 2 +- drivers/bluetooth/btintel.c | 4 ++-- drivers/bluetooth/hci_bcm4377.c | 4 ++-- drivers/crypto/ccp/sev-dev.c | 6 +++--- drivers/crypto/inside-secure/safexcel.c | 4 ++-- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 2 +- drivers/gpu/drm/nouveau/nvkm/core/firmware.c | 2 +- drivers/input/touchscreen/silead.c | 2 +- drivers/media/tuners/si2157.c | 2 +- drivers/memory/brcmstb_dpfe.c | 2 +- drivers/net/ethernet/intel/ice/ice_main.c | 2 +- drivers/net/wireless/ath/ath10k/core.c | 2 +- drivers/net/wireless/ath/ath10k/testmode.c | 2 +- drivers/net/wireless/ath/ath11k/core.c | 2 +- drivers/net/wireless/ath/ath12k/core.c | 2 +- drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c | 2 +- drivers/net/wireless/intel/iwlwifi/fw/pnvm.c | 2 +- drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +- drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 2 +- drivers/net/wireless/mediatek/mt76/mt76x0/usb_mcu.c | 2 +- drivers/net/wireless/realtek/rtw89/fw.c | 2 +- drivers/net/wireless/silabs/wfx/fwio.c | 2 +- drivers/usb/host/xhci-pci-renesas.c | 2 +- include/linux/firmware.h | 4 ++-- sound/pci/hda/cs35l41_hda.c | 2 +- sound/pci/hda/cs35l56_hda.c | 2 +- sound/soc/codecs/wm_adsp.c | 2 +- sound/soc/sof/fw-file-profile.c | 4 ++-- 31 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Documentation/driver-api/firmware/request_firmware.rst b/Documentation/driver-api/firmware/request_firmware.rst index 0d6ea0329995..0201334bc308 100644 --- a/Documentation/driver-api/firmware/request_firmware.rst +++ b/Documentation/driver-api/firmware/request_firmware.rst @@ -20,10 +20,10 @@ request_firmware .. kernel-doc:: drivers/base/firmware_loader/main.c :functions: request_firmware -firmware_request_nowarn +request_firmware_nowarn ----------------------- .. kernel-doc:: drivers/base/firmware_loader/main.c - :functions: firmware_request_nowarn + :functions: request_firmware_nowarn firmware_request_platform ------------------------- diff --git a/drivers/accel/ivpu/ivpu_fw.c b/drivers/accel/ivpu/ivpu_fw.c index 6576232f3e67..11c27fe860f2 100644 --- a/drivers/accel/ivpu/ivpu_fw.c +++ b/drivers/accel/ivpu/ivpu_fw.c @@ -76,7 +76,7 @@ static int ivpu_fw_request(struct ivpu_device *vdev) if (fw_names[i].gen != ivpu_hw_gen(vdev)) continue; - ret = firmware_request_nowarn(&vdev->fw->file, fw_names[i].name, vdev->drm.dev); + ret = request_firmware_nowarn(&vdev->fw->file, fw_names[i].name, vdev->drm.dev); if (!ret) { vdev->fw->name = fw_names[i].name; return 0; diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 645d658facae..cb681f4069b8 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -975,7 +975,7 @@ request_firmware(const struct firmware **firmware_p, const char *name, EXPORT_SYMBOL(request_firmware); /** - * firmware_request_nowarn() - request for an optional fw module + * request_firmware_nowarn() - request for an optional fw module * @firmware: pointer to firmware image * @name: name of firmware file * @device: device for which firmware is being loaded @@ -987,13 +987,13 @@ EXPORT_SYMBOL(request_firmware); * therefore up to the driver to check for the return value of this call and to * decide when to inform the users of errors. **/ -int firmware_request_nowarn(const struct firmware **firmware, const char *name, +int request_firmware_nowarn(const struct firmware **firmware, const char *name, struct device *device) { return _request_firmware(firmware, name, device, NULL, 0, 0, FW_OPT_UEVENT | FW_OPT_NO_WARN); } -EXPORT_SYMBOL_GPL(firmware_request_nowarn); +EXPORT_SYMBOL_GPL(request_firmware_nowarn); /** * request_firmware_direct() - load firmware directly without usermode helper diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index 0a5445ac5e1b..94ebf6113c44 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -672,7 +672,7 @@ int btbcm_initialize(struct hci_dev *hdev, bool *fw_load_done, bool use_autobaud fw_name_count++; for (i = 0; i < fw_name_count; i++) { - err = firmware_request_nowarn(&fw, fw_name[i], &hdev->dev); + err = request_firmware_nowarn(&fw, fw_name[i], &hdev->dev); if (err == 0) { bt_dev_info(hdev, "%s '%s' Patch", hw_name ? hw_name : "BCM", fw_name[i]); diff --git a/drivers/bluetooth/btintel.c b/drivers/bluetooth/btintel.c index cdc5c08824a0..6ec90754a76f 100644 --- a/drivers/bluetooth/btintel.c +++ b/drivers/bluetooth/btintel.c @@ -2057,7 +2057,7 @@ static int btintel_download_fw(struct hci_dev *hdev, return -EINVAL; } - err = firmware_request_nowarn(&fw, fwname, &hdev->dev); + err = request_firmware_nowarn(&fw, fwname, &hdev->dev); if (err < 0) { if (!btintel_test_flag(hdev, INTEL_BOOTLOADER)) { /* Firmware has already been loaded */ @@ -2246,7 +2246,7 @@ static int btintel_prepare_fw_download_tlv(struct hci_dev *hdev, } btintel_get_fw_name_tlv(ver, fwname, sizeof(fwname), "sfi"); - err = firmware_request_nowarn(&fw, fwname, &hdev->dev); + err = request_firmware_nowarn(&fw, fwname, &hdev->dev); if (err < 0) { if (!btintel_test_flag(hdev, INTEL_BOOTLOADER)) { /* Firmware has already been loaded */ diff --git a/drivers/bluetooth/hci_bcm4377.c b/drivers/bluetooth/hci_bcm4377.c index 9a7243d5db71..fd06707a6709 100644 --- a/drivers/bluetooth/hci_bcm4377.c +++ b/drivers/bluetooth/hci_bcm4377.c @@ -1207,10 +1207,10 @@ static const struct firmware *bcm4377_request_blob(struct bcm4377_data *bcm4377, dev_dbg(&bcm4377->pdev->dev, "Trying to load firmware: '%s' or '%s'\n", name0, name1); - ret = firmware_request_nowarn(&fw, name0, &bcm4377->pdev->dev); + ret = request_firmware_nowarn(&fw, name0, &bcm4377->pdev->dev); if (!ret) return fw; - ret = firmware_request_nowarn(&fw, name1, &bcm4377->pdev->dev); + ret = request_firmware_nowarn(&fw, name1, &bcm4377->pdev->dev); if (!ret) return fw; diff --git a/drivers/crypto/ccp/sev-dev.c b/drivers/crypto/ccp/sev-dev.c index e4d3f45242f6..a2ded1f9d940 100644 --- a/drivers/crypto/ccp/sev-dev.c +++ b/drivers/crypto/ccp/sev-dev.c @@ -761,9 +761,9 @@ static int sev_get_firmware(struct device *dev, * * Fall-back to using generic name: sev.fw */ - if ((firmware_request_nowarn(firmware, fw_name_specific, dev) >= 0) || - (firmware_request_nowarn(firmware, fw_name_subset, dev) >= 0) || - (firmware_request_nowarn(firmware, SEV_FW_FILE, dev) >= 0)) + if ((request_firmware_nowarn(firmware, fw_name_specific, dev) >= 0) || + (request_firmware_nowarn(firmware, fw_name_subset, dev) >= 0) || + (request_firmware_nowarn(firmware, SEV_FW_FILE, dev) >= 0)) return 0; return -ENOENT; diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c index f5c1912aa564..791a7ff25371 100644 --- a/drivers/crypto/inside-secure/safexcel.c +++ b/drivers/crypto/inside-secure/safexcel.c @@ -429,7 +429,7 @@ static int eip197_load_firmwares(struct safexcel_crypto_priv *priv) retry_fw: for (i = 0; i < FW_NB; i++) { snprintf(fw_path, 37, "inside-secure/%s/%s", dir, fw_name[i]); - ret = firmware_request_nowarn(&fw[i], fw_path, priv->dev); + ret = request_firmware_nowarn(&fw[i], fw_path, priv->dev); if (ret) { if (minifw || priv->data->version != EIP197B_MRVL) goto release_fw; @@ -437,7 +437,7 @@ static int eip197_load_firmwares(struct safexcel_crypto_priv *priv) /* Fallback to the old firmware location for the * EIP197b. */ - ret = firmware_request_nowarn(&fw[i], fw_name[i], + ret = request_firmware_nowarn(&fw[i], fw_name[i], priv->dev); if (ret) goto release_fw; diff --git a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c index 362639162ed6..205cf027870f 100644 --- a/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +++ b/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c @@ -785,7 +785,7 @@ static int try_firmware_load(struct intel_uc_fw *uc_fw, const struct firmware ** struct device *dev = gt->i915->drm.dev; int err; - err = firmware_request_nowarn(fw, uc_fw->file_selected.path, dev); + err = request_firmware_nowarn(fw, uc_fw->file_selected.path, dev); if (err) return err; diff --git a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c index adc60b25f8e6..febfabb17405 100644 --- a/drivers/gpu/drm/nouveau/nvkm/core/firmware.c +++ b/drivers/gpu/drm/nouveau/nvkm/core/firmware.c @@ -91,7 +91,7 @@ nvkm_firmware_get(const struct nvkm_subdev *subdev, const char *fwname, int ver, else snprintf(f, sizeof(f), "nvidia/%s/%s.bin", cname, fwname); - if (!firmware_request_nowarn(fw, f, device->dev)) { + if (!request_firmware_nowarn(fw, f, device->dev)) { nvkm_debug(subdev, "firmware \"%s\" loaded - %zu byte(s)\n", f, (*fw)->size); return 0; diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index 62f562ad5026..52477e450b02 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c @@ -426,7 +426,7 @@ static int silead_ts_load_fw(struct i2c_client *client) * succeeds we apply an (optional) set of alternative min/max values from the * "silead,efi-fw-min-max" property. */ - error = firmware_request_nowarn(&fw, data->fw_name, dev); + error = request_firmware_nowarn(&fw, data->fw_name, dev); if (error) { error = firmware_request_platform(&fw, data->fw_name, dev); if (error) { diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c index def06c262ea2..64fbb24c0758 100644 --- a/drivers/media/tuners/si2157.c +++ b/drivers/media/tuners/si2157.c @@ -98,7 +98,7 @@ static int si2157_load_firmware(struct dvb_frontend *fe, struct si2157_cmd cmd; /* request the firmware, this will block and timeout */ - ret = firmware_request_nowarn(&fw, fw_name, &client->dev); + ret = request_firmware_nowarn(&fw, fw_name, &client->dev); if (ret) return ret; diff --git a/drivers/memory/brcmstb_dpfe.c b/drivers/memory/brcmstb_dpfe.c index 5028467b2dc9..a6e6412416d8 100644 --- a/drivers/memory/brcmstb_dpfe.c +++ b/drivers/memory/brcmstb_dpfe.c @@ -648,7 +648,7 @@ static int brcmstb_dpfe_download_firmware(struct brcmstb_dpfe_priv *priv) if (!priv->dpfe_api->fw_name) return -ENODEV; - ret = firmware_request_nowarn(&fw, priv->dpfe_api->fw_name, dev); + ret = request_firmware_nowarn(&fw, priv->dpfe_api->fw_name, dev); /* * Defer the firmware download if the firmware file couldn't be found. * The root file system may not be available yet. diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c index dd4a9bc0dfdc..46d9e0f1bbf4 100644 --- a/drivers/net/ethernet/intel/ice/ice_main.c +++ b/drivers/net/ethernet/intel/ice/ice_main.c @@ -4428,7 +4428,7 @@ static void ice_request_fw(struct ice_pf *pf) * and warning messages for other errors. */ if (opt_fw_filename) { - err = firmware_request_nowarn(&firmware, opt_fw_filename, dev); + err = request_firmware_nowarn(&firmware, opt_fw_filename, dev); if (err) { kfree(opt_fw_filename); goto dflt_pkg_load; diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 0032f8aa892f..dc57a4319ae7 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -943,7 +943,7 @@ static const struct firmware *ath10k_fetch_fw_file(struct ath10k *ar, dir = "."; snprintf(filename, sizeof(filename), "%s/%s", dir, file); - ret = firmware_request_nowarn(&fw, filename, ar->dev); + ret = request_firmware_nowarn(&fw, filename, ar->dev); ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot fw request '%s': %d\n", filename, ret); diff --git a/drivers/net/wireless/ath/ath10k/testmode.c b/drivers/net/wireless/ath/ath10k/testmode.c index 7a9b9bbcdbfc..b9f976786a7c 100644 --- a/drivers/net/wireless/ath/ath10k/testmode.c +++ b/drivers/net/wireless/ath/ath10k/testmode.c @@ -146,7 +146,7 @@ static int ath10k_tm_fetch_utf_firmware_api_1(struct ath10k *ar, ar->hw_params.fw.dir, ATH10K_FW_UTF_FILE); /* load utf firmware image */ - ret = firmware_request_nowarn(&fw_file->firmware, filename, ar->dev); + ret = request_firmware_nowarn(&fw_file->firmware, filename, ar->dev); ath10k_dbg(ar, ATH10K_DBG_TESTMODE, "testmode fw request '%s': %d\n", filename, ret); diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c index 0c6ecbb9a066..9d800a8415d4 100644 --- a/drivers/net/wireless/ath/ath11k/core.c +++ b/drivers/net/wireless/ath/ath11k/core.c @@ -1084,7 +1084,7 @@ const struct firmware *ath11k_core_firmware_request(struct ath11k_base *ab, ath11k_core_create_firmware_path(ab, file, path, sizeof(path)); - ret = firmware_request_nowarn(&fw, path, ab->dev); + ret = request_firmware_nowarn(&fw, path, ab->dev); if (ret) return ERR_PTR(ret); diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c index 6c01b282fcd3..d160791019c8 100644 --- a/drivers/net/wireless/ath/ath12k/core.c +++ b/drivers/net/wireless/ath/ath12k/core.c @@ -137,7 +137,7 @@ const struct firmware *ath12k_core_firmware_request(struct ath12k_base *ab, ath12k_core_create_firmware_path(ab, file, path, sizeof(path)); - ret = firmware_request_nowarn(&fw, path, ab->dev); + ret = request_firmware_nowarn(&fw, path, ab->dev); if (ret) return ERR_PTR(ret); diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c index 83f8ed7d00f9..b0451d97b8e2 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/firmware.c @@ -659,7 +659,7 @@ static int brcmf_fw_request_firmware(const struct firmware **fw, if (!alt_path) goto fallback; - ret = firmware_request_nowarn(fw, alt_path, fwctx->dev); + ret = request_firmware_nowarn(fw, alt_path, fwctx->dev); kfree(alt_path); if (ret == 0) return ret; diff --git a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c index 650e4bde9c17..8b3676e87e07 100644 --- a/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c +++ b/drivers/net/wireless/intel/iwlwifi/fw/pnvm.c @@ -231,7 +231,7 @@ static int iwl_pnvm_get_from_fs(struct iwl_trans *trans, u8 **data, size_t *len) iwl_pnvm_get_fs_name(trans, pnvm_name, sizeof(pnvm_name)); - ret = firmware_request_nowarn(&pnvm, pnvm_name, trans->dev); + ret = request_firmware_nowarn(&pnvm, pnvm_name, trans->dev); if (ret) { IWL_DEBUG_FW(trans, "PNVM file %s not found %d\n", pnvm_name, ret); diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index 3b14f6476743..dc139849454f 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c @@ -503,7 +503,7 @@ void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans) trans->trans_cfg->device_family <= IWL_DEVICE_FAMILY_8000) return; - res = firmware_request_nowarn(&fw, yoyo_bin, dev); + res = request_firmware_nowarn(&fw, yoyo_bin, dev); IWL_DEBUG_FW(trans, "%s %s\n", res ? "didn't load" : "loaded", yoyo_bin); if (res) diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c index ae34d019e588..eceaee233993 100644 --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c @@ -1224,7 +1224,7 @@ static int mt7615_load_patch(struct mt7615_dev *dev, u32 addr, const char *name) const struct firmware *fw = NULL; int len, ret, sem; - ret = firmware_request_nowarn(&fw, name, dev->mt76.dev); + ret = request_firmware_nowarn(&fw, name, dev->mt76.dev); if (ret) return ret; diff --git a/drivers/net/wireless/mediatek/mt76/mt76x0/usb_mcu.c b/drivers/net/wireless/mediatek/mt76/mt76x0/usb_mcu.c index 6dc1f51f5658..3e1b0db7fd10 100644 --- a/drivers/net/wireless/mediatek/mt76/mt76x0/usb_mcu.c +++ b/drivers/net/wireless/mediatek/mt76/mt76x0/usb_mcu.c @@ -72,7 +72,7 @@ static int mt76x0_get_firmware(struct mt76x02_dev *dev, /* try to load mt7610e fw if available * otherwise fall back to mt7610u one */ - err = firmware_request_nowarn(fw, MT7610E_FIRMWARE, dev->mt76.dev); + err = request_firmware_nowarn(fw, MT7610E_FIRMWARE, dev->mt76.dev); if (err) { dev_info(dev->mt76.dev, "%s not found, switching to %s", MT7610E_FIRMWARE, MT7610U_FIRMWARE); diff --git a/drivers/net/wireless/realtek/rtw89/fw.c b/drivers/net/wireless/realtek/rtw89/fw.c index 09684cea9731..d3b103419862 100644 --- a/drivers/net/wireless/realtek/rtw89/fw.c +++ b/drivers/net/wireless/realtek/rtw89/fw.c @@ -1206,7 +1206,7 @@ static int rtw89_load_firmware_req(struct rtw89_dev *rtwdev, } if (nowarn) - ret = firmware_request_nowarn(&req->firmware, fw_name, rtwdev->dev); + ret = request_firmware_nowarn(&req->firmware, fw_name, rtwdev->dev); else ret = request_firmware(&req->firmware, fw_name, rtwdev->dev); diff --git a/drivers/net/wireless/silabs/wfx/fwio.c b/drivers/net/wireless/silabs/wfx/fwio.c index 52c7f560b062..3cdc8548a619 100644 --- a/drivers/net/wireless/silabs/wfx/fwio.c +++ b/drivers/net/wireless/silabs/wfx/fwio.c @@ -105,7 +105,7 @@ static int get_firmware(struct wfx_dev *wdev, u32 keyset_chip, snprintf(filename, sizeof(filename), "%s_%02X.sec", wdev->pdata.file_fw, keyset_chip); - ret = firmware_request_nowarn(fw, filename, wdev->dev); + ret = request_firmware_nowarn(fw, filename, wdev->dev); if (ret) { dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n", filename, wdev->pdata.file_fw); diff --git a/drivers/usb/host/xhci-pci-renesas.c b/drivers/usb/host/xhci-pci-renesas.c index 93f8b355bc70..1335e92b76fa 100644 --- a/drivers/usb/host/xhci-pci-renesas.c +++ b/drivers/usb/host/xhci-pci-renesas.c @@ -603,7 +603,7 @@ int renesas_xhci_check_request_fw(struct pci_dev *pdev, return has_rom ? 0 : err; pci_dev_get(pdev); - err = firmware_request_nowarn(&fw, fw_name, &pdev->dev); + err = request_firmware_nowarn(&fw, fw_name, &pdev->dev); pci_dev_put(pdev); if (err) { if (has_rom) { diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 0311858b46ce..5523c9fdc92d 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -97,7 +97,7 @@ static inline bool firmware_request_builtin(struct firmware *fw, #if IS_REACHABLE(CONFIG_FW_LOADER) int request_firmware(const struct firmware **fw, const char *name, struct device *device); -int firmware_request_nowarn(const struct firmware **fw, const char *name, +int request_firmware_nowarn(const struct firmware **fw, const char *name, struct device *device); int firmware_request_platform(const struct firmware **fw, const char *name, struct device *device); @@ -122,7 +122,7 @@ static inline int request_firmware(const struct firmware **fw, return -EINVAL; } -static inline int firmware_request_nowarn(const struct firmware **fw, +static inline int request_firmware_nowarn(const struct firmware **fw, const char *name, struct device *device) { diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index d3fa6e136744..a93dcae244ac 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -164,7 +164,7 @@ static int cs35l41_request_firmware_file(struct cs35l41_hda *cs35l41, s++; } - ret = firmware_request_nowarn(firmware, *filename, cs35l41->dev); + ret = request_firmware_nowarn(firmware, *filename, cs35l41->dev); if (ret != 0) { dev_dbg(cs35l41->dev, "Failed to request '%s'\n", *filename); kfree(*filename); diff --git a/sound/pci/hda/cs35l56_hda.c b/sound/pci/hda/cs35l56_hda.c index b61e1de8c4bf..0390fd6b6eaa 100644 --- a/sound/pci/hda/cs35l56_hda.c +++ b/sound/pci/hda/cs35l56_hda.c @@ -422,7 +422,7 @@ static int cs35l56_hda_request_firmware_file(struct cs35l56_hda *cs35l56, s++; } - ret = firmware_request_nowarn(firmware, *filename, cs35l56->base.dev); + ret = request_firmware_nowarn(firmware, *filename, cs35l56->base.dev); if (ret) { dev_dbg(cs35l56->base.dev, "Failed to request '%s'\n", *filename); kfree(*filename); diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index c01e31175015..072e3e3606e7 100644 --- a/sound/soc/codecs/wm_adsp.c +++ b/sound/soc/codecs/wm_adsp.c @@ -772,7 +772,7 @@ static int wm_adsp_request_firmware_file(struct wm_adsp *dsp, s++; } - ret = firmware_request_nowarn(firmware, *filename, cs_dsp->dev); + ret = request_firmware_nowarn(firmware, *filename, cs_dsp->dev); if (ret != 0) { adsp_dbg(dsp, "Failed to request '%s'\n", *filename); kfree(*filename); diff --git a/sound/soc/sof/fw-file-profile.c b/sound/soc/sof/fw-file-profile.c index 138a1ca2c4a8..819fc846d498 100644 --- a/sound/soc/sof/fw-file-profile.c +++ b/sound/soc/sof/fw-file-profile.c @@ -26,7 +26,7 @@ static int sof_test_firmware_file(struct device *dev, if (!fw_filename) return -ENOMEM; - ret = firmware_request_nowarn(&fw, fw_filename, dev); + ret = request_firmware_nowarn(&fw, fw_filename, dev); if (ret < 0) { dev_dbg(dev, "Failed to open firmware file: %s\n", fw_filename); kfree(fw_filename); @@ -78,7 +78,7 @@ static int sof_test_topology_file(struct device *dev, if (!tplg_filename) return -ENOMEM; - ret = firmware_request_nowarn(&fw, tplg_filename, dev); + ret = request_firmware_nowarn(&fw, tplg_filename, dev); if (!ret) release_firmware(fw); else From patchwork Thu Feb 22 18:00:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204931 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp120813dyb; Thu, 22 Feb 2024 10:15:25 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVNH+10J+vwv/VS/ZVARcne9/GT7Gio4NUZfFIcoZWiJO9V2tvcSSxu12JDkYpjyVBIa2gtWYMe/D1DzUua1XwCZOCh7Q== X-Google-Smtp-Source: AGHT+IH/Zw2VGutld+Aizo8KLnQA0+Vnq25v022WoC5Umv7z1b2IGXXf7vc+zkWOPJkK98zmiPPK X-Received: by 2002:a17:90a:f190:b0:299:3f16:184 with SMTP id bv16-20020a17090af19000b002993f160184mr18854134pjb.34.1708625724922; Thu, 22 Feb 2024 10:15:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625724; cv=pass; d=google.com; s=arc-20160816; b=obN67J8DRW4RLUYOw04JrK2syhrigodCYj7ar+9LuZA4vjcpNrqyG3V+mMz2hpS+jf DDEk6OXkCDs75rNdIGYvLaLHwQlQR03FmiwjkRm3B0X3fz0C1v0p1Gc6EOKNKmYaQ9Xy jU08KsgTuUQ214FZfug7T0N9+kaCM227tp8LAnkck8vUklKJBwaHlsbzg/H7a+BL4s9x cZMs4xlIPwakFlKPkHe8MCiQve3IZeB8WIe48A5VehEHfnK6Cz+j+HwLho13Uy7/OCFB SXV+bJfDCg6krIuqyxmBGQC+7ar+8pxjybJgpu+mKnOnRYi4bk1vl2g4N/cp38QBWBvc nFTQ== 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=SK5JcaC6C9sqBLvgnnhZB613+0SPAB8k6+ie79n5RP8=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=PmSnuiVJYfXS4gZkYdpLylK9vUsFl6CKJs51fDy4fLhKyJ7aq1W70+kswkcBsTDadn UFdeoVwshnblMdT+ur8gKSbrKsRNg7pVGQRscWrhowY3XusLVJIdD0w4arWyY5ica98c IDfAP31ST9VxPSwbxKL2bDfIwj5bNWWs5TY/YJLWmS+t4IIXNSdA9ScvQY1wOzhqIqfG LCUlPOJtx9EE3PR4k4hbTPrGZdkTWKkstFkwEG6Uo5JER2YhtqL9VkZgVnlHweFDP3m5 RkjFEGUILH/RGDM4UBC/oUKBPn8YB/b8eUHXncmasK8dol/9YVzsfZSmB1jll6AE/4VN hP7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=U9Fm7GXD; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77031-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77031-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q5-20020a17090a2dc500b0029897526522si3971367pjm.103.2024.02.22.10.15.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:15:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77031-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=U9Fm7GXD; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77031-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77031-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 56042B2686C for ; Thu, 22 Feb 2024 18:01:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0C43158D60; Thu, 22 Feb 2024 18:01:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="U9Fm7GXD" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 B7446157E98 for ; Thu, 22 Feb 2024 18:01:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624872; cv=none; b=OwPdgo5CCChlkAuTlR8bs/jzwWANl9mlPiqaWlldpMxp6jaaJqdvt+iMpcsZlgnaga63dIjZ/i5BYAcbItKsZW/AeL+EmncZqbLM7xZvsFHWeXnKEdxGoDX0t4xV4FXwXf2J6qjIe9Ls9U1Zwu6s6gdvEGcfEHRdA/MVRSWQjtI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624872; c=relaxed/simple; bh=8vH1zgXiW6sFqWPP7Xe4NUQ+aG1DbdgrOh7Lo67Sva4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VCK4NYMhj4tB7T+UZTFDFUSJiZdUAaI/b5vjoFs0i9Co1Zx00MwKNNAu+t3LtEVvARnULwvW3ItYxeVhs54Dj+oUFnYNevn2lGjjirxksv2C27m4cz3NB78vJwOi15aFavqCSbetVCBIzba7CfPt7oUiIN5XGhwcfSLQvM8SGGk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=U9Fm7GXD; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MGqhWC002357; Thu, 22 Feb 2024 18:01:05 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=SK5JcaC6C9sqBLvgnnhZB613+0SPAB8k6+ie79n5RP8=; b=U9 Fm7GXDXLSEHQXItDlMQ8s3Nd1CvtEVyxQdovXXYWxGzU2zkCdfPK+joy1gOfIT9P 0XWhKd6rq4vLCHV/GaXSbzPygiNBI474bgDaH1T2pmv9IF3PBLWHz0y+QSrhz/8U YD39lSm6V6xm6nlwd756M0cIsbZ5G+qZUZh6t3ZIuonwhNFUEObsPItFA6KGxCXB u/Va6H5QCGvDR8rw9Ea/Dc/RN8ohLFDo0ih1nuNnBo8MxFg5zVPmLtaaWxK7dpE1 QxvhjpJ7FWqQbUqQ3XXkfmZHtahwcLVuLEVtqmmHH7yV91Hf9wv0k0B9dueoEikh VGKdDVvJ7Ysxuap91qqA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3we24ahtcm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:04 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI14Mq016160 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:04 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:01:01 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 3/8] treewide: rename firmware_request_platform() Date: Thu, 22 Feb 2024 23:30:28 +0530 Message-ID: <20240222180033.23775-4-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: jQ2WPnQlOa2sprbdRA3R_OWL-liq_1oI X-Proofpoint-ORIG-GUID: jQ2WPnQlOa2sprbdRA3R_OWL-liq_1oI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623927887329648 X-GMAIL-MSGID: 1791623927887329648 Rename firmware_request_platform() to request_firmware_platform() to be more concrete and align with the name of other request firmware family functions. Signed-off-by: Mukesh Ojha --- Documentation/driver-api/firmware/fallback-mechanisms.rst | 4 ++-- Documentation/driver-api/firmware/lookup-order.rst | 2 +- Documentation/driver-api/firmware/request_firmware.rst | 4 ++-- drivers/base/firmware_loader/main.c | 6 +++--- drivers/input/touchscreen/chipone_icn8505.c | 2 +- drivers/input/touchscreen/silead.c | 2 +- include/linux/firmware.h | 4 ++-- lib/test_firmware.c | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Documentation/driver-api/firmware/fallback-mechanisms.rst b/Documentation/driver-api/firmware/fallback-mechanisms.rst index 5f04c3bcdf0c..f888fceb65ba 100644 --- a/Documentation/driver-api/firmware/fallback-mechanisms.rst +++ b/Documentation/driver-api/firmware/fallback-mechanisms.rst @@ -212,7 +212,7 @@ of firmware for some of the system's integrated peripheral devices and the peripheral's Linux device-driver needs to access this firmware. Device drivers which need such firmware can use the -firmware_request_platform() function for this, note that this is a +request_firmware_platform() function for this, note that this is a separate fallback mechanism from the other fallback mechanisms and this does not use the sysfs interface. @@ -245,7 +245,7 @@ To register this array with the efi-embedded-fw code, a driver needs to: 4. Add "select EFI_EMBEDDED_FIRMWARE if EFI_STUB" to its Kconfig entry. -The firmware_request_platform() function will always first try to load firmware +The request_firmware_platform() function will always first try to load firmware with the specified name directly from the disk, so the EFI embedded-fw can always be overridden by placing a file under /lib/firmware. diff --git a/Documentation/driver-api/firmware/lookup-order.rst b/Documentation/driver-api/firmware/lookup-order.rst index 6064672a782e..c72bc8efb734 100644 --- a/Documentation/driver-api/firmware/lookup-order.rst +++ b/Documentation/driver-api/firmware/lookup-order.rst @@ -13,7 +13,7 @@ a driver issues a firmware API call. * The ''Direct filesystem lookup'' is performed next, if found we return it immediately * The ''Platform firmware fallback'' is performed next, but only when - firmware_request_platform() is used, if found we return it immediately + request_firmware_platform() is used, if found we return it immediately * If no firmware has been found and the fallback mechanism was enabled the sysfs interface is created. After this either a kobject uevent is issued or the custom firmware loading is relied upon for firmware diff --git a/Documentation/driver-api/firmware/request_firmware.rst b/Documentation/driver-api/firmware/request_firmware.rst index 0201334bc308..3d6df9922c4b 100644 --- a/Documentation/driver-api/firmware/request_firmware.rst +++ b/Documentation/driver-api/firmware/request_firmware.rst @@ -25,10 +25,10 @@ request_firmware_nowarn .. kernel-doc:: drivers/base/firmware_loader/main.c :functions: request_firmware_nowarn -firmware_request_platform +request_firmware_platform ------------------------- .. kernel-doc:: drivers/base/firmware_loader/main.c - :functions: firmware_request_platform + :functions: request_firmware_platform request_firmware_direct ----------------------- diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index cb681f4069b8..9411ad7968cb 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -1016,7 +1016,7 @@ int request_firmware_direct(const struct firmware **firmware_p, EXPORT_SYMBOL_GPL(request_firmware_direct); /** - * firmware_request_platform() - request firmware with platform-fw fallback + * request_firmware_platform() - request firmware with platform-fw fallback * @firmware: pointer to firmware image * @name: name of firmware file * @device: device for which firmware is being loaded @@ -1025,13 +1025,13 @@ EXPORT_SYMBOL_GPL(request_firmware_direct); * direct filesystem lookup fails, it will fallback to looking for a copy of the * requested firmware embedded in the platform's main (e.g. UEFI) firmware. **/ -int firmware_request_platform(const struct firmware **firmware, +int request_firmware_platform(const struct firmware **firmware, const char *name, struct device *device) { return _request_firmware(firmware, name, device, NULL, 0, 0, FW_OPT_UEVENT | FW_OPT_FALLBACK_PLATFORM); } -EXPORT_SYMBOL_GPL(firmware_request_platform); +EXPORT_SYMBOL_GPL(request_firmware_platform); /** * firmware_request_cache() - cache firmware for suspend so resume can use it diff --git a/drivers/input/touchscreen/chipone_icn8505.c b/drivers/input/touchscreen/chipone_icn8505.c index b56954830b33..be1d7530a968 100644 --- a/drivers/input/touchscreen/chipone_icn8505.c +++ b/drivers/input/touchscreen/chipone_icn8505.c @@ -288,7 +288,7 @@ static int icn8505_upload_fw(struct icn8505_data *icn8505) * we may need it at resume. Having loaded it once will make the * firmware class code cache it at suspend/resume. */ - error = firmware_request_platform(&fw, icn8505->firmware_name, dev); + error = request_firmware_platform(&fw, icn8505->firmware_name, dev); if (error) { dev_err(dev, "Firmware request error %d\n", error); return error; diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index 52477e450b02..e3fb27eeca40 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c @@ -428,7 +428,7 @@ static int silead_ts_load_fw(struct i2c_client *client) */ error = request_firmware_nowarn(&fw, data->fw_name, dev); if (error) { - error = firmware_request_platform(&fw, data->fw_name, dev); + error = request_firmware_platform(&fw, data->fw_name, dev); if (error) { dev_err(dev, "Firmware request error %d\n", error); return error; diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 5523c9fdc92d..93e6a37352a8 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -99,7 +99,7 @@ int request_firmware(const struct firmware **fw, const char *name, struct device *device); int request_firmware_nowarn(const struct firmware **fw, const char *name, struct device *device); -int firmware_request_platform(const struct firmware **fw, const char *name, +int request_firmware_platform(const struct firmware **fw, const char *name, struct device *device); int request_firmware_nowait( struct module *module, bool uevent, @@ -129,7 +129,7 @@ static inline int request_firmware_nowarn(const struct firmware **fw, return -EINVAL; } -static inline int firmware_request_platform(const struct firmware **fw, +static inline int request_firmware_platform(const struct firmware **fw, const char *name, struct device *device) { diff --git a/lib/test_firmware.c b/lib/test_firmware.c index 9cfdcd6d21db..4aeb25bea3b4 100644 --- a/lib/test_firmware.c +++ b/lib/test_firmware.c @@ -730,7 +730,7 @@ static ssize_t trigger_request_platform_store(struct device *dev, efi_embedded_fw_checked = true; pr_info("loading '%s'\n", name); - rc = firmware_request_platform(&firmware, name, dev); + rc = request_firmware_platform(&firmware, name, dev); if (rc) { pr_info("load of '%s' failed: %d\n", name, rc); goto out; From patchwork Thu Feb 22 18:00:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp113117dyb; Thu, 22 Feb 2024 10:05:06 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUGdwu2n5ircKyCAJMITAYGd9HLfisQohaS3fJInMgUG71pz3Yu3c5SuZHoZtPPIf9LXvyrF9a+FMqA5W2A438IYeY76Q== X-Google-Smtp-Source: AGHT+IEaxFbVH3c8kzMUeo3IpWkbhz/acjJZyGo7VB/VidglH/tJB0AnLuIHBklTN64K+rSx3lnK X-Received: by 2002:a05:6e02:1d18:b0:365:1529:937e with SMTP id i24-20020a056e021d1800b003651529937emr24330443ila.8.1708625105856; Thu, 22 Feb 2024 10:05:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625105; cv=pass; d=google.com; s=arc-20160816; b=E1XxkTuzQBIXMNFmWQdPmthKOq02doT0YFEP6VCL8nlo2/NCAG16c+bou57weiNC4A YTLZxtBx7KWK7etwkEPFSB8vcGXC1+7XIm0s2J6yt5GKYJStp65opvASYYDYSQNH5JUN u/5IRKLUQ5S749hGlkweKgHeabI2gs08DwIwzTEAmR8EprUQEDP5/+RM32c1ZLwS61Tm TdRUXKjLSw7k63rgQqFIDp/R7gxJOlgCeEBnGtbH1igy5GoaUry8/wjO1xD/fptyBGxQ q+aLXTRXh3BR7RLv/akuLJqDyw8Xi1BO/I4ff5mvP3pFn9j/CNMagSFWrSmSEpDgDZWe a3GA== 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=AtZhpSI2s26BHZKaBElwa3rCsZnLo5N2e3yHac2KK3I=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=ZBcBDeij0ivzsS/iNM2SXEs09+dxAafkT4pIb7O62ZtUMGYPrX2a73kOkNfJHxepsI z6pb1lb40fGBBWRSTGAozQvwYue12vls0pWmpqoOkmCoVHZNX2GAk9foyUGZcj3h3QMG 1Mtfjp3YsF9JPDkRxucNX+9NyApJ0c8x0VuTmOeWB93IsdCJ16hNuRdxL0KKoocii9yc Lliw+7FmJEEvRJLAh3nRw41wdReDq3L9SgFUeqZ99R7YWzHOA0ORRvl561dBI/3towdt 46d1w1wasI4+wtGOTqhCCsGpkiHbwXboWPLyZ1szjXCa2Za0dDf9VOZiEcb86r9pQX61 DtHg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DdPPT6rQ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77033-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77033-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id m6-20020a92c526000000b003641c76947bsi4584691ili.38.2024.02.22.10.05.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:05:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77033-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DdPPT6rQ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77033-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77033-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 74E17288F6C for ; Thu, 22 Feb 2024 18:02:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0245E158D99; Thu, 22 Feb 2024 18:01:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="DdPPT6rQ" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 99BE915699F for ; Thu, 22 Feb 2024 18:01:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624881; cv=none; b=D1+up2bo/b48ONUHaPXlAayZ+YOvWW60USTrprlxeU/xqX9ZhED0isCCGoerdm02MclZLw1wp6MUkduh2NFIM04LWRp9RIal1c6sbP2FZCIt0AFr5UGmNs5F54wYnm1A2csNJbhod5PfEy7CFyRL3HHpYFK2/jEP1yURBeG5D6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624881; c=relaxed/simple; bh=tWz7VggF4b2XyWeoLaTQ70tO6hfLqVKhQ5mFiKg0R0A=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=n1FxyoUv9Qqk/giOVyGgsjO/skXCL1waO2apP/D8vvSURKnjYFG0UqZCy9C0RE3ZpsQllAej+3ULW3YBKLsSVK5M9Pnc9YFRjv4g2bz0Jp41kRy8UqsVkQTsOsW0fV36oNUX8iXCw6y2SMpHvWOsUo5JX6pi/f/07LPXAXpANwU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=DdPPT6rQ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MHXhD6011436; Thu, 22 Feb 2024 18:01:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=AtZhpSI2s26BHZKaBElwa3rCsZnLo5N2e3yHac2KK3I=; b=Dd PPT6rQEk8O/PMg2nUdC53V4lwDEJ73tFNmVRuYrNeO8fs2qt8Vhawi1Zy8IIQsyU C4JUHOZGVxdWplg3cZqJOyntqKL9AbQ90czBdCPHBsujxKdjsqW6h6wbnmXm2qiZ eZm3d2z/y0uVf71NYdLMa4JkcLOmkFvZ9cSzDdG5GF6jdlyvB7ZqmWYmIIrAuoxZ 9K+q+vdDlnkzkyHRlAJXK5eY4Gb6mH3P7kZy3G05dSe0LqNyyKg1ZoQr/RJCnS29 1hmGMDt4m4566DOUm9gCNy6nRoqIT5YunNLhJxC4EzukOY3welLDj1JIOz6+P9xf erRZf6hwzu4wzfZ8HNGQ== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3weasbr3yq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:07 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI16xD028646 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:06 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:01:04 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 4/8] treewide: rename firmware_request_cache() Date: Thu, 22 Feb 2024 23:30:29 +0530 Message-ID: <20240222180033.23775-5-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: 1m5y1QFg32QDE8WrknFCBBlS7oYg97Zf X-Proofpoint-GUID: 1m5y1QFg32QDE8WrknFCBBlS7oYg97Zf X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 phishscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623278696398204 X-GMAIL-MSGID: 1791623278696398204 Rename firmware_request_cache() to request_firmware_cache() to be more concrete and align with the name of other request firmware family functions. Signed-off-by: Mukesh Ojha --- Documentation/driver-api/firmware/request_firmware.rst | 6 +++--- drivers/base/firmware_loader/main.c | 6 +++--- drivers/net/wireless/mediatek/mt7601u/mcu.c | 2 +- include/linux/firmware.h | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Documentation/driver-api/firmware/request_firmware.rst b/Documentation/driver-api/firmware/request_firmware.rst index 3d6df9922c4b..6c5b91705bb3 100644 --- a/Documentation/driver-api/firmware/request_firmware.rst +++ b/Documentation/driver-api/firmware/request_firmware.rst @@ -60,13 +60,13 @@ Special optimizations on reboot Some devices have an optimization in place to enable the firmware to be retained during system reboot. When such optimizations are used the driver author must ensure the firmware is still available on resume from suspend, -this can be done with firmware_request_cache() instead of requesting for the +this can be done with request_firmware_cache() instead of requesting for the firmware to be loaded. -firmware_request_cache() +request_firmware_cache() ------------------------ .. kernel-doc:: drivers/base/firmware_loader/main.c - :functions: firmware_request_cache + :functions: request_firmware_cache request firmware API expected driver use ======================================== diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 9411ad7968cb..2823dcd7153a 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -1034,7 +1034,7 @@ int request_firmware_platform(const struct firmware **firmware, EXPORT_SYMBOL_GPL(request_firmware_platform); /** - * firmware_request_cache() - cache firmware for suspend so resume can use it + * request_firmware_cache() - cache firmware for suspend so resume can use it * @name: name of firmware file * @device: device for which firmware should be cached for * @@ -1045,7 +1045,7 @@ EXPORT_SYMBOL_GPL(request_firmware_platform); * situations. This helper is not compatible with drivers which use * request_firmware_into_buf() or request_firmware_nowait() with no uevent set. **/ -int firmware_request_cache(struct device *device, const char *name) +int request_firmware_cache(struct device *device, const char *name) { int ret; @@ -1055,7 +1055,7 @@ int firmware_request_cache(struct device *device, const char *name) return ret; } -EXPORT_SYMBOL_GPL(firmware_request_cache); +EXPORT_SYMBOL_GPL(request_firmware_cache); /** * request_firmware_into_buf() - load firmware into a previously allocated buffer diff --git a/drivers/net/wireless/mediatek/mt7601u/mcu.c b/drivers/net/wireless/mediatek/mt7601u/mcu.c index 1b5cc271a9e1..cee36dc1e9eb 100644 --- a/drivers/net/wireless/mediatek/mt7601u/mcu.c +++ b/drivers/net/wireless/mediatek/mt7601u/mcu.c @@ -414,7 +414,7 @@ static int mt7601u_load_firmware(struct mt7601u_dev *dev) MT_USB_DMA_CFG_TX_BULK_EN)); if (firmware_running(dev)) - return firmware_request_cache(dev->dev, MT7601U_FIRMWARE); + return request_firmware_cache(dev->dev, MT7601U_FIRMWARE); ret = request_firmware(&fw, MT7601U_FIRMWARE, dev->dev); if (ret) diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 93e6a37352a8..4449837ea0c6 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h @@ -196,6 +196,6 @@ static inline void firmware_upload_unregister(struct fw_upload *fw_upload) #endif -int firmware_request_cache(struct device *device, const char *name); +int request_firmware_cache(struct device *device, const char *name); #endif From patchwork Thu Feb 22 18:00:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204932 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp121032dyb; Thu, 22 Feb 2024 10:15:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVnzL0qzMNry/e+H8AdGzzwapKMDRJtOlpra+UCXY7BejEhyw45wYErWzlNeXd5w/uJQolyFWOSNaHXCp9VZlNSmkQVPw== X-Google-Smtp-Source: AGHT+IH/9ddDgusBazIRih4nbJke2yelxPtoHwukxdFSPz9t2Vi0QvHxVjNqhAvplGckjLrBAml4 X-Received: by 2002:a05:6358:9213:b0:179:ff:2486 with SMTP id d19-20020a056358921300b0017900ff2486mr26325861rwb.29.1708625740490; Thu, 22 Feb 2024 10:15:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625740; cv=pass; d=google.com; s=arc-20160816; b=afv7HqxeEHY3Zh9X/ou8CYw+se2bhHCP/n7fKxUKEpCDtdw2ee2pO164miFr5L78sl i7D9UcTMgR7/s1hIQa/+q86d/HKLXmuuYfjaAQBex3mvz7Ix87Th9MIEIoTc8RqUNLbZ M4/EjI1gBjI29hrl0K2QEF38yPlA+elkPVEQUcR/8QH2Z2eTLiayusqC2dAdOCSG/02m 7ZDQvPcNU79kUF0NMraHS73Nxe5MQJLOGxvbWX5I18Tc7jsBdDZQHuR8lawOvAJZdorP aF6wI2gQvAZKQENw2phjyj6K4YpTp7e/c1kPCsiAMUvc74l+aRVVhpFtooMmS+QZ5mHD gYmQ== 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=Grhe6JChjsoQRJF11IInuLGjhs+R22cmVJZpCJeZ6/M=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=ZWNuleCIPkVnoOE3FIa+211ac4UKCBBJIz8HXb7nrCVZGk/X5ZZTbN5oxpGRJDufe9 azWO2sRR4RczEegw6LkL+AbpEqEKBDqdprXOIBIX1B9YIIf0YkJ3WIuezJObMVaxPl/s 8ewA+JFTg8wZ2uw8gAVQ/pSBm0XPMh3i1MBPasZD4r7iBXMpmWCO6foFGGKRFgRFIMiO kARgt56IVK0mS96rWFDHu7RGH89uEUMUXb8RD52DDnyi/a9MXSLRvz0JnkJ+2rBOPUmz uYgWWhESstK9Ou7NND41Ro74sajc9GtCq37CbYLZ1S4r6tN7U56ceGaePcoanJouVxr0 6+Zw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FkHtVP94; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77032-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77032-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id m15-20020a63f60f000000b005dc1004e0b7si10704540pgh.100.2024.02.22.10.15.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:15:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77032-ouuuleilei=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=@quicinc.com header.s=qcppdkim1 header.b=FkHtVP94; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77032-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77032-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 97DB3B270FD for ; Thu, 22 Feb 2024 18:02:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 42AA3155A56; Thu, 22 Feb 2024 18:01:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="FkHtVP94" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 6DD351586F8 for ; Thu, 22 Feb 2024 18:01:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624875; cv=none; b=R/aoUVNcAgn4bsJiUUXYta3n9WL/x5X671+6yZo7XLldPO4iD3Dr8SofMXPqE+RWClkNen7yVuJBlUKGzYw8CLs3gykdu8kPGyEKvzFpFVYUwVwbWXKoSkRpAjkQeby9ezkMuvv3DzUZWAFgpCchJcjQHaNuFTxfL1UCjX+fMiU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624875; c=relaxed/simple; bh=RgR9aBJw9y7V9Rf10WSajNb4HmsteDZ5lf2W6UUWe6I=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VAHfefd2VsfgaaMWZ/3PqbzmcitOudwHHKMoo5X8jdEdPIpzgLIXlyHYm7IWK/bkKoe59ZLYhjyDUMrXn7d3RZVdLtPZ19HjWjD225nFZCqq+Xn9URagXEtWYxu4kTKpw7rQB54fRjuOkDnayTCz91COH5UPjihWruiYUtCyXZ8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=FkHtVP94; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MGqhWD002357; Thu, 22 Feb 2024 18:01:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=Grhe6JChjsoQRJF11IInuLGjhs+R22cmVJZpCJeZ6/M=; b=Fk HtVP94SgT5IYN3aIHGR5l2H8Lr6fsZKluQAXSk/WWipG0QN4UDhyGUjkFiBsk51L hOn+n7cIs3st5kY2SpOf48lsknBM6V+lYl6xqdF6yPvA5qERFU4kGzFU/OtPmgHn CHBnyQe0Kz/Yk/7fsjYOcFa7Jg3RyjQfztBkbchDoz0WT1zFBUuXxmF96JbNPh9O v86GdO/+SvbAJ0lXpO/33/oOPzQdZsAl/pqf/l79Hm18YuuIkhl3anQPav4jxR86 mkzl0N+fHzOsNtWeSQi7oeXMvCCC9ruKHucHq0Vjn3CPU/cXwwxnIANl+mAdVHSY +C1SfORPV9ri08x9DL9Q== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3we24ahtd5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:09 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI18RZ016274 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:08 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:01:06 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 5/8] firmware: Convert minor inline function to macro Date: Thu, 22 Feb 2024 23:30:30 +0530 Message-ID: <20240222180033.23775-6-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: mC9sC17vTul9WfDi_jq4kCkCmo1CQDnX X-Proofpoint-ORIG-GUID: mC9sC17vTul9WfDi_jq4kCkCmo1CQDnX X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623944453291958 X-GMAIL-MSGID: 1791623944453291958 Convert to_fw_priv() inline function to macro. No functional change. Signed-off-by: Mukesh Ojha --- drivers/base/firmware_loader/main.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 2823dcd7153a..642b4d5c4375 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -80,13 +80,9 @@ struct fw_name_devm { const char *name; }; -static inline struct fw_priv *to_fw_priv(struct kref *ref) -{ - return container_of(ref, struct fw_priv, ref); -} - #define FW_LOADER_NO_CACHE 0 #define FW_LOADER_START_CACHE 1 +#define to_fw_priv(d) container_of(d, struct fw_priv, d) /* fw_lock could be moved to 'struct fw_sysfs' but since it is just * guarding for corner cases a global lock should be OK */ From patchwork Thu Feb 22 18:00:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp113431dyb; Thu, 22 Feb 2024 10:05:26 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUJQgNbrHPsOOMvyEDbwzFClJPUrItzC3YLouXQV4namo4YtFctjgE3eHADGgMSX9ENXrAcuw9/v8dtKtnsA27BxKysMQ== X-Google-Smtp-Source: AGHT+IE/Cx1NaklIxWLoBEMmsmVp0ZabtfO+uUWzzsM8OaZ4+z6nuX+ZiF79/XTeZLfXGE/TZnPp X-Received: by 2002:a05:6e02:583:b0:365:e03:df3b with SMTP id c3-20020a056e02058300b003650e03df3bmr17743880ils.19.1708625126316; Thu, 22 Feb 2024 10:05:26 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625126; cv=pass; d=google.com; s=arc-20160816; b=tuvVCjTrboUNIAeGvX7llbzFlImU47cUvOQsVIS+SF2CH/ykoA4/cSRD0zzyqdWgRO pVBnxN+WLlP+u4k/jMDFnw82/ldWV8tFE+H0Zkmz2hVkisBeJNsIimjqpmnlojaFCnWg J7ARC827prxQEUvR2eZTOkZ6x660Zt+K8N5KkqL/HnmUm6VetrspoqM8CcKAZdI3FwNn 4QIfNlgxn4b4Wlwv/NmWXxZP+/3GUeOokGFtX7/W7qV5UBu6Hw6/tJ4CutbdGV2i1+AZ nyuznpL65DDL2Zt7y8PwfeXAIiGt/WgFkABFpFRhO3ecWeyDgv56e51geZq+hFQlIOZK /mJQ== 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=jFZj2zAHCd4tUDzFb5d8oO8E2+tJ2x95gkUNT647hRs=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=jZJKrMM6xfdT6m1gLN3s9LgBqpAmhTiufwYN0/e9SWxKebDky+0e+XdtzKz+yGfY4U F4GsbAOU/1w22cK45O2xJgnkc4kX8tcG+xxMEzDegmOIxXdVkBqk0yMsAyqgfZb2nJaj rhzrl95xNbiW0rjGijtHUZ0qDYSZj6f9qzim3MdlMP8gr/4Dw2jBR9L7mZ5/F3ruMXQq ZpvbAjOcoxaNPBRGgRzplPEbCVXBo86jH8ZCbCRa+TS7+0ie0Ofi/HhwIo0F1X/XRUY6 bNhbvu304rEw5ODLvF8ZvpwCA4u0egXbpvpBkLj+xEGG0IJEzSac/JizURuZXEi0e1lV 87Mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RaFjSATJ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77036-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77036-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id z189-20020a6bc9c6000000b007c78947e244si320278iof.144.2024.02.22.10.05.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:05:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77036-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=RaFjSATJ; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77036-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77036-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 D3ADE289B55 for ; Thu, 22 Feb 2024 18:03:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 425F415A482; Thu, 22 Feb 2024 18:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="RaFjSATJ" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 55472159575 for ; Thu, 22 Feb 2024 18:01:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624891; cv=none; b=InCteLDt9a+7+ctJC+/qxzSUSfCF6ltNlS7fpWBfCbLSzl78xzT8ZyjCUjCi5Wjdu+Sgvmd/DYBLigGts2WfB5sqGw6pjW9Ey7VSk9TLbw/jUK30UrEoyeL6TKO0Q1tIEStP4o4H/oQonQffoXKyQ508V0CP9y39ZV1ORLm4YHg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624891; c=relaxed/simple; bh=uvISUepi0faJHLxOL9G1jzdyJKkcXe6Hs87hT6kr5QU=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KvNhcZVxx34E67GeeXjQKAdT13Fylo3FLg27UF4Lu9B9f+Ls6sKi1hTlDuZLK/j0a/u9aoPdCrtcWJaWHVfWsWvCnv4dtxh5bKWfWSC2rX14ZD2odZgYCpd1PHLTnpGyyLY9arJoDiU/HDjIMgxfdKzURxemPhUNsAIeKOkVdlc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=RaFjSATJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41M7gxmO022032; Thu, 22 Feb 2024 18:01:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=jFZj2zAHCd4tUDzFb5d8oO8E2+tJ2x95gkUNT647hRs=; b=Ra FjSATJTkQbdUWWGNDQtjSR4aZ1qBr7x8IoJiTpD5DUZ2CODx+Ibb17QFA0AWfbro ntr1BVrZVleD2/hcnGfnXuLS6RjWYrsHwqwpeyJn5eThynzweUEkCBcfocXCcANZ V5LhnWDjbUTn5Z1ehH0ba2SVdOW0UwFVjULTYdYSwFrYxiH1mf7WJuXQX3unF5Zf rbFFUZ3LB/hP4lLHblZVDBSKfS3xbQKo3LEvyKpYY45VT7ak+LDHnyE1bIzjOfZA X2CQfj2UoV+pVX742uWdiMRXQnUqcg84iFCLwdNiSK6HUrq5dTzaEtcwe2OlyFxI LkNRQrEbGlcNjEbhGHKg== Received: from nasanppmta04.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3we24ahtdf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:11 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI1BuL010421 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:11 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:01:09 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 6/8] firmware: Move module template to the bottom Date: Thu, 22 Feb 2024 23:30:31 +0530 Message-ID: <20240222180033.23775-7-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 7ZhYFu_GvPzoLp6U3--ZmILes4t5kBZA X-Proofpoint-ORIG-GUID: 7ZhYFu_GvPzoLp6U3--ZmILes4t5kBZA X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 priorityscore=1501 adultscore=0 mlxlogscore=999 phishscore=0 spamscore=0 mlxscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623300097815079 X-GMAIL-MSGID: 1791623300097815079 Normally, module template should be kept at the bottom of the file. Let's do the same for firmware module as well. Signed-off-by: Mukesh Ojha --- drivers/base/firmware_loader/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 642b4d5c4375..1d752965d311 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -44,10 +44,6 @@ #include "firmware.h" #include "fallback.h" -MODULE_AUTHOR("Manuel Estrada Sainz"); -MODULE_DESCRIPTION("Multi purpose firmware loading support"); -MODULE_LICENSE("GPL"); - struct firmware_cache { /* firmware_buf instance will be added into the below list */ spinlock_t lock; @@ -1633,3 +1629,7 @@ static void __exit firmware_class_exit(void) fs_initcall(firmware_class_init); module_exit(firmware_class_exit); + +MODULE_AUTHOR("Manuel Estrada Sainz"); +MODULE_DESCRIPTION("Multi purpose firmware loading support"); +MODULE_LICENSE("GPL"); From patchwork Thu Feb 22 18:00:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204934 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp122117dyb; Thu, 22 Feb 2024 10:17:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWZXMw4HyUQRycUcA4gAXiZHVc6qn8TaQX+/TXhyrLJXEjy0wYCZdWk482zrh7fC1WP41aLpK/8K5t7WSKewmVXmJ65GA== X-Google-Smtp-Source: AGHT+IGNh6U5w9gg/p+el5lVE7U/7swgZFoKAHa14tHaDQPfLMZuF8p+uYXKfpaGq4jSNX0Fn7Wt X-Received: by 2002:a62:cd82:0:b0:6e4:3ea4:a7e1 with SMTP id o124-20020a62cd82000000b006e43ea4a7e1mr9402627pfg.27.1708625822898; Thu, 22 Feb 2024 10:17:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625822; cv=pass; d=google.com; s=arc-20160816; b=OGmOLNANeVTKLCjnbxFpKTaM4J800GU63NEYsG7ZJXoiQBkgcJQmaIZtf8JsGynzIX MTp1HoGSzCP1sNWj3rSsgzABl2PZ+YCH6d7QHtyE/piijtrTb+gIQ1mPsRj7CoLhrPI2 gOIOuKNSN3FL7ZObjyWhap/pp7yTRT9OgWPcSOE19gbLFTzY6arxI0cSwP1B1Qah9etc g5gOht1h97HoNrGi3XgNPMEYMGi7HntqAl9BJn1gqxXfeG+FjCm2keS6ez9RRG5mVs5D w6IzcNb9kQAlZYxSZfesbppujLaza0SLkajIQmx/OCFGgYnC/dnu22YKQiGrTq7z9SZf coKw== 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=WWWmcwY3ouhT7+iupdFQYEQWZmvj5RtlPOV01FUCTXg=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=acGsw8g1LOWX9kKbtHET88M1WDjdu96ujC/Nr3pqkag070z/1pYP0+RDqCfHIl2wkM sOgHpmDeivEw0w3FX5A2QfOShq+4VD2MpAoPeR1/KwbaGmjqC8Yul020A50W33oP8EQL 4OvEI0k4Ew9Uq4VezqWPJwZTj+XnmyP3wrHBpszKwyos73dXEW75B9RhwPubU6ZJ8UBP zBK9Vxcti9MG79q9q/r1Rn1xzZ5pZ3PUBSnp2N0b4sv1SGoLmK1yxALnXNa0BAyOgwkP oaH7qBL7DbXY5Li/2AUWvT9uXxD+LZH7HBCAtINnmlpbB1Nbu2RmTHiEcrz0yxRBj0Fr vrBw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=NRaWZI8I; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77037-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77037-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id bw27-20020a056a00409b00b006e04acce4fasi10731556pfb.161.2024.02.22.10.17.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:17:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77037-ouuuleilei=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=@quicinc.com header.s=qcppdkim1 header.b=NRaWZI8I; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77037-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77037-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 1C84BB27D40 for ; Thu, 22 Feb 2024 18:03:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EBCC615A496; Thu, 22 Feb 2024 18:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="NRaWZI8I" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 426A415958B for ; Thu, 22 Feb 2024 18:01:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624895; cv=none; b=Oxnvmq8ouDrOQBw9+SV/Q1NOCfZ5Tmng5cT5/bMCW6jyjWqv+x9/JJ5rE7Ylpryu28Tyw8hKsT/TuclcZ2M6OtuLzggq3Jew9Nz4jOyybnXF7ZJ9TfFXt5ukSLcswNWUSkJUHp2p2LYStDuqmM4h3uqLgnvxIypd7SMHJrZRwrA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624895; c=relaxed/simple; bh=Hf2vdIK5wvMBM9HYCFSZ0pmzvQMdYEUhBS/WYoYYuCA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=sc73alTuH6eQcfwXa4nwd9KQa7iKtkcjpu9Yf/unDxPrDwDkxXCGdIfqLAB+F9rQz9fbGyx1UlbVbLNYE/WauAgq+co1yUNzVBaZ9naKbOdCFFRPrgnhqoZVeQoG2lRjIPZC93MMf2OfpZdaUsi7veXCfdGA8vi1yKk/D6cUzng= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=NRaWZI8I; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MHXbYI011313; Thu, 22 Feb 2024 18:01:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=WWWmcwY3ouhT7+iupdFQYEQWZmvj5RtlPOV01FUCTXg=; b=NR aWZI8ICRBjNsixcpcOAp9jVnrNq4b0M/KE+9TVCvECCy1L8sN7s7sY0JgZLJvTFn QJ2UKh4S1mKcCgAdZCXLB2a0EIXeX2Y5lP9KiKyVC1W2uFUzmw94hEiurauLqm+9 2BaQAzKl5jn3vJK/p7XiZYKYtm0hePfchx8iw2IrLXYfsskB6Cue7IliJxWJ7o84 3I9L1jlBl1Hk8wc2wwBTZAOX4CCtT3qkoSj0syc+Bu3fehAr5M79J+XfA5MIEeDm afHrrBTRnWs34y3cRqLj9pg6geSFkbv8YAXELP+l2r/yfn1UHqdgLQVzYRc0RJt+ JAAi7vNlzQsNBz1ZXNBg== Received: from nasanppmta01.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3weasbr40n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:14 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI1DtV028732 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:13 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:01:11 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 7/8] firmware: remove prototype of fw_cache_piggyback_on_request() Date: Thu, 22 Feb 2024 23:30:32 +0530 Message-ID: <20240222180033.23775-8-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: EvuIi56fq_i4yrGRxryZPC4ZPXQalN8N X-Proofpoint-GUID: EvuIi56fq_i4yrGRxryZPC4ZPXQalN8N X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 phishscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791624030860499573 X-GMAIL-MSGID: 1791624030860499573 We should always try to avoid using prototype of a static function like fw_cache_piggyback_on_request() firmware main file. Move the relevant code in such a way that avoid the prototype usage. Signed-off-by: Mukesh Ojha --- drivers/base/firmware_loader/main.c | 109 ++++++++++++++-------------- 1 file changed, 54 insertions(+), 55 deletions(-) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 1d752965d311..91a45767a3a7 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -100,8 +100,6 @@ static inline int fw_state_wait(struct fw_priv *fw_priv) return __fw_state_wait_common(fw_priv, MAX_SCHEDULE_TIMEOUT); } -static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv); - static struct fw_priv *__allocate_fw_priv(const char *fw_name, struct firmware_cache *fwc, void *dbuf, @@ -672,7 +670,61 @@ static int fw_add_devm_name(struct device *dev, const char *name) return 0; } + +static struct fw_cache_entry *alloc_fw_cache_entry(const char *name) +{ + struct fw_cache_entry *fce; + + fce = kzalloc(sizeof(*fce), GFP_ATOMIC); + if (!fce) + goto exit; + + fce->name = kstrdup_const(name, GFP_ATOMIC); + if (!fce->name) { + kfree(fce); + fce = NULL; + goto exit; + } +exit: + return fce; +} + +static int __fw_entry_found(const char *name) +{ + struct firmware_cache *fwc = &fw_cache; + struct fw_cache_entry *fce; + + list_for_each_entry(fce, &fwc->fw_names, list) { + if (!strcmp(fce->name, name)) + return 1; + } + return 0; +} + +static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv) +{ + const char *name = fw_priv->fw_name; + struct firmware_cache *fwc = fw_priv->fwc; + struct fw_cache_entry *fce; + + spin_lock(&fwc->name_lock); + if (__fw_entry_found(name)) + goto found; + + fce = alloc_fw_cache_entry(name); + if (fce) { + list_add(&fce->list, &fwc->fw_names); + kref_get(&fw_priv->ref); + pr_debug("%s: fw: %s\n", __func__, name); + } +found: + spin_unlock(&fwc->name_lock); +} + #else +static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv) +{ +} static bool fw_cache_is_setup(struct device *dev, const char *name) { return false; @@ -1285,56 +1337,6 @@ static int uncache_firmware(const char *fw_name) return -EINVAL; } -static struct fw_cache_entry *alloc_fw_cache_entry(const char *name) -{ - struct fw_cache_entry *fce; - - fce = kzalloc(sizeof(*fce), GFP_ATOMIC); - if (!fce) - goto exit; - - fce->name = kstrdup_const(name, GFP_ATOMIC); - if (!fce->name) { - kfree(fce); - fce = NULL; - goto exit; - } -exit: - return fce; -} - -static int __fw_entry_found(const char *name) -{ - struct firmware_cache *fwc = &fw_cache; - struct fw_cache_entry *fce; - - list_for_each_entry(fce, &fwc->fw_names, list) { - if (!strcmp(fce->name, name)) - return 1; - } - return 0; -} - -static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv) -{ - const char *name = fw_priv->fw_name; - struct firmware_cache *fwc = fw_priv->fwc; - struct fw_cache_entry *fce; - - spin_lock(&fwc->name_lock); - if (__fw_entry_found(name)) - goto found; - - fce = alloc_fw_cache_entry(name); - if (fce) { - list_add(&fce->list, &fwc->fw_names); - kref_get(&fw_priv->ref); - pr_debug("%s: fw: %s\n", __func__, name); - } -found: - spin_unlock(&fwc->name_lock); -} - static void free_fw_cache_entry(struct fw_cache_entry *fce) { kfree_const(fce->name); @@ -1563,9 +1565,6 @@ static inline void unregister_fw_pm_ops(void) unregister_pm_notifier(&fw_cache.pm_notify); } #else -static void fw_cache_piggyback_on_request(struct fw_priv *fw_priv) -{ -} static inline int register_fw_pm_ops(void) { return 0; From patchwork Thu Feb 22 18:00:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mukesh Ojha X-Patchwork-Id: 204923 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:a81b:b0:108:e6aa:91d0 with SMTP id bq27csp113351dyb; Thu, 22 Feb 2024 10:05:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXZZYlhlXTFEWHWnrBB/HBI3MDJj8yRWhGZmUlTf+Dgfz1iK6AZAHYSE/+QN8qTKExXOe8Zf2DQJUoOcHEtV9WFIjIaMA== X-Google-Smtp-Source: AGHT+IHjxNQ3CfM+yN4OU5KKBS8KzVhNgi+p/doaKtvkv5cJFdIuI/kHbs77ai3yucke9ch9WE2B X-Received: by 2002:a92:c26e:0:b0:365:28e6:daa8 with SMTP id h14-20020a92c26e000000b0036528e6daa8mr17490072ild.12.1708625119945; Thu, 22 Feb 2024 10:05:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708625119; cv=pass; d=google.com; s=arc-20160816; b=NnX9VUNauWx4SiS+/0rAddrLPy5cnvOiVtr9ZblRhhiS62J2/ltzhk62xKCWBUdVFB yPl9zyRqQdIANCl5ueQeigd61jzgvF0xa9/IdxwRJxggcYL3WKsFN73Nr3ZJqP4ahZPP shXb8w2okAxk0YozaQQ1UuidQq9+qwy3Up/NE4nOizVSUyCZmHD3/NYBXjFKredj2CKV 8bv9jBze6WYvNwLK4Qegx6jetvX6ztxZu8sR4E/yNMmL//grIFUcQStUoidKdCtLcjWa wpNmO0KVhE3DQ7bGgShvDODIOG3XAbrVmJErSLEoUuhLyCrY/cfuNAEUMtDQ866tdKCh edHQ== 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=pj2BPbAZcucSWeeG7pNO1PQzpY9Trgm52RJu+sDer8I=; fh=VV90pw4GjPSUQwq2AmAS1aZ5bQMz7jUETijgFz5UlTU=; b=jvtYuaXGbFpxWwnSLte70NiySNe2MEutwMuuViyDtTRI0tNQ2h4BI/AM52866xFeNj zyRTHy9IxWhdJ8OGLb/BdME6Ply75TvBg+hFGaJWALSSUm/95Cf18xbDYttnsiNFPd7u a5jpkZzCX4T96Zs6LdwKE5DRACuZYOFM0+3zl9PdLnjgZPReYDN8KK7W29/8+PvPubzv 1uvbws/MrZwwq0uGNLOYGtuRiLOmFACihW3jCdNqYpFQDgqQ+wWY1QuuJgbL365uwTO7 xOi0u8JDZrWmraZAYPjTM1agoZf3vZBUJqSiqZcwPZrkzD+mv1iZxBT76hCN2kfJwopa J4+A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=kdpw3quG; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77035-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77035-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id l13-20020a0566022dcd00b007c3eb827fc7si3927951iow.19.2024.02.22.10.05.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 10:05:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-77035-ouuuleilei=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=@quicinc.com header.s=qcppdkim1 header.b=kdpw3quG; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-77035-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-77035-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 C56FD289920 for ; Thu, 22 Feb 2024 18:02:59 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E73D15958E; Thu, 22 Feb 2024 18:01:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="kdpw3quG" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 143F0157E90 for ; Thu, 22 Feb 2024 18:01:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624889; cv=none; b=iR9s+Aks1gSRaKLxszXa7cDfc/1q4Ib2RxV9TN7v8WLkLdzAsgrHjZbLO+ynD+XGbiE2yQztrEWS7oRVtm07gjoVW4+F4LkaLdg7Ou9/4V+kM43YSO+7r5LoLebxG4MOuz/DMvzjqF71z0DYd+Zm0uWLVewLCFPbCx5UML77ie4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708624889; c=relaxed/simple; bh=9K3pWAiB/DqkeRoMCn7/BciTB9vx1+qzhkv3Yo6Rxl0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Ew6IoaB1F284qrldlSIBzhUgNBMibWdAQKpHtGyy+noK34MBO2bM2wy5c6ftcoG+ePRfcTmOUroMn4s+JZKpGeHFS804IIylMVWSxWcK1Q1mF3d3bLtUuZeSwhLsCzgVmALBmfEQn8Vc00XA8oGmTXR6Jqsw4EpLrUYxfmz+mxo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=kdpw3quG; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41MAF2so015686; Thu, 22 Feb 2024 18:01:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= qcppdkim1; bh=pj2BPbAZcucSWeeG7pNO1PQzpY9Trgm52RJu+sDer8I=; b=kd pw3quGIAKDjPiieFrzFzrCPDmjwc3YGxrpM/d3iC2YYE8Wl4nLCsX8zfHw7ev2AC kQUIc1NiMMJkJKe0IPPxtuZnSFDERlXq85LXC6MzweAt/RUEN92ZYS+QY/MV9Ppf H+tiN3XREoh2Ljcy9BQpSvi/2gbfrUksk4YzoEAnG5AaIe7KfkIsDqVZnRgHld0V YKuiOjVp9a8V5FznPD1uFz5ZPslS4dKYG8uIOXXmKFbw8YahTl5+Y4fMboqi6biV N60fkxjBBqotG9b7eo07KwUFY3AuOl5RmjrFjOka8x6PpzdvoXttez+G7/KIW4je j01mn4pjKNUqDrfQlbKA== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3we2bx9rey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:16 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41MI1GcG016346 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Feb 2024 18:01:16 GMT Received: from hu-mojha-hyd.qualcomm.com (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 22 Feb 2024 10:01:14 -0800 From: Mukesh Ojha To: , , , CC: , Mukesh Ojha Subject: [PATCH vRFC 8/8] firmware: FW_OPT_UEVENT for all request_firmware family functions Date: Thu, 22 Feb 2024 23:30:33 +0530 Message-ID: <20240222180033.23775-9-quic_mojha@quicinc.com> X-Mailer: git-send-email 2.43.0.254.ga26002b62827 In-Reply-To: <20240222180033.23775-1-quic_mojha@quicinc.com> References: <20240222180033.23775-1-quic_mojha@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: z9afkXeJj85ww57MpsoRPCzbkAAiUiHa X-Proofpoint-GUID: z9afkXeJj85ww57MpsoRPCzbkAAiUiHa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-22_13,2024-02-22_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 priorityscore=1501 mlxscore=0 adultscore=0 phishscore=0 clxscore=1015 malwarescore=0 spamscore=0 mlxlogscore=917 lowpriorityscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402220140 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791623293937529172 X-GMAIL-MSGID: 1791623293937529172 Currently, FW_OPT_UEVENT is used in almost every request_firmware family function apart from request_firmware_nowait(), however, request_firmware_nowait() uses much lower level api which does not assume FW_OPT_UEVENT to be a default flag. Apply FW_OPT_UEVENT as default flag. Signed-off-by: Mukesh Ojha --- drivers/base/firmware_loader/main.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/base/firmware_loader/main.c b/drivers/base/firmware_loader/main.c index 91a45767a3a7..4650fef9b713 100644 --- a/drivers/base/firmware_loader/main.c +++ b/drivers/base/firmware_loader/main.c @@ -985,7 +985,8 @@ _request_firmware(const struct firmware **firmware_p, const char *name, /* Need to pin this module until return */ __module_get(THIS_MODULE); - ret = __request_firmware(firmware_p, name, device, NULL, 0, 0, opt_flags); + ret = __request_firmware(firmware_p, name, device, NULL, 0, 0, + FW_OPT_UEVENT | opt_flags); module_put(THIS_MODULE); return ret; } @@ -1013,8 +1014,7 @@ int request_firmware(const struct firmware **firmware_p, const char *name, struct device *device) { - return _request_firmware(firmware_p, name, device, NULL, 0, 0, - FW_OPT_UEVENT); + return _request_firmware(firmware_p, name, device, NULL, 0, 0, 0); } EXPORT_SYMBOL(request_firmware); @@ -1034,8 +1034,7 @@ EXPORT_SYMBOL(request_firmware); int request_firmware_nowarn(const struct firmware **firmware, const char *name, struct device *device) { - return _request_firmware(firmware, name, device, NULL, 0, 0, - FW_OPT_UEVENT | FW_OPT_NO_WARN); + return _request_firmware(firmware, name, device, NULL, 0, 0, FW_OPT_NO_WARN); } EXPORT_SYMBOL_GPL(request_firmware_nowarn); @@ -1054,8 +1053,7 @@ int request_firmware_direct(const struct firmware **firmware_p, const char *name, struct device *device) { return _request_firmware(firmware_p, name, device, NULL, 0, 0, - FW_OPT_UEVENT | FW_OPT_NO_WARN | - FW_OPT_NOFALLBACK_SYSFS); + FW_OPT_NO_WARN | FW_OPT_NOFALLBACK_SYSFS); } EXPORT_SYMBOL_GPL(request_firmware_direct); @@ -1073,7 +1071,7 @@ int request_firmware_platform(const struct firmware **firmware, const char *name, struct device *device) { return _request_firmware(firmware, name, device, NULL, 0, 0, - FW_OPT_UEVENT | FW_OPT_FALLBACK_PLATFORM); + FW_OPT_FALLBACK_PLATFORM); } EXPORT_SYMBOL_GPL(request_firmware_platform); @@ -1124,7 +1122,7 @@ request_firmware_into_buf(const struct firmware **firmware_p, const char *name, return -EOPNOTSUPP; return _request_firmware(firmware_p, name, device, buf, size, 0, - FW_OPT_UEVENT | FW_OPT_NOCACHE); + FW_OPT_NOCACHE); } EXPORT_SYMBOL(request_firmware_into_buf); @@ -1149,8 +1147,7 @@ request_partial_firmware_into_buf(const struct firmware **firmware_p, return -EOPNOTSUPP; return _request_firmware(firmware_p, name, device, buf, size, offset, - FW_OPT_UEVENT | FW_OPT_NOCACHE | - FW_OPT_PARTIAL); + FW_OPT_NOCACHE | FW_OPT_PARTIAL); } EXPORT_SYMBOL(request_partial_firmware_into_buf);