Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp541456pxb; Thu, 23 Sep 2021 05:53:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBFu1TAc+OrGA4MhM+1v2KOAnMbgGzIKOJiBFzXqG7cnXMBY+TGu4lr4SOxq/oweEo6CoD X-Received: by 2002:a05:6e02:1c41:: with SMTP id d1mr3437514ilg.31.1632401582674; Thu, 23 Sep 2021 05:53:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632401582; cv=none; d=google.com; s=arc-20160816; b=0H1sDSJy5d7FPWveb8UHAPwX2/u7wTLaXGaF0vQ2JDuoACEGNqFSbFDhG14g/Ku38V pDuBTpqZqc139DBS8TTv69aZXl9H6O5AxQd3/RcKlgj8TCxqfUO+F1SdyfVajLSpZF9f sFotNOXvSOqOlqWU9Dc0syELzYP/IaDbAveh3clTlflnXHwoXubJbyQuv6Tj3PD0UrbI auLa/QlhZHsF4qezLWMOBXcsBK4jnCkPKpvDy1q2KD58Nj/8KtC7H394qdkEF67oin55 ShiyQm67jVENDUOo8C0V44LTJ7dSpDWxkeUXNr8DwYKNHO6PVdSusQoMOFplXsxoNi5S oo5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:thread-index:thread-topic :content-transfer-encoding:mime-version:subject:references :in-reply-to:message-id:cc:to:from:date; bh=7pUpMxPfy/2PQbxjhw+IDrnD/2YfllouOw5ai8aZBAQ=; b=Mj2yAugiX6l/vmVcTdHBuRgxGFgpZU9AJjakpCpvjQtlYFh39X60vMAYbU+L6Y6A4X TzIWaeMT9LV0aLZxAsm2eO3NiHPUQxahw/svjxKwKfHv6MeBgHpII90Kn2tdZ/iWTJLe rFTdWVi5npD1sugyC7YbuidOU4m4A9q3LqcmuqibAHSM3ry7lI3FzsgimgJS30Dgt/mq K5TNtjziOJzADmtwYMAHMA54l8aeBhXDAJqiTuln86KGhwMI0XLkG6sEHhys2c5Q76SO AT0nxle3ijJ7ucj6I8bNGm2mEM9wCxhZiAtz+jRjEeozbH/KpFrVn595A47YweGm9K96 rxmg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a17si6319432jar.110.2021.09.23.05.52.51; Thu, 23 Sep 2021 05:53:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241144AbhIWMxd (ORCPT + 99 others); Thu, 23 Sep 2021 08:53:33 -0400 Received: from smtp179.sjtu.edu.cn ([202.120.2.179]:56256 "EHLO smtp179.sjtu.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240787AbhIWMxL (ORCPT ); Thu, 23 Sep 2021 08:53:11 -0400 Received: from mta04.sjtu.edu.cn (mta04.sjtu.edu.cn [202.121.179.8]) by smtp179.sjtu.edu.cn (Postfix) with ESMTPS id 6AACD100B0956; Thu, 23 Sep 2021 20:51:37 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by mta04.sjtu.edu.cn (Postfix) with ESMTP id 5032F185F5217; Thu, 23 Sep 2021 20:51:37 +0800 (CST) X-Virus-Scanned: amavisd-new at mta04.sjtu.edu.cn Received: from mta04.sjtu.edu.cn ([127.0.0.1]) by localhost (mta04.sjtu.edu.cn [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vJ3hqoUkK9xP; Thu, 23 Sep 2021 20:51:37 +0800 (CST) Received: from mstore105.sjtu.edu.cn (unknown [10.118.0.105]) by mta04.sjtu.edu.cn (Postfix) with ESMTP id 25B611804EE54; Thu, 23 Sep 2021 20:51:37 +0800 (CST) Date: Thu, 23 Sep 2021 20:51:37 +0800 (CST) From: =?gb2312?B?ufnWvg==?= To: Mike Marciniszyn Cc: Dennis Dalessandro , dledford , linux-rdma , linux-kernel Message-ID: <2038588983.392567.1632401497054.JavaMail.zimbra@sjtu.edu.cn> In-Reply-To: References: <20210922134857.619602-1-qtxuning1999@sjtu.edu.cn> Subject: Re: [PATCH] infiniband hfi1: fix misuse of %x in ipoib_tx.c MIME-Version: 1.0 Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: 7bit X-Originating-IP: [202.120.40.82] X-Mailer: Zimbra 8.8.15_GA_4125 (ZimbraWebClient - GC92 (Linux)/8.8.15_GA_3928) Thread-Topic: infiniband hfi1: fix misuse of %x in ipoib_tx.c Thread-Index: AQHXr7imk55risfKAUmS2+aCDTMROauwTzmgxEEN6dM= Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I have tried using %px rather than %p. However when checking the new patch through scripts/checkpatch.pl, there is a warning: Using vsprintf specifier '%px' potentially exposes the kernel memory layout. Maybe %pK is the right one? Thanks. Guo ----- Original Message ----- From: "Mike Marciniszyn" To: "Guo Zhi" , "Dennis Dalessandro" , "dledford" Cc: "linux-rdma" , "linux-kernel" Sent: Thursday, September 23, 2021 1:51:08 AM Subject: RE: [PATCH] infiniband hfi1: fix misuse of %x in ipoib_tx.c > Subject: [PATCH] infiniband hfi1: fix misuse of %x in ipoib_tx.c > > Pointers should be printed with %p or %px rather than cast to (unsigned long > long) and printed with %llx. > Change %llx to %p to print the pointer. > > Signed-off-by: Guo Zhi The unsigned long long was originally used to insure the entire accurate pointer as emitted. This is to ensure the pointers in prints and event traces match values in stacks and register dumps. I think the %p will obfuscate the pointer so %px is correct for our use case. Mike