Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5655116rwl; Tue, 4 Apr 2023 01:26:19 -0700 (PDT) X-Google-Smtp-Source: AKy350bpTOiKoBNdwGZ8LJjOVDZ9m42HgIHyv/jATUqK3ztuBXbmEk5NjtgFCwFU1I4Csz83dXoD X-Received: by 2002:a05:6a20:639e:b0:db:d9b6:7fba with SMTP id m30-20020a056a20639e00b000dbd9b67fbamr1227450pzg.47.1680596778763; Tue, 04 Apr 2023 01:26:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680596778; cv=none; d=google.com; s=arc-20160816; b=cA7OP5KheiCHX3ScRPQmbBReCgzjKL/YgzJ8dwu6+wX4ijom3SsjzsFE4UM6ig4Ye6 xW4uth0BcSTp9kzmBmr2n1cCcUzQaKOnUJgNgqvwQag/YAgI+v7R/drpa4nclTk98w35 3k9jFGAPsfbg/vPSsp3mgY8iM109GgR0ix8VWZUFFqQRZgsMVQSyF+MaIe3YMDPgoNBt BGcELNnWxv0TMRP7Ut+5AWm9KIOlSdaIplNMMX09TF8plOzL8Muc5lQyeb4ha72bO4rz 7gcDqN6eL/lUYpum0PhgGmxFw/zotEaVlGuv1YHhRpN266i2rCyWI082IWNmo3w+LpzF X4/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=X3b5qJIOalorokOS7twAewMeNT3gtn3t8Ss3x3cQbCI=; b=0gZtRck2Zj1tWALGL0FT1NE8h9hOrtWmNJJ1IfOavuVNHnA8itCgGtsx3OxPHVLGEE 2ZOsTvKT17b7doSMXxVQDUY4eTm09MyQOuvoN1cZZdFBftWdKQdxJlKjXbCot7eiOwmY +GKGmEXJCOf3hybJhQ9JGas/wNfuDLZk1fnucm1IQjEfAgpjXIHeBPKJfsKfJRSbNGIj tfUPr1PyCnNetTYO0qoUBIDmXi2RR7GkDXkUDXBpp+3OxCohcbhBdZ2qHv1dxBHknImK BYrS6tsep+EAvN9FNGqIsDv0qcM9F/04l54e3pIapqAdpxQPkUCB60gSPDc7ZhFPagRp uAdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=dcYu+YeX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020aa79424000000b00625ebc3b265si10229116pfo.241.2023.04.04.01.26.05; Tue, 04 Apr 2023 01:26:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=dcYu+YeX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234130AbjDDIU0 (ORCPT + 99 others); Tue, 4 Apr 2023 04:20:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56336 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234123AbjDDIUX (ORCPT ); Tue, 4 Apr 2023 04:20:23 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A10DF1A4; Tue, 4 Apr 2023 01:20:22 -0700 (PDT) Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3345usVj014799; Tue, 4 Apr 2023 08:20:19 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=X3b5qJIOalorokOS7twAewMeNT3gtn3t8Ss3x3cQbCI=; b=dcYu+YeXALGc4IXslie6D1Tb0e/70WP9UtTO0hnWEaacdD9ORIewfoz9Jo3yLhVIoVNx 4q8BonxC9msmCKa2nBUq75OCFnMogGj1cVwpiUi1OSjqoDA0s/wMaQ1K9HdG087yJGjO 0oHjqcbYh5tzlIRBc9MzlVKCxqJ93Ujsbf7o5wwDYlea6OwlqM5LkqZQzO2TXBptmDBO B3DGE8JkOlVAXo6mw3SMWcjhLgXLIdr5DaLpGGQTtshDl8pE5Z2rAkVQ3H0Wtj64LtKn +AYJGcz6YOmRNJNcD5wXFS2yLhOCJjHhFfxj/PZEp+nyPFUCCHDZBaRQZ2QETaRwwAWW WA== Received: from nasanppmta05.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3pqw36tr9n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 04 Apr 2023 08:20:19 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 3348KIUt021098 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 4 Apr 2023 08:20:18 GMT Received: from [10.214.66.81] (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.986.42; Tue, 4 Apr 2023 01:20:15 -0700 Message-ID: Date: Tue, 4 Apr 2023 13:50:12 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH RFC] net: qrtr: correct types of trace event parameters Content-Language: en-US To: Simon Horman , Manivannan Sadhasivam , Steven Rostedt , Masami Hiramatsu CC: , , , References: <20230402-qrtr-trace-types-v1-1-da062d368e74@kernel.org> From: Mukesh Ojha In-Reply-To: <20230402-qrtr-trace-types-v1-1-da062d368e74@kernel.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) 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: 4uNhI53zH0IIxZvyxYztqfPi_ilI_20V X-Proofpoint-GUID: 4uNhI53zH0IIxZvyxYztqfPi_ilI_20V X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-04-04_02,2023-04-03_03,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1011 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2304040077 X-Spam-Status: No, score=-2.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/2/2023 4:45 PM, Simon Horman wrote: > The arguments passed to the trace events are of type unsigned int, > however the signature of the events used __le32 parameters. > > I may be missing the point here, but sparse flagged this and it > does seem incorrect to me. > > net/qrtr/ns.c: note: in included file (through include/trace/trace_events.h, include/trace/define_trace.h, include/trace/events/qrtr.h): > ./include/trace/events/qrtr.h:11:1: warning: cast to restricted __le32 > ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer > ./include/trace/events/qrtr.h:11:1: warning: restricted __le32 degrades to integer > ... (a lot more similar warnings) > net/qrtr/ns.c:115:47: expected restricted __le32 [usertype] service > net/qrtr/ns.c:115:47: got unsigned int service > net/qrtr/ns.c:115:61: warning: incorrect type in argument 2 (different base types) > ... (a lot more similar warnings) > > Signed-off-by: Simon Horman > --- > include/trace/events/qrtr.h | 33 ++++++++++++++++++--------------- > 1 file changed, 18 insertions(+), 15 deletions(-) > > diff --git a/include/trace/events/qrtr.h b/include/trace/events/qrtr.h > index b1de14c3bb93..441132c67133 100644 > --- a/include/trace/events/qrtr.h > +++ b/include/trace/events/qrtr.h > @@ -10,15 +10,16 @@ > > TRACE_EVENT(qrtr_ns_service_announce_new, > > - TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port), > + TP_PROTO(unsigned int service, unsigned int instance, > + unsigned int node, unsigned int port), > > TP_ARGS(service, instance, node, port), > > TP_STRUCT__entry( > - __field(__le32, service) > - __field(__le32, instance) > - __field(__le32, node) > - __field(__le32, port) > + __field(unsigned int, service) > + __field(unsigned int, instance) > + __field(unsigned int, node) > + __field(unsigned int, port) > ), > > TP_fast_assign( > @@ -36,15 +37,16 @@ TRACE_EVENT(qrtr_ns_service_announce_new, > > TRACE_EVENT(qrtr_ns_service_announce_del, > > - TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port), > + TP_PROTO(unsigned int service, unsigned int instance, > + unsigned int node, unsigned int port), > > TP_ARGS(service, instance, node, port), > > TP_STRUCT__entry( > - __field(__le32, service) > - __field(__le32, instance) > - __field(__le32, node) > - __field(__le32, port) > + __field(unsigned int, service) > + __field(unsigned int, instance) > + __field(unsigned int, node) > + __field(unsigned int, port) > ), > > TP_fast_assign( > @@ -62,15 +64,16 @@ TRACE_EVENT(qrtr_ns_service_announce_del, > > TRACE_EVENT(qrtr_ns_server_add, > > - TP_PROTO(__le32 service, __le32 instance, __le32 node, __le32 port), > + TP_PROTO(unsigned int service, unsigned int instance, > + unsigned int node, unsigned int port), > > TP_ARGS(service, instance, node, port), > > TP_STRUCT__entry( > - __field(__le32, service) > - __field(__le32, instance) > - __field(__le32, node) > - __field(__le32, port) > + __field(unsigned int, service) > + __field(unsigned int, instance) > + __field(unsigned int, node) > + __field(unsigned int, port) > ), > > TP_fast_assign( LGTM. Acked-by: Mukesh Ojha --Mukesh >