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 8160B52F88 for ; Sun, 4 Jan 2026 22:49:00 +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=1767566942; cv=none; b=tMrzKTWxFeH6oJkwEVgc4Xke/uX65ALnUdjBe0c5xkI025qe9yybwzm6AgIICWhzVYrb2gvg4mjNQgSKVLEyIMCYlXtrqFAQ4VsG+lj2ToGJ5BTNYscHZlKR38uQq0WBwJmcrB4t0VoE9gYzdKpXIy5lmcUJHWAGz2okp5vAhHE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767566942; c=relaxed/simple; bh=zE1vpm2UBtKXFSIWtO3EvHyFceAauG46kIibQY7dsZY=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=udWcNgecL+jlYRZv0ejg/Bsi4DWJv7up+iPiDo9BsslKYHC/pbuz/eOmLWGprH9VfBokossgN2ZI2Bw074NsXbrvcIaoY9mJPk0aqMa3/UN/QQbWjXm5qkesqsHgcLBbbjynPyP6MwDhrLxfQWdorrhmdCCiYp7nYN6WoW33hzI= 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=pqKYHZop; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=cvpgCoZl; 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="pqKYHZop"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="cvpgCoZl" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 604Me1g43617120 for ; Sun, 4 Jan 2026 22:48:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= LaEu4i9Ss5ICFhfsy7EyyVcKTEq3KRBwxvKW89uDbsE=; b=pqKYHZopAFFSui1V d/GjmjbUoHlVsx3bpB0SZAHecUCxJLcfQUM0S7fvcbo5KVoctqOydCxwgiKYywau UIVAS/SagJvSYnz+qusAqjlOzP4WgviHdw7La58oznUsnmxsufE+9diMjFZ0CWSK 64nLa1/CMdioSBTDVpYYYHr9XASdk9iGpTdLaa2+S1OEBmQLkxO/rwMc9LAAo/PL nZkskzbaINViR4DoEtra3rIhjuOdXvnp+P8kkAaVgjCzY5UfW5sYrUwgzLznBt9H S6WjeKETfhyMgmUPEwEPDisXU6j36eM1pZuQcry88h46A6rpR1sHLw7U9+5M4rWk +ploEQ== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bet2qtpxb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 04 Jan 2026 22:48:59 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-7b89c1ce9cfso14274115b3a.2 for ; Sun, 04 Jan 2026 14:48:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767566938; x=1768171738; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=LaEu4i9Ss5ICFhfsy7EyyVcKTEq3KRBwxvKW89uDbsE=; b=cvpgCoZliYfdHgwRkAl8Y9CClZ4GO4gwUGnqnOxhDhxLyFIWgm0SZhhlRGT2KO1oOW gTg604pOpKdav76FNTcYTR8gPG1DzN9tosUgU1MJpIvDH+Kdfhj7zQYKURR6I3LjKYnq uAWZaXWO9Uomnu0ndl0yd7m0Le6b7b1QVxoIeXzQ1f4NIlV0lAfJ1crZ77FA+MJasRvD cFMHVA7Yzv4s+kwlT70GrL8Hr2zOwy4ALmg0aSYr8q8Dvav71QWXas8sDJ7w8kyvIzVg rMWrOHZQgQK19iJR1PF+Ty7XKwttvjvcrRpUa6pkBy81i72dSaOgx84AcxQxAAhseL25 iJug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767566938; x=1768171738; h=content-transfer-encoding:in-reply-to:from:content-language :references: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=LaEu4i9Ss5ICFhfsy7EyyVcKTEq3KRBwxvKW89uDbsE=; b=H9WOuIlG6GBQ0xqp4p6uMQv2SoPTd3ukHrrzVEH2/8ASO3hzRphk7RDsho3mKDUdbc aZTUPNYKfyYhsOZbTnzfLVfyrpTAk/+FwvAg8rc6tgoQaYtbfKMhiqHKAa9bKjS8fXEq G0ZMnpFXo0kzoj46PGtfEOUf1bZV9137SzLc3lm//C9MnDyzZbf0ccl1VNS3KlLHJVZA U+dir33b3ss9Wt4UucRJLH02iWgJ7AvaWubo2+kAcN5jmICcZCpz0PkJ5xvO4UYfc2jh CKlGk7SsrJbZGNHG0y3+qBfq11czVh55o/0tiLapSn6fLR3hMng/ME4QRhLbpXeO/Woh vyog== X-Forwarded-Encrypted: i=1; AJvYcCV+qAuYk4jnMtQRS2kCJ2NVilsGvBs6etkhMAR/GLZ8NNiJzMGlKhni0JSu9WfP9LwsQkz1+6cuuAZnaww=@vger.kernel.org X-Gm-Message-State: AOJu0Yxl7sxb8z3HnuLkNODUZjyNdfZE6dRKgHjs/+iAK7qqXvJxb/Af //qrs35cyq3Cd5fyIqYpf9ohZLGgx/CrfzexpoNOW7bgFBOI0xWhMisWmtM+whTaRUle+hAQFIr BGY2t2W58/FmZONtDMnXEO+eeNBugfDkTEpoIpteOk+c0mZCgYJFS8tBxneaXBnLV0JxxMmhoUQ == X-Gm-Gg: AY/fxX7eSc5AQ8w+ItDsEQZ4WiSiM2Cd+PfVUfSnETWqV6bXRfvzPxCQJgHS/nS/NkA Rnr30QhlgGvoDNrXn2tuguP4QZkZEa9wmB7g7D52ZxShIbD0+0BFNbngls6+HypQuAHoKmFr6qa V0cheOnU6uootAIgypqVLQewYmJ6Gy/eU4USu54dNZto6gCyxP/FGSdA6gujcaaKa7nIu9eFaRI ehc5JV98x5S/McXEfKAkynunLz9iIn9tpsBvntcOtvsRxCdGKuwWgmQj6NnoDbVGLyQscqNF4kk Q493BPdBxCr1H0I2RcxvLY2bGSd062JhwhqH/mWHpUx0zpougzy+noKwJNVFNLy6Yvdg5metXjL c1uakoQFl8qZE/eQCZIB1Nzvf8q/3ov94J0xV7Oy0LPrGWOS0q+ZxmkF+b04XHKCf8A8zmyrldt p82iwUAAw= X-Received: by 2002:a05:6a00:a885:b0:7f7:532a:e44b with SMTP id d2e1a72fcca58-7ff65f78a13mr39009055b3a.41.1767566938301; Sun, 04 Jan 2026 14:48:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHt476BmHGHKB7jNiFCnddknZmEegIAAcs50j2xzI/2wAdhXcWoaTsug++HzAXl9e3RTethqg== X-Received: by 2002:a05:6a00:a885:b0:7f7:532a:e44b with SMTP id d2e1a72fcca58-7ff65f78a13mr39009049b3a.41.1767566937789; Sun, 04 Jan 2026 14:48:57 -0800 (PST) Received: from [192.168.0.74] (n1-41-240-65.bla22.nsw.optusnet.com.au. [1.41.240.65]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7ff7e48f300sm46136305b3a.54.2026.01.04.14.48.55 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jan 2026 14:48:57 -0800 (PST) Message-ID: Date: Mon, 5 Jan 2026 09:48:53 +1100 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 2/3] tee: qcomtee: mem: Fix confusing cleanup.h syntax To: Krzysztof Kozlowski , Jens Wiklander , Sumit Garg , linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org References: <20251208020844.5310-4-krzysztof.kozlowski@oss.qualcomm.com> <20251208020844.5310-5-krzysztof.kozlowski@oss.qualcomm.com> Content-Language: en-US From: Amirreza Zarrabi In-Reply-To: <20251208020844.5310-5-krzysztof.kozlowski@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: Myf8rpJoO9P1fnWPX0qf9sUm05OQrOBP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA0MDIwOSBTYWx0ZWRfX4h4tOGX4xuHA d51o3HDxsBb72407g0tCwlr7KYksxrRRgCH82RE1N0v6jttdzCdwFs9N+s1wMX34W5us1lXICAV wbCP5muqE9/2/8Txihx2MmnpzA67IglIihLgrRQfAbkn/CcDHXMvUsJz2Z2Kb54E2yKJ+bNAaHT CTKAUPXWBeh1h9C0uJDcmzFVRKzWwdE1F9M1Ieg3ziYeMoERg/WtoGf4QoCtteczE4kD58n2tBv 3PLbD3uH9qa8aUuIAPgFYHY2/r3JmBjaV+ksS+kr6m+iig+Y8Xn+eqxAEllpzZl8AeXyNB8lZCi tCrtiBnXX8Xe85SgnZhMPYWx7eYxPCKRT/w3gaM4tTwQIWZ6AOkZ8TaMVmu0he7w4S9nADdQXtR 3IHq4Kiiu1oYCdKGlTQFBFbfyoCWt3z0kz7RYpmtalbd+pvXZK/ELw8p07uFWcW7fc7GjcUBRaY lvNsrN5M9RL0WsQcTzQ== X-Authority-Analysis: v=2.4 cv=RKK+3oi+ c=1 sm=1 tr=0 ts=695aee5b cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=hi51d+lTLNy/RbqRqnOomQ==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=FIGAOsSgX-vrdh4HXBUA:9 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 X-Proofpoint-ORIG-GUID: Myf8rpJoO9P1fnWPX0qf9sUm05OQrOBP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-04_06,2025-12-31_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 impostorscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 bulkscore=0 adultscore=0 clxscore=1015 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601040209 On 12/8/2025 1:08 PM, Krzysztof Kozlowski wrote: > Initializing automatic __free variables to NULL without need (e.g. > branches with different allocations), followed by actual allocation is > in contrary to explicit coding rules guiding cleanup.h: > > "Given that the "__free(...) = NULL" pattern for variables defined at > the top of the function poses this potential interdependency problem the > recommendation is to always define and assign variables in one statement > and not group variable definitions at the top of the function when > __free() is used." > > Code does not have a bug, but is less readable and uses discouraged > coding practice, so fix that by moving declaration to the place of > assignment. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/tee/qcomtee/mem_obj.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/tee/qcomtee/mem_obj.c b/drivers/tee/qcomtee/mem_obj.c > index 228a3e30a31b..a16f8fc39b8d 100644 > --- a/drivers/tee/qcomtee/mem_obj.c > +++ b/drivers/tee/qcomtee/mem_obj.c > @@ -88,11 +88,11 @@ int qcomtee_memobj_param_to_object(struct qcomtee_object **object, > struct tee_param *param, > struct tee_context *ctx) > { > - struct qcomtee_mem_object *mem_object __free(kfree) = NULL; > struct tee_shm *shm; > int err; > > - mem_object = kzalloc(sizeof(*mem_object), GFP_KERNEL); > + struct qcomtee_mem_object *mem_object __free(kfree) = kzalloc(sizeof(*mem_object), > + GFP_KERNEL); > if (!mem_object) > return -ENOMEM; > Reviewed-by: Amirreza Zarrabi - Amir