Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp935732pxy; Wed, 28 Apr 2021 17:54:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxafb2yL+pHqeuc0GLBX5lfTCqtTb9rMm4uQ1td1QPzgVj4wpL6DlwDzvkdze9KNVCKh6lI X-Received: by 2002:a05:6a00:a95:b029:25c:eb77:723a with SMTP id b21-20020a056a000a95b029025ceb77723amr30538662pfl.23.1619657665451; Wed, 28 Apr 2021 17:54:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619657665; cv=none; d=google.com; s=arc-20160816; b=ESgR1NbYCtjXOs4H5pR/7b7/qS3CeUM70V3qSPqqy73EOBJ6YmrOnHep/OTPDxJyLP f+sdtzhH7WQufs1PQDT6A1AjFd5zwoNofFWoh+rtPrkedVOOoBMpB+1Rg3ln84U6/Sqi 4K2t+k3oM/N/qFsaOXl5aqlilVt+apAFB8Tax34fA+FvH8/3uRZwhfBYW6t1dEwHdWJQ DcgPbfO+R0js2BrzUIG2vhYSko1Bw+aT1Vk+PDRM3B38bRc7npBO4CMrwSEDnJ5QeqNR GspxHAOO3acJvQMoYCNkNEGHvW0U9nRVIPv9OfV11Gvc62K5rImZO0Uk8Tz+YU5IjlkN a11A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=ias16OQcBsl8ZkDBEGSPojETSjzryLxJi3zCN7d/i4E=; b=Dvs8ZjxPaDy4OAkPnQcu37/J8U8o0rurBUpo/9IonOvkihils89wl4fsiy8wwzQxca aPmAQzzeE5GtCY5wwJKCGQj7/P9xCL0ejekb3/BIvVgPl86II+DKrFFpslaRgKzW53w/ 2A7Z5cqIQqYC+H88ImxL6Lo7lg1qLvpZV7Bf1dtszK1RXwfAbYhUvcJ8eXffKZIOe6UM jgnDpO2ek6YXxbRPjB3ZiqDI5mQCynvV5XpIvPBxwQb2nnENZw1J1u+SOIz5Kj6lmLXf O/Afct23WTNEAukF7RBlbQ++gWhLA+4NcBoSbfXeDvrCIGnLxDugZk/wB1R8ommhUmXg Ll8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=GTME8irL; 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 cp14si1485148plb.386.2021.04.28.17.54.12; Wed, 28 Apr 2021 17:54:25 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=GTME8irL; 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 S229888AbhD2Ay0 (ORCPT + 99 others); Wed, 28 Apr 2021 20:54:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229479AbhD2AyZ (ORCPT ); Wed, 28 Apr 2021 20:54:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C11ECC06138B for ; Wed, 28 Apr 2021 17:53:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=ias16OQcBsl8ZkDBEGSPojETSjzryLxJi3zCN7d/i4E=; b=GTME8irLh4yirVajHMss5bhE0m 7i1RAaFww73oFMbbYd0JrHof4s+TMXrucW6CGr3kkbhsBf8q6s5DdEMDqGDJGD0LWfOKw5Wj6+hXJ gpb68XEd42+3C5w2QFfuLtvXv/1ExB9xhRjty8Wc5BsnGBX/32nQiIQlP78e31U/5YRWDyCIwQLxs UBQ/lr6+8zb8wwDxweO7GwWWjEVzEb/QKLsU34ZkxKy6Wt3lhT4YV4tr0/OTWb/oxitrSkJzYBj/N aMp6SjGofFyNorhZU3fAsN//GPO+gx9GiFBOObxJHnXKrWN3XPozkuT9WBmaOffhc9TgtjUqUKnB0 e5+LOTsg==; Received: from [2601:1c0:6280:3f0::3bc5] (helo=casper.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.94 #2 (Red Hat Linux)) id 1lbuvn-0090nA-OF; Thu, 29 Apr 2021 00:53:35 +0000 From: Randy Dunlap To: linux-kernel@vger.kernel.org Cc: Randy Dunlap , Anatolij Gustschin , linuxppc-dev@lists.ozlabs.org, Michael Ellerman Subject: [PATCH] powerpc: mpc52xx: fix some pr_debug() issues Date: Wed, 28 Apr 2021 17:53:23 -0700 Message-Id: <20210429005323.8195-1-rdunlap@infradead.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix some pr_debug() issues in mpc52xx_pci.c: - use __func__ to print function names - use "%pr" to print struct resource entries - use "%pa" to print a resource_size_t (phys_addr_t) The latter two fix several build warnings: ../arch/powerpc/platforms/52xx/mpc52xx_pci.c: In function 'mpc52xx_pci_setup': ../include/linux/kern_levels.h:5:18: warning: format '%x' expects argument of type 'unsigned int', but argument 2 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=] ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:277:40: note: format string is defined here 277 | pr_debug("mem_resource[1] = {.start=%x, .end=%x, .flags=%lx}\n", | ~^ | | | unsigned int | %llx ../include/linux/kern_levels.h:5:18: warning: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'resource_size_t' {aka 'long long unsigned int'} [-Wformat=] ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:277:49: note: format string is defined here 277 | pr_debug("mem_resource[1] = {.start=%x, .end=%x, .flags=%lx}\n", | ~^ | | | unsigned int | %llx ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:299:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] 299 | (unsigned long long)res->flags, (void*)hose->io_base_phys); | ^ ../arch/powerpc/platforms/52xx/mpc52xx_pci.c:295:2: note: in expansion of macro 'pr_debug' 295 | pr_debug(".io_resource={.start=%llx,.end=%llx,.flags=%llx} " | ^~~~~~~~ The change to print mem_resource[0] is for consistency within this source file and to use the kernel API -- there were no warnings here. Signed-off-by: Randy Dunlap Cc: Anatolij Gustschin Cc: linuxppc-dev@lists.ozlabs.org Cc: Michael Ellerman --- arch/powerpc/platforms/52xx/mpc52xx_pci.c | 22 ++++++-------------- 1 file changed, 7 insertions(+), 15 deletions(-) --- linux-next-20210427.orig/arch/powerpc/platforms/52xx/mpc52xx_pci.c +++ linux-next-20210427/arch/powerpc/platforms/52xx/mpc52xx_pci.c @@ -242,7 +242,7 @@ mpc52xx_pci_setup(struct pci_controller u32 tmp; int iwcr0 = 0, iwcr1 = 0, iwcr2 = 0; - pr_debug("mpc52xx_pci_setup(hose=%p, pci_regs=%p)\n", hose, pci_regs); + pr_debug("%s(hose=%p, pci_regs=%p)\n", __func__, hose, pci_regs); /* pci_process_bridge_OF_ranges() found all our addresses for us; * now store them in the right places */ @@ -257,11 +257,7 @@ mpc52xx_pci_setup(struct pci_controller /* Memory windows */ res = &hose->mem_resources[0]; if (res->flags) { - pr_debug("mem_resource[0] = " - "{.start=%llx, .end=%llx, .flags=%llx}\n", - (unsigned long long)res->start, - (unsigned long long)res->end, - (unsigned long long)res->flags); + pr_debug("mem_resource[0] = %pr\n", res); out_be32(&pci_regs->iw0btar, MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, resource_size(res))); @@ -274,8 +270,7 @@ mpc52xx_pci_setup(struct pci_controller res = &hose->mem_resources[1]; if (res->flags) { - pr_debug("mem_resource[1] = {.start=%x, .end=%x, .flags=%lx}\n", - res->start, res->end, res->flags); + pr_debug("mem_resource[1] = %pr\n", res); out_be32(&pci_regs->iw1btar, MPC52xx_PCI_IWBTAR_TRANSLATION(res->start, res->start, resource_size(res))); @@ -292,11 +287,8 @@ mpc52xx_pci_setup(struct pci_controller printk(KERN_ERR "%s: Didn't find IO resources\n", __FILE__); return; } - pr_debug(".io_resource={.start=%llx,.end=%llx,.flags=%llx} " - ".io_base_phys=0x%p\n", - (unsigned long long)res->start, - (unsigned long long)res->end, - (unsigned long long)res->flags, (void*)hose->io_base_phys); + pr_debug(".io_resource = %pr .io_base_phys=0x%pa\n", + res, &hose->io_base_phys); out_be32(&pci_regs->iw2btar, MPC52xx_PCI_IWBTAR_TRANSLATION(hose->io_base_phys, res->start, @@ -336,8 +328,8 @@ mpc52xx_pci_fixup_resources(struct pci_d { int i; - pr_debug("mpc52xx_pci_fixup_resources() %.4x:%.4x\n", - dev->vendor, dev->device); + pr_debug("%s() %.4x:%.4x\n", + __func__, dev->vendor, dev->device); /* We don't rely on boot loader for PCI and resets all devices */