Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp571843ybl; Fri, 16 Aug 2019 00:09:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzqe14mK/OPAZ/fK54+qEaxUMCX/3y+FQkxrCwtc10D+9QhWLzEP3D/w1bbveYiQvKB2Zlu X-Received: by 2002:a62:5250:: with SMTP id g77mr9518610pfb.158.1565939349596; Fri, 16 Aug 2019 00:09:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565939349; cv=none; d=google.com; s=arc-20160816; b=CVJVOswcr9yvuVuO2OEIAs/fx1gnlDdG7dQnZ5lm8/H5Df/2Qj3HjGMPmKp+HvZxeq VRvccu1jWILAOd3SZYSqdpRIHH3caqOiKzZ56s5e4fnlViw8k8F1bsTsdPD8m2Kt7hj2 C5wR05/HP02tsmxJZbDSr4UoXWQE744iKjr3gl2ZJjWy6R271m8PTNmUCua7Mz2YWZKR 2fHVyv9omPxrG6pQ53S/4jpr92hiXczLaN4eZTkvx+UzMF8P8vI4gqTrnf6ZlJ3F1xK0 FjksQbc6MDpHb46MHsVDnv8RjEAcjwKAiUn2B31jSsq8QuqYihQI7hewnW9OZK1DBpgc tK3Q== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=bWiAoe+gK8jziCl/V5duDiKDckl5BO2yBTCVW/CX3vs=; b=z3q2B4ToBO2lxAYjHApGJXi/TeUwkyLSREJqpAmSmowgotApybIsm6ppipUJN+tXVj sWcGMT9dqRspSaZzuPQRUm6gjHLgV/LalIFRDd0n0mEVHiOKUkIOHj/F4uJd/Ezo0Yv8 UA9sid1WC1EU3FMOzHNBYCO9aw55Q2/o6mA1IQCxgeCjpk58hFYm2NT0c+/SOS7p6UZt Tsn+Wo5Wm2QLK5WlIAi04fwCjYw+X0DTQnBmbLBYwGePdsJZsoHatIMdbM4ZS+S7BCIj K4LJuVkcyBAfLMi//RsLB7H7s69tVxwMrTuXPGT2d/UJhZam8YdB23+X0P624h+XppPc dQhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j5GqyvBC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5si3421496pll.439.2019.08.16.00.08.55; Fri, 16 Aug 2019 00:09:09 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j5GqyvBC; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726880AbfHPHIz (ORCPT + 99 others); Fri, 16 Aug 2019 03:08:55 -0400 Received: from mail-pf1-f175.google.com ([209.85.210.175]:43585 "EHLO mail-pf1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726866AbfHPHIy (ORCPT ); Fri, 16 Aug 2019 03:08:54 -0400 Received: by mail-pf1-f175.google.com with SMTP id v12so2656931pfn.10 for ; Fri, 16 Aug 2019 00:08:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=bWiAoe+gK8jziCl/V5duDiKDckl5BO2yBTCVW/CX3vs=; b=j5GqyvBC3G4liHuK2mA9vCDKnDSqQh4DrOcM6goqFN4gNz5g3qNCFPWRN9qqvakagK kg7YAjNi0PuGzqukj4FboLsx11mMMVyPMTv81bd87sJ9NxzokHNGXI5cxbJI5mIa6i5X M99eex2BgOw7rdAc/zx5Tci3GPLsF2EzU6MGcVjVxubMm0FklnR3dcTH52Ptan1l1mHZ DJROkRgsPJ0XBlV1bUZmj93P6vfEk/w4p3m83Q1FM9UBpar6L8FEEq+pz7hBS9Ny+uXo AYSPxfGR29moRKLjwDrbSeJ1W0PL2qPCwtf+00QM7cuwx2b08CT/oCxKURI6Fgw2YzkL OdWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=bWiAoe+gK8jziCl/V5duDiKDckl5BO2yBTCVW/CX3vs=; b=Ha0jfyUUHSlGpO3flSMdFsO0D/+z6qtpoC1c9pGKrgbcO7R6JVOyRyLiJx6WpCUgT+ +E/VGPNvahhlZJlL/JLGO4KKtkeJScL68c1U9SS+NZYUwzmV9kXYnj6aFXrFKHRO5jHz G5ZiwuBbkC+V/DXfpKaR9Q9jguj7wvgRgqQB7KNsi6XVJ9QWtFOps70C19wYLl8lmPcW /rKBhJTT4ife+wxajbgj+amxivydJeL39ALEEaWlqmXF56lyQPwAzyklFizL87HpRwz6 ShrtPSws+cGKwYnfz7uTNdD/lVmDo3TGOyxZMTG0VO7ZLraSN49kzVUmLWZwMq13z9oL n6Dg== X-Gm-Message-State: APjAAAWkdCQ7NlDUPqNV6Kkz0pqCh44N1R2l0NLxdVxcoV6xmZI7r8yh flReEhpQY0vvySoPMyIe9qFU6OXl3fPOo4tFNmmz90XUO05Y1A== X-Received: by 2002:a17:90a:be07:: with SMTP id a7mr5789193pjs.88.1565939334170; Fri, 16 Aug 2019 00:08:54 -0700 (PDT) MIME-Version: 1.0 References: <20190815120313.GA29253@gondor.apana.org.au> <5D556981.2080309@hisilicon.com> <20190815224207.GA3047@gondor.apana.org.au> In-Reply-To: From: =?UTF-8?B?T25kcmVqIE1vc27DocSNZWs=?= Date: Fri, 16 Aug 2019 09:08:42 +0200 Message-ID: Subject: Re: crypto: hisilicon - Fix warning on printing %p with dma_addr_t To: Herbert Xu Cc: Zhou Wang , linux-crypto@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org pi 16. 8. 2019 o 9:02 Ondrej Mosn=C3=A1=C4=8Dek nap= =C3=ADsal(a): > Hi Herbert, > > pi 16. 8. 2019 o 1:52 Herbert Xu nap=C3=ADs= al(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#d= ma-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). > > > > > 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