From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED5DD606A32F for ; Wed, 2 Dec 2026 17:32:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=bAqV1FBb; dkim=pass (2048-bit key) header.d=ti.com header.i=@ti.com header.a=rsa-sha256 header.s=proofpoint-05-2026 header.b=ZdI4HTm2; dkim=pass (1024-bit key) header.d=ticloud.onmicrosoft.com header.i=@ticloud.onmicrosoft.com header.a=rsa-sha256 header.s=selector1-ticloud-onmicrosoft-com header.b=YJ3FUGVp DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:CC:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Unsubscribe-Post: List-Owner; bh=MMKWh/beHiGeM9MbPBXvR3HKaO4XuHWcSuITIohczeY=; b=bAqV1FBbwCdbs2 wAD0/W9T53r/4f4JJSkazBDcu7cyEnPQQpt4p6VPNYtVpiCr1YRCpthVKK36yGCeyg9rGvO1mIkX4 fv3Cl2LHiPbuoTOrusw6Uq8pPUoHpdp2vhDBokCoYAJPWK4qmNb+s7iuFETt10LpBTbnBepNzL/R9 hK8GMngYcoFUEVL+l1gwCtKbxyQImon0lrgG2Kz3D7Wi1Y/OhDhu0zYeAOOcUBqIcpl4b6eSPS6zi hq272EaVg5599iwSMt4sjgyHF+OpZ0lG36EEsiC7KBCIYP7xvaVC7r1S0JSVDR1pMwUenVNBJ+WrS /Fg8BbU2dZXtr0TIJdug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYoBK-0000000CNI4-24Is; Wed, 02 Dec 2026 17:31:50 +0000 Received: from mx0a-0002e601.pphosted.com ([148.163.150.75]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xYoBH-0000000CNHB-0yO3 for linux-arm-kernel@lists.infradead.org; Wed, 02 Dec 2026 17:31:48 +0000 Received: from pps.filterd (m0384305.ppops.net [127.0.0.1]) by m0384305.ppops.net (8.18.1.11/8.18.1.11) with ESMTP id 6B2H0D7t3137093; Wed, 2 Dec 2026 11:31:42 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s= proofpoint-05-2026; bh=MMKWh/beHiGeM9MbPBXvR3HKaO4XuHWcSuITIohcz eY=; b=ZdI4HTm2MbiKCYbUY9kthVDa7J7zGdAqVenl+iLCRmD/KHmhpqop1wzJH G9OkcW3FPtFbX9hPamKdhT4U7Alnggd70snFZKQeaX2rWoySGLxKGt80SZb2faUy HAHrCwcPvaQF9UiiI8pWPI1SVbvJw17VxrxVzSWdqOrTJtmifJurc1LFcFW4tfcf NWCCvcKfGF0a9LkPKXT1d0huYo+ggWDLmDqfZOc6bvTVVnMt7dPIlhLupkg3JVBo IZgIoFmX1yx9IoVWgDI6ItnLgzm3syy/qHNpyo0xpHP17XbEJM387IQ+/LkfeHet WfBgjceyzexRG++ihFXpZZrvzuf4g== Received: from sj2pr03cu001.outbound.protection.outlook.com (mail-westusazon11012024.outbound.protection.outlook.com [52.101.43.24]) by m0384305.ppops.net (PPS) with ESMTPS id 4jant70vca-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 02 Dec 2026 11:31:42 -0600 (CST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=kuZfgbeiN0L6pjGpYe2eQxnccqu9JS8UxZDT9xScsmGn04/uIi7Bzpv98AhEQ6oduY21y+Knjb/z7pr44izJ/7TPk5A0MEaZreM0oUdlRrdiEvU6jjlHg8fDokHsoLj0VqDp5t0KpCykUfXLu9PBatiui/zQ0whJrqZ2osK3p8hb3SNu8bl906tEYaGWsR2RdDEmP+lqc9C1NlatNkzPBTAwQmAa6VLwZ1kzFz9t3QiAc1G07++9N+1pJT8aBWniomiTvvlozsjoOkmqBFlg2THSRmm0/aX2jmwYShO7b6TTfyMI+1q/S+AFQyQY6KwzzgBP3B8Nk8R1iSlKJc/jDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=MMKWh/beHiGeM9MbPBXvR3HKaO4XuHWcSuITIohczeY=; b=eKT8JLA51iUDc6COQtSmBj6C7yNybLLKhks7ivRULsnYCucrVJIk1WNy4hKloNOwyI0r6oF7zQNZYM1K4UfOiiyPc+wExx0od3vnNZH2WJaKwWoXP1fzam3I5H3HK4EuS8nk9UUxfBmNGVWyuPWSStujl++0CyGF49qa5YbkOihwOCuyFvdFrkrqLb9kCnuIrtzC/ToYVN84+yRL9IbiFOuv+DoqOhwCorfTeDAXYa86akHidyrJFic6ZAfuFzvP8mgJYuSxX2wMBRvr2sWOzmVxWDLxAp9WtDtCzuG6dSE5YwucBH4yIrSUTdUIqH7BShC74kRRVvZZNbNn2utuKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 198.47.21.194) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=ti.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=ti.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ticloud.onmicrosoft.com; s=selector1-ticloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MMKWh/beHiGeM9MbPBXvR3HKaO4XuHWcSuITIohczeY=; b=YJ3FUGVpN5la2e7Wt6Mv6o5k8b79yP/c7YEEXINBV3YhVV6P5Zsl/7yoQl2uVJ4fiTrJlzQ/9nerX6RCT5wBqxPUJuthiwtvSovGedHPMrEVDwPqOz7HgoovcogA6yi+5FUlCDIU898YMSOW2AdCRGrQ/YqXJeJvhmRIuR2+oWU= Received: from DS7PR03CA0027.namprd03.prod.outlook.com (2603:10b6:5:3b8::32) by CH8PR10MB942015.namprd10.prod.outlook.com (2603:10b6:610:70a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.11; Wed, 2 Dec 2026 17:31:40 +0000 Received: from BL2PEPF000352CB.namprd02.prod.outlook.com (2603:10b6:5:3b8:cafe::13) by DS7PR03CA0027.outlook.office365.com (2603:10b6:5:3b8::32) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Wed, 2 Dec 2026 17:31:40 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 198.47.21.194) smtp.mailfrom=ti.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=ti.com; Received-SPF: Pass (protection.outlook.com: domain of ti.com designates 198.47.21.194 as permitted sender) receiver=protection.outlook.com; client-ip=198.47.21.194; helo=flwvzet200.ext.ti.com; pr=C Received: from flwvzet200.ext.ti.com (198.47.21.194) by BL2PEPF000352CB.mail.protection.outlook.com (10.167.249.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 17:31:38 +0000 Received: from DFLE215.ent.ti.com (10.64.6.73) by flwvzet200.ext.ti.com (10.248.192.31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 11:30:39 -0600 Received: from DFLE200.ent.ti.com (10.64.6.58) by DFLE215.ent.ti.com (10.64.6.73) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45; Wed, 2 Dec 2026 11:30:39 -0600 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DFLE200.ent.ti.com (10.64.6.58) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.45 via Frontend Transport; Wed, 2 Dec 2026 11:30:39 -0600 Received: from [10.24.50.209] (uda0490799.dhcp.ti.com [10.24.50.209]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 6B2HUZNu1861752; Wed, 2 Dec 2026 11:30:36 -0600 Message-ID: <28205c98-d15f-470d-8eaf-a5d2f97d0dc6@ti.com> Date: Wed, 2 Dec 2026 23:00:35 +0530 X-Archived-By: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 09/22] firmware: ti_sci: Fetch info struct from handle inside ti_sci_do_xfer() To: Andrew Davis , Beleswar Padhi , , , , , CC: , , Praneeth Bajjuri References: <20261029181147.266771-1-b-padhi@ti.com> <20261029181147.266771-10-b-padhi@ti.com> <589b512c-e2a3-479a-8f8a-079809feb7fd@ti.com> <82aa77a6-b777-46df-a6ab-4355edc963e8@ti.com> Content-Language: en-US From: Sebin Francis In-Reply-To: <82aa77a6-b777-46df-a6ab-4355edc963e8@ti.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL2PEPF000352CB:EE_|CH8PR10MB942015:EE_ X-MS-Office365-Filtering-Correlation-Id: a130b5e6-0067-4883-d35a-08df509a1f2c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|82310400026|36860700016|1800799024|23010399003|4143699003|6133799003|261009223027099003|18002099003|22082099003|56012099006|10067099003|261021123027099003|261022105027099003|261021121427099003|261102123227099003|261028144727099003|261026121527099003|261026140227099003; X-Microsoft-Antispam-Message-Info: HkzmV385Nmj1NZsyutaCTle+iYrznZq1fq9VwtOIStsgdHEY7mPQy/x9GLxm2e7O41gw4Lm+EJrf/BTx5io/XMoXWcBSQIA6eBEEV9qRbTLHWfoAJChM4OfXdh0ufwfK7i7PsrjUA3ODwKcs5wPiyUwXmSFC+Rswh1p9fMIewy1vTmR8sg6JMYQiTPmO6GiWtqkI3Tt7uh+hGP9rkBq/IqDD+Fb6Zo6aw++w2hg0Qpolf+jJdjlBVkfvvQzMh6F63LLnESia0rNhg4+626F8Ok/QedXw7nKOHP5HovwflAdBo8w4tANGt43dnVuFlgTcs+Sc9YziFZ0m96K7uuJU/GbXSPIZ5NQDwZF05T+A0bwGSEek/zmgYRNAHFP679201x3qkoFkcmJiiecZnCPezH1oHY+hZVRdNxuWn5u2+LKm3gh+ZEPU+VYqL5P2EuYzTDNSUukBE6qHT96YBzbhM3PkwxBmoe8dMqVPlvg4gjK8GT8vEMbWxBihiVsPAVViuWFEvIlYF9KGgC14VR74GMMKMRGZQ/TmubUFulhYmfYIlG6qwfe1kDT4OQ8HnrYadl8W4qPJc55lnVc6P761HMt1/RhyQuPs2PoX5WgwS8GIhvzonsAoASl8VTb0MWtg/XPor5F7fyLKBkSRECJ4L88+MVdq/Eo7qm82eNWBEqk= X-Forefront-Antispam-Report: CIP:198.47.21.194;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:flwvzet200.ext.ti.com;PTR:ErrorRetry;CAT:NONE;SFS:(13230040)(376014)(82310400026)(36860700016)(1800799024)(23010399003)(4143699003)(6133799003)(261009223027099003)(18002099003)(22082099003)(56012099006)(10067099003)(261021123027099003)(261022105027099003)(261021121427099003)(261102123227099003)(261028144727099003)(261026121527099003)(261026140227099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 7cYG3TfE8izRW/+UGU6hneFF/mfcEx55GAO5oxUuomTfRFXM5a2xUZV4TZDSuz3ISvjTs7IQGuV75wglFGFX7d1HpxIc4JeJ/nIYe/93ttKmHTqxH7gXUwCXLEq8pgKVG44WF8fQbnHl7OdsOneVLZVPttyAAQJNBfyPsEmWFJmSYhtD3bDt3MY4jhp6b8W59Ga5Zo98dRJigeqXrkhbmUbT0xuMtms7IvGI3NlBlSgAYmdl9VFP0nl76uDhebaQnrvCg33O0R4vfB7NdRA6K6oKucfwsSSBpATDVA5jwCi6skyyXcJ63H6mtA+ueSIg7CFyC4FHunkucO9viTEzD8mNWjdUhpu4Bs5vu1yhxg/OWaNL5aUVoVonmSEOCt/c7eqPoWElRguWS9kfq8M3JmZRQxu2dxLN42MbAPuYd1ctT+uwggVNo8VU3j/TLdP/ X-Exchange-RoutingPolicyChecked: S+bWuoYxC/Arg0Vw4OpqHn3x6yjfENUgDbuBk5VX5J5ZzjX5IBn5/2yl8kOUI+Yw9lWEHFvT4XD7fTZ0vUC/AGkHgePRstEtVKAn7R3gPOnn78Ta6NHVOejWkHhcNInotm3/7pgmG1818UMXdub30bZzoFKutmqyuONYMBQgtQNyRDR+Kv3+ZEUaiaBWz9j4rbO6J5tT9mwHVQ/iKjh7EM64RKyBfZhneLv/dVUR37fazslusPqPC9P4XYEewntv2ygac3rzwgIZEq3YmGK3MJbjRF7zCsYkKd8YB4VKW2YVUTFZv0JIgqxoq9cubzm3IDyt+pjmM5zLV7Vg2GHDIw== X-OriginatorOrg: ti.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 17:31:38.6957 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: a130b5e6-0067-4883-d35a-08df509a1f2c X-MS-Exchange-CrossTenant-Id: e5b49634-450b-4709-8abb-1e2b19b982b7 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=e5b49634-450b-4709-8abb-1e2b19b982b7;Ip=[198.47.21.194];Helo=[flwvzet200.ext.ti.com] X-MS-Exchange-CrossTenant-AuthSource: BL2PEPF000352CB.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH8PR10MB942015 X-Proofpoint-GUID: WMNOPmAvRqJTEtAVLrrP5C0nKJzypkfk X-Authority-Analysis: v=2.4 cv=YJIKWhGx c=1 sm=1 tr=0 ts=6b1055fe cx=c_pps a=zj1Wid/uFNkmIHgSYpofMA==:117 a=iwqwCZQqcuTv3JOpYdM7/Q==:17 a=6eWqkTHjU83fiwn7nKZWdM+Sl24=:19 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=AlMIdn_sM9wA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Z8NIEmU8O1QQgoT56wFK:22 a=taLDd7a_hP9WKsMzeGRc:22 a=VwQbUJbxAAAA:8 a=sozttTNsAAAA:8 a=cUZkHmcggvJ3qwP9TSkA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAyMDA2OSBTYWx0ZWRfX9qQe3gLg5oIW LP+IUt0H77Q9Gv5aoN9V77DgWnVF86jjSqerAffZPS6/PldBzf/9gQaK+2NOMHkSSx5x7EhBY+o 2kMMY9kKuzEMybYz8E9woSHVwL958ho= X-Proofpoint-ORIG-GUID: WMNOPmAvRqJTEtAVLrrP5C0nKJzypkfk X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAyMDA2OSBTYWx0ZWRfX2mT33+JogPto 59ZSo8BviPsmdGsuCRusd4/V2IlAdstcdiTSMNZ/hj7TcI++++3yV3pSdOT1Shm4eMspA8iuWt5 /3HQT1MnX2C0HNJ79w21fHSZ5gRuNaNLF4R9qkvDIySnKgqRh4SGF6v+FdI6lRMBOWYIzVDE1Ov jxizOrRYkr8NYDTTgqfj/eo4N7MBnv6EQfi6Sv6RoDS/CJ4iFLjEmif5iQM6ftXmpWs2zMWgCes N33ezAYgUN/k6vvAyQyvgVJuS/UyjdJhLW/UV953UDutVBmDgM7NVbq8Fh3BFXlz09y/XOnJyAg UTIcfni5nHxaiMnbRQXcd90aHnT5uWho74OCkNgA7FARQJdCgVEg1eF4Xejdd9I6oPhNeL+va2Z r2AEXnr2J8Gt/paW7oOhHHFK47s0GhOWceWoymeWiEr1hW6o90xnWHg+6E/X676Y2v10S+m59xP W7II/lcAQv3m3RG0/VQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-02_04,2026-12-02_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 impostorscore=0 phishscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612020069 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261202_093147_376679_AAC2DA07 X-CRM114-Status: GOOD ( 14.91 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 On 02/12/26 20:39, Andrew Davis wrote: > On 12/2/26 7:26 AM, Sebin Francis wrote: >> Hi Beleswar, >> >> On 29/10/26 23:41, Beleswar Padhi wrote: >>> From: Andrew Davis >>> >>> As the only use for the handle is to fetch the info struct, which is >>> only >>> used by the ti_sci_do_xfer() function, move the info struct retrieval >>> into that function. This also allows us to move the handle validity >>> check >>> inside also, saving us from needing to do this at each message function. >>> >>> Signed-off-by: Andrew Davis >>> Co-developed-by: Beleswar Padhi >>> Signed-off-by: Beleswar Padhi >>> --- >>> v3: Changelog: >>> 1. None to this patch. >>> >>> Link to v2: >>> https://lore.kernel.org/all/20260930160607.2674980-10-b-padhi@ti.com/ >>> >>> v2: Changelog: >>> 1. None to this patch. >>> >>> Link to v1: >>> https://lore.kernel.org/all/20260929201746.4078803-10-b-padhi@ti.com/ >>> >>>   drivers/firmware/ti_sci.c | 306 ++++++++------------------------------ >>>   1 file changed, 60 insertions(+), 246 deletions(-) >>> >>> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c >>> index 6d0ecb77d731e..dbe192142bf17 100644 >>> --- a/drivers/firmware/ti_sci.c >>> +++ b/drivers/firmware/ti_sci.c >>> @@ -435,7 +435,7 @@ static inline bool ti_sci_is_response_ack(void *r) >>>   /** >>>    * ti_sci_do_xfer() - Do one transfer >>> - * @info:    Pointer to SCI entity information >>> + * @handle:    Pointer to TI SCI handle >>>    * @msg_type:    Message type >>>    * @msg_flags:    Flag to set for the message >>>    * @tx_message: transmit message storage location >>> @@ -443,23 +443,26 @@ static inline bool ti_sci_is_response_ack(void *r) >>>    * @rx_message: receive message storage location >>>    * @rx_message_size: receive message size >>>    * >>> - * Return: -ETIMEDOUT in case of no response, or >>> + * Return: -EINVAL if @handle is NULL, or >>> + *         PTR_ERR(@handle) if @handle is an error pointer, or >>> + *         -ETIMEDOUT in case of no response, or >>>    *         -ENODEV in case of a NACK response, or >>>    *         corresponding error if xfer allocation fails, or >>>    *         corresponding error if transmit fails, or >>>    *         return 0, if all goes well. >>>    */ >>> -static inline int ti_sci_do_xfer(struct ti_sci_info *info, >>> +static inline int ti_sci_do_xfer(const struct ti_sci_handle *handle, >>>                    u16 msg_type, u32 msg_flags, >>>                    void *tx_message, size_t tx_message_size, >>>                    void *rx_message, size_t rx_message_size) >>>   { >>> +    struct ti_sci_info *info; >>>       struct ti_sci_xfer *xfer; >>>       bool response_expected = !!(msg_flags & >>> (TI_SCI_FLAG_REQ_ACK_ON_PROCESSED | >>>                            TI_SCI_FLAG_REQ_ACK_ON_RECEIVED)); >>>       int ret; >>>       int timeout; >>> -    struct device *dev = info->dev; >>> +    struct device *dev; >>>       bool done_state = true; >>>       void *caller; >>> @@ -470,6 +473,14 @@ static inline int ti_sci_do_xfer(struct >>> ti_sci_info *info, >>>        */ >>>       caller = (void *)_RET_IP_; >>> +    if (IS_ERR(handle)) >>> +        return PTR_ERR(handle); >>> +    if (!handle) >>> +        return -EINVAL; >>> + >>> +    info = handle_to_ti_sci_info(handle); >>> +    dev = info->dev; >>> + >>>       xfer = ti_sci_get_one_xfer(info, msg_type, msg_flags, >>>                      tx_message, tx_message_size, >>>                      rx_message, rx_message_size, caller); >>> @@ -551,7 +562,7 @@ static int ti_sci_cmd_get_revision(struct >>> ti_sci_info *info) >>>       struct ti_sci_msg_resp_version resp; >>>       int ret; >>> -    ret = ti_sci_do_xfer(info, TI_SCI_MSG_VERSION, >>> +    ret = ti_sci_do_xfer(handle, TI_SCI_MSG_VERSION, >>>                    TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, >>>                    &req, sizeof(req), >>>                    &resp, sizeof(resp)); >>> @@ -579,22 +590,14 @@ static int ti_sci_cmd_get_revision(struct >>> ti_sci_info *info) >>>   static int ti_sci_set_device_state(const struct ti_sci_handle *handle, >>>                      u32 id, u32 flags, u8 state) >>>   { >>> -    struct ti_sci_info *info; >>>       struct ti_sci_msg_req_set_device_state req; >>>       struct ti_sci_msg_hdr resp; >>>       int ret = 0; >>> -    if (IS_ERR(handle)) >>> -        return PTR_ERR(handle); >>> -    if (!handle) >>> -        return -EINVAL; >>> - >>> -    info = handle_to_ti_sci_info(handle); >>> - >> >> Minor >> As we are removing the if checkes, there is a simple if that can be >> removed in most of the functions, but if this is kept for consistency, >> then we can keep it >> > > We are not removing any checks, we are only relocating the checks > to ti_sci_do_xfer(). And although I don't see any such cases that > match the code you list below, consistency/clarity is best and making > functions explicitly return 0; is more clear than having trying to look > back in the function to see what `ret` could have been set to. > > Andrew Sorry, i should have given more context, i was referring to functions like this ``` static int ti_sci_cmd_clk_set_freq(const struct ti_sci_handle *handle, u32 dev_id, u32 clk_id, u64 min_freq, u64 target_freq, u64 max_freq) { struct ti_sci_msg_req_set_clock_freq req; struct ti_sci_msg_hdr resp; int ret = 0; req.dev_id = dev_id; if (clk_id < 255) { req.clk_id = clk_id; } else { req.clk_id = 255; req.clk_id_32 = clk_id; } req.min_freq_hz = min_freq; req.target_freq_hz = target_freq; req.max_freq_hz = max_freq; ret = ti_sci_do_xfer(handle, TI_SCI_MSG_SET_CLOCK_FREQ, TI_SCI_FLAG_REQ_ACK_ON_PROCESSED, &req, sizeof(req), &resp, sizeof(resp)); if (ret) return ret; return 0; } But your clarification answers my question Thanks Sebin > >> ``` >>      if (ret) >>          return ret; >> >>      return 0; >> ``` >> >> Sebin >> >> >> --- >> >