Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1926546lql; Wed, 13 Mar 2024 12:03:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW2JS2pUkYvVR2nPQyMkLUQe4yUASrtb9lmstkM8ORvFCfl1LaZ4rxAyYshqX4fXQr2Dqj++MHnNq/gTFfB3MfSs8t/izB0o9c1du2cUA== X-Google-Smtp-Source: AGHT+IEVJN2/tX6kqIEJNNW5/LjFojSUWZoc2tbppWlkIoDbwd1R2XIOy+MgmRPx6ldQ+x6hYDZD X-Received: by 2002:a05:6808:f09:b0:3c2:1d9e:b7fe with SMTP id m9-20020a0568080f0900b003c21d9eb7femr899757oiw.30.1710356630114; Wed, 13 Mar 2024 12:03:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710356630; cv=pass; d=google.com; s=arc-20160816; b=oDpJnxMht5ql0j+f/UI6Y6h5qgqOdTfG9fn9AY6IEnbF5RkBglS56nFhUEkniLWliY DAjb5cYg8rfrhArPTjDlR0l6KOTJglmk4h1lL+JzlyswE+6cjpMQIvHHTVaXBjnok6CK Y6lcG9w24+hUSLfbkNxb9q4LIa0qCzQz84WS+MPJ1AvgN56SG1Upago87unxfEb7mTGz SkHfElpM0oIhfjkeYKXZiOI0GeTJnyBIWWm9wRBW8XHiTojL1IqKTEt2eVN/1SkAGQVE u2gw8/4jw/EQEsbF7MzOBtCbQgTJawI0SEmfhSj8sYPt6gCmNV7vwGyU4EeYbVBplchb yu4A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=scks9tYyUMDTRmnslv2srjZa5cALFnqvoeHDv12bEXg=; fh=kymA80FmMbAsBORuYeK2CBlsUlR2t9ls16N11esSayc=; b=xzKxLsrI78piR2OX6/60Go6llfk4ynZkktn+3HWX/A5fT66uvIBIAsl/x1GUjaKF9e VJJf3xsuZ/H+6vGQck7/nOhtroT30mPxHDK4B6kt7TiGzON09FEC0I6em0dRRAIeZs6w jNv8xWZu/bmRAU/oorp7Rcv/DV/m2foyxfKJQNEhQmcGgs6d8atJJGHruGpqyX0I9FZ1 OhmJkcBxaW0xsZgDZGoVObJ5cVui+Fnnl1OAXnnHstrb16TdIy7J35e49eS+XXYWdPPb h296jh6j02maRzgxck1t8TtEQ3BfBg6SeoH47+nc2G5Qc2gbktx3FmoCsa6CpJZgp3HS YGGw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=iU+dh2TT; 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-wireless+bounces-4691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4691-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ez3-20020a0561302f0300b007dbb049e556si1629602uab.125.2024.03.13.12.03.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Mar 2024 12:03:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless+bounces-4691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=iU+dh2TT; 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-wireless+bounces-4691-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-wireless+bounces-4691-linux.lists.archive=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 1AA011C27256 for ; Wed, 13 Mar 2024 19:02:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8FD6769DFF; Wed, 13 Mar 2024 18:04:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="iU+dh2TT" X-Original-To: linux-wireless@vger.kernel.org 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 F017469DF7 for ; Wed, 13 Mar 2024 18:04:51 +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=1710353093; cv=none; b=rp+dxsEjp9hIm3WhI3ESlfI9IzwSzp9vJFbiK8jXESl6QzdKijDn7rUd+YIBfrDd59S7UJixNkZh7OVZ/bpaSFtP0UYc426a5K7gRDq61DfOuT+oxzo8cjxtw7OaU3KBQbS4zrRLtHM7LJskG8ijltbetwChBMU2lXEHIJvKxpE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710353093; c=relaxed/simple; bh=B7ys/ab6JdYM7fkgVjxt2EyFm5ZIcgd9Gb44a4sf1Ik=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=B1qNQmSonpiDzN7yWyFH3PedJLOVN+BOks96O7ZujZBbBapXnB+HTDm27ql/hsUOTJjQugv5WAwdfJ1O6Yvadm/GZf39nrkNGFwKXLCca38XlZzxFk8AU5ZEJwAsnDpdHLGxjdR5lYEvkDbTqPIl9ufCdw46CEX6zNuzd+XheF8= 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=iU+dh2TT; 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 42D9v9oW007297; Wed, 13 Mar 2024 18:04:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=scks9tYyUMDTRmnslv2srjZa5cALFnqvoeHDv12bEXg=; b=iU +dh2TTrN1JSsUZv1fik7LWagnOOxrJn7H9MewamhvTLoyQf9SHtIwUiX/YPsppi7 r/BZOtaHxVQgrJeuOMt4taBOep/on+nmKtvRXzJmZqv7dNWRCfq59m+qeiVkonDD 4iC+LSvT583fwg5NsgVBWTj+7RrCMUCBNVyGlT236Ey9ZqYT4Tj4uxNmc73Y/S7K 0LdLH+Qs9a9QuWr5PIAGzOMokoVHzrh6kGlVOKZN9iwRkf1pUdN8GCRF+wG6/2pu xTG2YfzZaXxjVdPhfZ5zgzebSonWHQl8qAG2I8deCzM9HDh1dOX0ePdp3oDvsk5O zhiQ6x4USAznZi1Bc0nw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wu9y3s2ry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Mar 2024 18:04:46 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 42DI4jp6002860 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 13 Mar 2024 18:04:45 GMT Received: from [10.110.27.195] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Wed, 13 Mar 2024 11:04:44 -0700 Message-ID: Date: Wed, 13 Mar 2024 11:04:44 -0700 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 01/12] wifi: ath12k: add multiple radio support in a single MAC HW un/register Content-Language: en-US To: Kalle Valo CC: Rameshkumar Sundaram , , , "Karthikeyan Periyasamy" References: <20240312135557.1778379-1-quic_ramess@quicinc.com> <20240312135557.1778379-2-quic_ramess@quicinc.com> <4a527729-2bf8-47ce-8275-d36b76bde95c@quicinc.com> <3178cf8c-d328-4fe2-b3be-f5c4c908f20f@quicinc.com> <605a673e-3686-47d0-b71b-1e314fde65db@quicinc.com> <87il1qf571.fsf@kernel.org> <87edcef4qi.fsf@kernel.org> From: Jeff Johnson In-Reply-To: <87edcef4qi.fsf@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: ehXgaA8TvWHcA0CCSqY7-kG8qzDYlNJ5 X-Proofpoint-GUID: ehXgaA8TvWHcA0CCSqY7-kG8qzDYlNJ5 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-03-13_09,2024-03-13_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=956 spamscore=0 impostorscore=0 adultscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 bulkscore=0 malwarescore=0 clxscore=1015 phishscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2403130137 On 3/13/2024 9:58 AM, Kalle Valo wrote: > Kalle Valo writes: > >> Jeff Johnson writes: >> >>> On 3/13/2024 5:57 AM, Rameshkumar Sundaram wrote: >>>> On 3/13/2024 3:23 AM, Jeff Johnson wrote: >>>>> and guess we have to figure out how to suppress the ath12k-check issues with >>>>> this macro >>>> ath12k-check complains about the reuse of ah and index arguments which >>>> may get evaluated multiple times if its an arithmetic expression, But >>>> areas where we use the macro in our code aren't doing so. >>>> Do you have any suggestions here ? or shall we go back and use this >>>> for-loop inline. >>> >>> The macro makes sense -- we'll need to update the overrides in ath12k-check. >> >> IIRC it is possible to avoid variable reuse in macros with typeof() >> operator (or something like that). I can't remember the details right >> now but I think there are examples in the kernel code. > > Here's the GCC documentation with an example: > > https://gcc.gnu.org/onlinedocs/gcc/Typeof.html > the problem here is that the macro actually writes to those arguments multiple times, so we actually need to reuse the arguments the macro as defined exactly matches the semantics of other for_each macros in the kernel, i.e. see in include/linux/list.h: #define list_for_each(pos, head) \ for (pos = (head)->next; !list_is_head(pos, (head)); pos = pos->next) what I don't understand is why list_for_each() doesn't trigger the same checkpatch issues. even stranger is that if I copy that macro into ath12k then I do see the same checkpatch issues: CHECK: Macro argument reuse 'pos' - possible side-effects? #998: FILE: drivers/net/wireless/ath/ath12k/core.h:998: +#define list_for_each(pos, head) \ + for (pos = (head)->next; !list_is_head(pos, (head)); pos = pos->next) CHECK: Macro argument reuse 'head' - possible side-effects? #998: FILE: drivers/net/wireless/ath/ath12k/core.h:998: +#define list_for_each(pos, head) \ + for (pos = (head)->next; !list_is_head(pos, (head)); pos = pos->next) So I'm really confused since I don't see anything in checkpatch.pl that would cause the behavior to change between macros in include/linux/list.h vs macros in drivers/net/wireless/ath/ath12k/core.h /jeff