Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2984375pxb; Fri, 8 Oct 2021 21:36:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx7LdTKvqPYOf+ZYop8YyTNxRvazyWhLJDk8X3AYBHobACZRQtlwdR7VNyQbCpuuagn1lKu X-Received: by 2002:a17:902:e549:b0:13e:d276:505f with SMTP id n9-20020a170902e54900b0013ed276505fmr12881051plf.17.1633754186156; Fri, 08 Oct 2021 21:36:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633754186; cv=none; d=google.com; s=arc-20160816; b=OSOFm4JkoNL3/Y4rFWfceas2gMSbZPb3Q+FmhhsCQ+b3X+4VZPfkhAPBRnL9v8zx1B wntqWUz484XPgpPIT0RQkMONBUj6K77cPfJ2kclvxZCTNZfsLTmzP5nsG/eVBCbvkjUK fUfGIrO4E+ovb7nLSSsCxoqan2yNdZQWoE8n0hIo3tz/KTv8LnBhEGHAmL3i/SdFASFl TsZExNf3E1gYvWi6/TsIGLfWLB6Nz+NVxLf9U6OzHkmS3tP2sf8UDLhuxCebaA0XTr3C 4HKfk0vt2Ivsv0xtutK/T3DyOPVZWYYzNW0sBP22dNTEXqbiE0i7WtI9jYYHiVH3dB+8 y6Sw== 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=myXWSRVlOCf7+qL0LtIVXnSj+7lBRnId35IYTE4j+lY=; b=ERXs0uKfWlpe2Tr5Jt5H4N3oZXXDDW98aXkIATcO735tnVO3qGtdZEvyg/CeYqt9S3 jbsvTl0SyU4Z7cyYeYpGLGuZyxLwOBAPRX5YUHjzXoPuPN+Inwm3TUbsDePxeRtcLybt tZsQThqi2jY4UGf2yOoeEAVQqV2YTcxnCe0AFjqCQZPT7IYENYt0VzxENfptxr6zKWNM QztFEZMVP1ArldglnR4GmNNzlvWM0/Rr/gcdkUxe5Gm9KJ6vuORIHOxgOnpEt9SyH4KK Sz8IwvdqIEpbS6qPuQr1/Sp8R3pfHQn6Iljpn8UQ/MC9b429qaGLK7mKVZKm2sywnBwn uV0Q== 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 f190si1971817pfb.74.2021.10.08.21.36.10; Fri, 08 Oct 2021 21:36:26 -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 S229984AbhJIEhS convert rfc822-to-8bit (ORCPT + 99 others); Sat, 9 Oct 2021 00:37:18 -0400 Received: from smtp179.sjtu.edu.cn ([202.120.2.179]:48300 "EHLO smtp179.sjtu.edu.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbhJIEhR (ORCPT ); Sat, 9 Oct 2021 00:37:17 -0400 Received: from mta04.sjtu.edu.cn (mta04.sjtu.edu.cn [202.121.179.8]) by smtp179.sjtu.edu.cn (Postfix) with ESMTPS id 34EFE100888DA; Sat, 9 Oct 2021 12:35:18 +0800 (CST) Received: from localhost (localhost [127.0.0.1]) by mta04.sjtu.edu.cn (Postfix) with ESMTP id 083D0185F5239; Sat, 9 Oct 2021 12:35:18 +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 jtfBzz9G5XvD; Sat, 9 Oct 2021 12:35:17 +0800 (CST) Received: from mstore105.sjtu.edu.cn (unknown [10.118.0.105]) by mta04.sjtu.edu.cn (Postfix) with ESMTP id C0ABB1805DA80; Sat, 9 Oct 2021 12:35:17 +0800 (CST) Date: Sat, 9 Oct 2021 12:35:17 +0800 (CST) From: Guo Zhi To: Joe Perches Cc: Lee Duncan , Chris Leech , "James E.J. Bottomley" , "Martin K. Petersen" , open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, linux-kernel Message-ID: <1054322431.5783331.1633754117686.JavaMail.zimbra@sjtu.edu.cn> In-Reply-To: <5daf69b365e23ceecee911c4d0f2f66a0b9ec95c.camel@perches.com> References: <20211009030254.205714-1-qtxuning1999@sjtu.edu.cn> <5daf69b365e23ceecee911c4d0f2f66a0b9ec95c.camel@perches.com> Subject: Re: [PATCH] scsi scsi_transport_iscsi.c: fix misuse of %llu in scsi_transport_iscsi.c MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.166.42.95] X-Mailer: Zimbra 8.8.15_GA_4125 (ZimbraWebClient - GC91 (Linux)/8.8.15_GA_3928) Thread-Topic: scsi scsi_transport_iscsi.c: fix misuse of %llu in scsi_transport_iscsi.c Thread-Index: XXuAZWa/hbD+Z5L5JVAn1uE58Jskmw== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I will send a V2 patch. ----- 原始邮件 ----- 发件人: "Joe Perches" 收件人: "Guo Zhi" , "Lee Duncan" , "Chris Leech" , "James E.J. Bottomley" , "Martin K. Petersen" 抄送: open-iscsi@googlegroups.com, linux-scsi@vger.kernel.org, "linux-kernel" 发送时间: 星期六, 2021年 10 月 09日 上午 11:14:36 主题: Re: [PATCH] scsi scsi_transport_iscsi.c: fix misuse of %llu in scsi_transport_iscsi.c On Sat, 2021-10-09 at 11:02 +0800, Guo Zhi wrote: > Pointers should be printed with %p or %px rather than > cast to (unsigned long long) and printed with %llu. > Change %llu to %p to print the pointer into sysfs. ][] > diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c [] > @@ -129,8 +129,8 @@ show_transport_handle(struct device *dev, struct device_attribute *attr, >   > >   if (!capable(CAP_SYS_ADMIN)) >   return -EACCES; > - return sysfs_emit(buf, "%llu\n", > - (unsigned long long)iscsi_handle(priv->iscsi_transport)); > + return sysfs_emit(buf, "%p\n", > + iscsi_ptr(priv->iscsi_transport)); iscsi_transport is a pointer isn't it? so why not just return sysfs_emit(buf, "%p\n", priv->iscsi_transport); ?