Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp609817ybl; Fri, 16 Aug 2019 00:54:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqxRRtbZGMPn2WpCzY7DEFp55qnGhZrems/gT4YfRdK2jH46NLZhSwMlQMyo8dDNPaCQymvv X-Received: by 2002:a17:902:fe93:: with SMTP id x19mr2255986plm.307.1565942061734; Fri, 16 Aug 2019 00:54:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565942061; cv=none; d=google.com; s=arc-20160816; b=g8dpqM5+x9fUcZ9MTb4J9rhv1eOMngZOW0TJgfcmZzdFxM+Wsn2X2RwopHxBOkAwwM ZvWKi5ewHrnsZYKMa4Rvmmfq/f0H6zoWJYMBDBRHXRd/uS3wdVkFj/Gwj7/hDemUvXi8 0eBli43BmVT55d9LfJUZkJ54khe2rqmjDqSksdB64RVhkXz7b0eIlARt/f60KjT/zCzd LwXPh01nJyJNKgJt8gz9CgSLiMq/IMTo+nwQhoOkmL20Ec4U4JFLqSqz0fEmbU+HLvGb cNB9uzP4Dwlt4wflQq5vNxLrVmqOMHhXiRYv8HVToxYf6acr0cZyPIc1IuKJRbikzDCD bMbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=yT0ksIDbCgTSf2IoagyJuRdM+ha8RR80HCDPgYI83GA=; b=uLXzhY0rOIY8Jq2F947fcOuSzuKAmzBb5GVJ+QoPSCwS5Z2Gmy296nU6wfMhoHDGxE rNeaR3fKtfEYvlPyoGaC8mHeG3BohsBYhrcH3ZFnCBjWD1rQCf3Wb8dr+oReh0gJpo4R oC6ACKJAhSR38MueSWZnlPn92NgS/ODFcqJ0MESLPjVoZrWzJKAoXH3iWogFe8Nm1JQT iQ3YyXKsP6SuPO7E7+M2uHOJVRnkq0rA0VfgfNjPvQTCy69qbIF4aDeaJl5DgZ2F1U5x nc1oYncWtOCxoAtd/HlOW5aieecWCjZaMbMg60zTgYatp1otug1omZAJCNes4pliIkXq TG3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a65si3354244pgc.213.2019.08.16.00.53.59; Fri, 16 Aug 2019 00:54:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726575AbfHPHx5 (ORCPT + 99 others); Fri, 16 Aug 2019 03:53:57 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:4721 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726637AbfHPHx5 (ORCPT ); Fri, 16 Aug 2019 03:53:57 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 094F7156E86026C804D0 for ; Fri, 16 Aug 2019 15:53:54 +0800 (CST) Received: from [127.0.0.1] (10.63.139.185) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Fri, 16 Aug 2019 15:53:52 +0800 Subject: Re: crypto: hisilicon - Fix warning on printing %p with dma_addr_t To: =?UTF-8?B?T25kcmVqIE1vc27DocSNZWs=?= , Herbert Xu References: <20190815120313.GA29253@gondor.apana.org.au> <5D556981.2080309@hisilicon.com> <20190815224207.GA3047@gondor.apana.org.au> CC: From: Zhou Wang Message-ID: <5D566103.3000701@hisilicon.com> Date: Fri, 16 Aug 2019 15:53:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.63.139.185] X-CFilter-Loop: Reflected Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On 2019/8/16 15:08, Ondrej Mosnáček wrote: > pi 16. 8. 2019 o 9:02 Ondrej Mosnáček napísal(a): >> Hi Herbert, >> >> pi 16. 8. 2019 o 1:52 Herbert Xu napísal(a): >>> On Thu, Aug 15, 2019 at 10:17:37PM +0800, Zhou Wang wrote: >>>> >>>>> - dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%pad\n", queue, >>>>> - cmd, dma_addr); >>>>> + dev_dbg(&qm->pdev->dev, "QM mailbox request to q%u: %u-%#lxad\n", >>>>> + queue, cmd, (unsigned long)dma_addr); >>>> >>>> Thanks. However, to be honest I can't get why we fix it like this. >>>> Can you give me a clue? >>> >>> dma_addr_t is not a pointer. It's an integer type and therefore >>> you need to print it out as such. >> >> According to Documentation/core-api/printk-formats.rst, %pad is the >> format specifier intended specifically for dma_addr_t [1], so perhaps >> the kbuild robot warning was in fact bogus? >> >> [1] https://www.kernel.org/doc/html/latest/core-api/printk-formats.html#dma-address-types-dma-addr-t > > Oh, wait, in that section it actually says "Passed by reference.", so > Zhou is most likely right that the proper fix is to pass a pointer to > the variable containing the address (I assume this is to make the > generic GCC's format checking pass even if dma_addr_t is not actually > a pointer). Yes, I think you are right, I also mentioned this in v3. Thanks, Zhou > >> >>> >>> Actually my patch is buggy too, on some architectures it can be >>> a long long so we need to cast is such. >>> >>> Cheers, >>> -- >>> Email: Herbert Xu >>> Home Page: http://gondor.apana.org.au/~herbert/ >>> PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt > >