Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp5672109rwb; Tue, 17 Jan 2023 17:21:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXu+TPGYJY6Xzu4ov2aPml0UkhEJixaYKymrl89i53d78Iw7JJTSfdNklQ4t9Ld1oTX6TpBX X-Received: by 2002:a17:906:eb0e:b0:871:be7:c984 with SMTP id mb14-20020a170906eb0e00b008710be7c984mr4979623ejb.34.1674004911177; Tue, 17 Jan 2023 17:21:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674004911; cv=none; d=google.com; s=arc-20160816; b=DxH1pkA0JoBkyQmuBlSYmNJHUAqBPRWeSyUbbplexcevjDVwy2FCqEmLMIJfV0NJeN bzayyrDdWoAMa6jHHQnpzgMKG8EwAe0euZYQZUzrfuFTVBX5MTjyVOZB9rCHhuZpCJt/ tXpA2AP3vLhM55UWz5LaKjg5Lk8GUAU5//MJoM+qERGSHkeqwxip9Vv+/mQRCAOXP1JN a1a/QPpgOT+TNZ8o2f4ICEDsiA1ekydNEV97t9Pw5vYjw8hP5fr7eabl1NZDBDwOMxgx PyZaiIIOQX1CejvqnOZuIbPs1hlZPmzq1Adg2wS142twK5M5nQBnzXGK37vyAf3O5LyV BsQA== 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=i4RkttW8fJDbyZOT5cX4fAabf2Wi+aZdAXMv1JEZ7Hc=; b=zr1HNG6y0htJSq9FC8grQA007EoRiT4P+yCyQYiNzfPIPqpB+0jVWfVVIkwn6NWYPR FLVyq7zMqIqoY1lckPP2Bbn7vJPXJQk3e18mHpWny/vtF4JZ42o6ilDBdns4mjl/1ewJ +dr9OJm2JtmOwlrQDbi+iqrO/i1pM4HZ83lUliNQv57yaO62JqPHw4Bu+K85maER72Hj IdcN5ANN0bhfCZekj2ovBN37j6eq/NfTvV9Eexc7KCEt2P8AWXTCrDstcAF9Yd9G1A76 7mZpBEPmtrDaAoOi879VyO0edO/xEG2R1ExGfvPWJNvZbpQ91AKzonRKVqKeccbc5E7D nd+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=NXLSsL9V; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs8-20020a1709072d0800b0085a483a6fcdsi27671457ejc.311.2023.01.17.17.21.39; Tue, 17 Jan 2023 17:21:51 -0800 (PST) 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=@infradead.org header.s=bombadil.20210309 header.b=NXLSsL9V; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbjARBHU (ORCPT + 48 others); Tue, 17 Jan 2023 20:07:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229818AbjARBGv (ORCPT ); Tue, 17 Jan 2023 20:06:51 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D96B33C288; Tue, 17 Jan 2023 16:56:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=i4RkttW8fJDbyZOT5cX4fAabf2Wi+aZdAXMv1JEZ7Hc=; b=NXLSsL9V7Bo6BKRF5Y9jfRUgrQ pdCFL6s8KfhkjazcKLSqN3u1CkBz9NhcL5GM5NW0EQ+djyO/iwuePSLZQild575wArFqbPjMZompR WH33mY7hWiO52lvdZ/OAf2WWLZKJpxh4UP/c289so17o7EycuDkdKK0wOKDZeTxhVOkm4oh9ExlNY bxg+1afaacpFIk8tP/AuMF5nYbEehFugAtZcopEm/zNFVZvNtPadNisTjH6jLW7UxLqaV0lEP5ysC wVpaagAKfTwOYFD5+lVEHhx0mu6LzWHbBrhVczSydBh9yBJMUIKAzxymYxNH5IurEOnjNZgyOD4oS mGUH9rFQ==; Received: from [2601:1c2:d80:3110::9307] by bombadil.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1pHwkp-00GNFP-E9; Wed, 18 Jan 2023 00:56:39 +0000 Message-ID: <19d40c05-4e97-a739-47b4-689b047841fc@infradead.org> Date: Tue, 17 Jan 2023 16:56:36 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [PATCH] rtc: sunplus: fix format string for printing resource Content-Language: en-US To: Arnd Bergmann , Alexandre Belloni , Arnd Bergmann Cc: Vincent Shih , Alessandro Zummo , linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230117172450.2938962-1-arnd@kernel.org> <54f13745-bec5-8777-4212-6f093947f146@infradead.org> <589415b2-ddf2-44e5-bca5-5971f8ab9576@app.fastmail.com> From: Randy Dunlap In-Reply-To: <589415b2-ddf2-44e5-bca5-5971f8ab9576@app.fastmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham 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 1/17/23 11:36, Arnd Bergmann wrote: > On Tue, Jan 17, 2023, at 19:24, Randy Dunlap wrote: >> On 1/17/23 09:55, Alexandre Belloni wrote: >>> On 17/01/2023 18:24:44+0100, Arnd Bergmann wrote: >>>> From: Arnd Bergmann >>>> >>>> On 32-bit architectures with 64-bit resource_size_t, sp_rtc_probe() >>>> causes a compiler warning: >>>> >>>> drivers/rtc/rtc-sunplus.c: In function 'sp_rtc_probe': >>>> drivers/rtc/rtc-sunplus.c:243:33: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=] >>>> 243 | dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n", >>>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >>>> >>>> The best way to print a resource is the special %pR format string, >>>> and similarly to print a pointer we can use %p and avoid the cast. >>>> >>> >>> I got this one this morning, which one is more correct? :) >>> https://lore.kernel.org/all/20230117054232.24023-1-rdunlap@infradead.org/ > > Both are equally correct, it's just a preference. > >> I prefer my handling of res->start and Arnd's no-cast handling of reg_base. >> IMO using "%pR" prints too much info, but that's more up to the file's author >> or maintainer... > > Right, I could have equally well picked the %pap version, and just > went for brevity in the source. It's only pr_debug(), so very few > users are going to actually see the output. Alexandre, sounds like you should just go with Arnd's patch. -- ~Randy