From mboxrd@z Thu Jan 1 00:00:00 1970 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 C9EAB341062 for ; Tue, 27 Jan 2026 10:31:53 +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=1769509915; cv=none; b=ar6Y9cAhXwU85Ss5NQY4aCVCnx2GJAK9XSfBdOdvC/KkTU6azoZ1ExXW5JYajjcA3guU1K7Yldw344VF3TIFLgPO0K4L43Ka1+1A6pSbl2lfMH+xpw6oLGYblWaplyaRiLknNKotm+Zf+dZJjyVgPwD4Wyk5/x1ApgthgSxsdtU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769509915; c=relaxed/simple; bh=FK3EK1jV0Z7qak2c8B+ckxGBJSMVCxnxjKEjxmBcuGk=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=QhlbuDyz02W5LcXwk9HwC7K7DeGBXgR9S6ju697hnxca61R7ytSleHPi0yN2iPaqpT0sDVE5kRnW0MBXZOfWQrXHQ0VRCgvIITBEVfAhqs5IvSUe0sy5J3uzNdeUHWCyNcggfDvoll3xTZAe1wl3WSKqTIT0rAgGGYvunJY0BqA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=VpbgMBTt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=FPUUxyWS; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="VpbgMBTt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="FPUUxyWS" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60R7Rubh112530 for ; Tue, 27 Jan 2026 10:31:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 37tcbhoPYX1kRiSMkZWCZCo/kuU+XTXOWQTT0gGxrLo=; b=VpbgMBTterYa7iOJ oxFdYYaxp3SrlWVXnmI2qwyqoUYZA4x7bkqjdxL/8lBVc6/cgYYgXtEtKAteh3Fo lJ7Bj+Lf2eX7GK4dUMYfZShUlXQVAf4D4WlWPI/bQu70orCj84ovJkfftPIs2f0b wYDIFsNphcl6NZkpDK7cARi6Nyn2PKoS55zHaGkTe2u3Z+8Fws1GyF9GzHAHzk3Z 7DECCJ0G3hwobGrxP/C6vcFJdJioakubSnqnxiqeBQxuvAaK+zXwjRiGOthRJl34 2394p2WaT9J3zCNBf6iy+Sg01UPxQFfWdQMc8kl968JMMKjN6R7OeJU98Up0bkbo YRBu8Q== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bxs0e0py9-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 27 Jan 2026 10:31:53 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-8c522c44febso80600185a.0 for ; Tue, 27 Jan 2026 02:31:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769509912; x=1770114712; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=37tcbhoPYX1kRiSMkZWCZCo/kuU+XTXOWQTT0gGxrLo=; b=FPUUxyWSOY/P9qtoUyrxsrhEfcKEn/IIM3USEvuSDzZEdsEUL9mb1iSBEsK5vWvCW2 TPjSu5uw2gva/RJqKorI+2mNSx1cUmLFZB5bfPyz7wz5U+I/NeeKkZk9ZJPJXgIPy4Gx qTT3rvPaRA50kdoVAOmKPqrSUInEOfSoz5BbnNUdRHFwFxuIDWkJUgKtqpnZY/4CbTNm L8FAAEYWF4bKJX3TgB8KxKTrGsRAMTfuaE5fr7FGhpcAz6uOoGsXpoEZNbK03xqkyNiE DDMdoLqH/z78A3H3J9PYCUIhRvIBh6MJk+wN5moK3MCBuZrojaNLLaldncOvWSedtNA5 2sDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769509912; x=1770114712; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=37tcbhoPYX1kRiSMkZWCZCo/kuU+XTXOWQTT0gGxrLo=; b=n+thkNyyTF2OpHfVXJUdMg50EmdDvjr0hvezcGJT76QiktlCBD0cojOX1peoDRjGgQ pnClxh6PMAV57KrT0cE/3+2nC/7tnqqIfH5jF1lqqnhsgk9vyZWbbaUTCDBGQoahbMPI KRwq8p+IjtYygbASZdWefsK/pg/Z63U3PdxbZ/+RW7V9w0SbKxC7/JhvE35AA/r+SQzi uSmQ2cK8InlZsqPszChs/Kqk4oD27aOcnb4TA2UGtpw6awQxHSwMgbQyAPKO7AiY6TNH IbuxxL791C/60DYgInGY0l5XZLuV0RzFkfB7U7uwHoABvdr1RTAtU9mQggeNeEW+p/ql YccQ== X-Gm-Message-State: AOJu0Ywx3C/isXAE6F9f1aIz4OYJxQwu4dl8PJJH2d5MeDIG68FWgfrj sZyDsX4kH0yWFp7WurTNVXnNrhEClCqbikJanuPTROCgOTSb0WXKfkdLZf1udiEKOF2hJEOgOhH gtpzFDyX0yvVFnCq+xYCk0oVvi/sHVzXinwiar2aZI4lK8m+y3WmVAMDfQVU8YKzmgOY= X-Gm-Gg: AZuq6aJpq9mJWu8cq4qEdKWq4DrwWMGBLGg3MUbQehVsvWJuh8HZQqDy1kOjf9kaDU4 ExJWWn11H0ElzBgi8d8G8BcadVV93qMqVgbFVs5qFqLpODUl87THW7Dyy2wmPG0titH6i1qoB9l 696EE3WpkY9nB+n9yTiADmZyloZ2bH3tk3Kifd8/VLt4Bc/77hvsKyx1huR3z3UJ0jkAxkG5IKq /US/oFchKged+GTQe0eyPofM9d7WEuxAPv+dJzPC/lemdgqW/f8sdGMVFgal3xTzE8H35Hpt1G/ Pa4BnFJJuixr4l3RcX5KzLEVQ34NW76qSp7k5SHwJW3yzYOLX2uZ02q4kxFjzq2QQVOL3O2Xg0q KMPLTJ1Vs4dGM/do8I0/RkX+l4hMgfwzrhFPmp1gMZOOaDI3uE/X9bxgNurI5RYAacf4= X-Received: by 2002:a05:620a:72ae:b0:8c7:f61:eff8 with SMTP id af79cd13be357-8c70f61f3f6mr10057085a.10.1769509912029; Tue, 27 Jan 2026 02:31:52 -0800 (PST) X-Received: by 2002:a05:620a:72ae:b0:8c7:f61:eff8 with SMTP id af79cd13be357-8c70f61f3f6mr10054485a.10.1769509911500; Tue, 27 Jan 2026 02:31:51 -0800 (PST) Received: from [192.168.119.254] (078088045245.garwolin.vectranet.pl. [78.88.45.245]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b885b766733sm758314166b.55.2026.01.27.02.31.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Jan 2026 02:31:51 -0800 (PST) Message-ID: Date: Tue, 27 Jan 2026 11:31:49 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v10 4/7] qcom-tgu: Add TGU decode support To: Songwei Chai , andersson@kernel.org, alexander.shishkin@linux.intel.com, mike.leach@linaro.org, suzuki.poulose@arm.com, james.clark@arm.com, krzk+dt@kernel.org, conor+dt@kernel.org Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, coresight@lists.linaro.org, devicetree@vger.kernel.org, gregkh@linuxfoundation.org References: <20260109021141.3778421-1-songwei.chai@oss.qualcomm.com> <20260109021141.3778421-5-songwei.chai@oss.qualcomm.com> <66aae641-a340-4f0b-9d68-535ac296a335@oss.qualcomm.com> Content-Language: en-US From: Konrad Dybcio In-Reply-To: <66aae641-a340-4f0b-9d68-535ac296a335@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDA4NSBTYWx0ZWRfX8b1Rb6XO6v1b 9mL+iCYETxPTwqaQXZ8mNrTSYiHr/pfBF4AyvCDkO6YqRoyxMkJy4pYXS4BLdqG5C2hh5k9aRoe v3Sffgr0UEzxGS9MRjblenhvocOFUsoRnMfo8O5W4Bqy+T+1W8ZpEhfNpqeJoC9hTtgpgpJ06A7 LRKlqlaFSwMHZbEfNknMH3bWn2CuCIoG4Bpxpn8YdTpPChRYU/xARmbNQd52fbwvN5nCJvEW5OG EsBc1UFxApDiYOnE8XtdYITJaT7qN1S46rxo9S+tPIgRqCpEa4AES8cucwtqm+rKNoagfZgeNBl wiP5J8t3FgKt70Z6ptuWskhevixCtfHzRhlFNJW/vEPFMMTg2DM8R5ZlO6o0b05PqwZ//d4Rd0c SSPim8EFUInu2sdBQXutWashAqlLG+1uXO+EB1e69QEuhVKzPXVlMl1+vHrQE7U+uohZWGYXQlU xZvMD+5NlFsJ9Cuz68Q== X-Proofpoint-ORIG-GUID: rys9_xZKdlQreKJ5sqNQJX0FpO9E59rU X-Authority-Analysis: v=2.4 cv=Hvh72kTS c=1 sm=1 tr=0 ts=69789419 cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=FpWmc02/iXfjRdCD7H54yg==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=8EjekOa2TPCR8v-6VwQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-GUID: rys9_xZKdlQreKJ5sqNQJX0FpO9E59rU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.20,FMLib:17.12.100.49 definitions=2026-01-27_02,2026-01-26_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 suspectscore=0 phishscore=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 impostorscore=0 malwarescore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601270085 On 1/27/26 3:34 AM, Songwei Chai wrote: > > > On 1/13/2026 7:13 PM, Konrad Dybcio wrote: >> On 1/9/26 3:11 AM, Songwei Chai wrote: >>> Decoding is when all the potential pieces for creating a trigger >>> are brought together for a given step. Example - there may be a >>> counter keeping track of some occurrences and a priority-group that >>> is being used to detect a pattern on the sense inputs. These 2 >>> inputs to condition_decode must be programmed, for a given step, >>> to establish the condition for the trigger, or movement to another >>> steps. >>> >>> Signed-off-by: Songwei Chai >>> --- [...] >>> +    switch (operation_index) { >>> +    case TGU_PRIORITY0: >>> +    case TGU_PRIORITY1: >>> +    case TGU_PRIORITY2: >>> +    case TGU_PRIORITY3: >>> +        ret = operation_index * (drvdata->max_step) * >>> +            (drvdata->max_reg) + >>> +            step_index * (drvdata->max_reg) + reg_index; >>> +        break; >>> +    case TGU_CONDITION_DECODE: >>> +        ret = step_index * (drvdata->max_condition_decode) + >>> +            reg_index; >>> +        break; >>> +    default: >>> +        break; >>> +    } >>> +    return ret; >> >> The only thing your switch statement is assign a value to ret and break >> out. Change that to a direct return, and drop 'ret' altogether >> > > I kept a single return intentionally so the function has a single exit > point. This makes it easier to extend with common post-processing or > debug logic later if needed. > > That said, I’m fine switching to direct returns if you prefer the simpler style here. It's up to you. Do you expect you'll need more debugging or extending of this function in near future? Konrad