From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 84E15C43331 for ; Thu, 2 Apr 2020 01:32:06 +0000 (UTC) Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5E18F20721 for ; Thu, 2 Apr 2020 01:32:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5E18F20721 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-nvdimm-bounces@lists.01.org Received: from ml01.vlan13.01.org (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id EA79210FC4BF7; Wed, 1 Apr 2020 18:32:55 -0700 (PDT) Received-SPF: None (mailfrom) identity=mailfrom; client-ip=216.40.44.94; helo=smtprelay.hostedemail.com; envelope-from=joe@perches.com; receiver= Received: from smtprelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id E535110FC4BF7 for ; Wed, 1 Apr 2020 18:32:35 -0700 (PDT) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay05.hostedemail.com (Postfix) with ESMTP id 0FB2E1802914A; Thu, 2 Apr 2020 01:31:44 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: magic31_e7601e651344 X-Filterd-Recvd-Size: 4003 Received: from XPS-9350.home (unknown [47.151.136.130]) (Authenticated sender: joe@perches.com) by omf11.hostedemail.com (Postfix) with ESMTPA; Thu, 2 Apr 2020 01:31:39 +0000 (UTC) Message-ID: Subject: Re: [PATCH v4 08/25] ocxl: Emit a log message showing how much LPC memory was detected From: Joe Perches To: Dan Williams , Alastair D'Silva Date: Wed, 01 Apr 2020 18:29:42 -0700 In-Reply-To: References: <20200327071202.2159885-1-alastair@d-silva.org> <20200327071202.2159885-9-alastair@d-silva.org> User-Agent: Evolution 3.34.1-2 MIME-Version: 1.0 Message-ID-Hash: H7DFL6YEKHTQIFEQ3T6DGOCE3ROMCGTN X-Message-ID-Hash: H7DFL6YEKHTQIFEQ3T6DGOCE3ROMCGTN X-MailFrom: joe@perches.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation CC: "Aneesh Kumar K . V" , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , Frederic Barrat , Andrew Donnellan , Arnd Bergmann , Greg Kroah-Hartman , Andrew Morton , Mauro Carvalho Chehab , "David S. Miller" , Rob Herring , Anton Blanchard , Krzysztof Kozlowski , Mahesh Salgaonkar , Madhavan Srinivasan , =?ISO-8859-1?Q?C=E9dric?= Le Goater , Anju T Sudhakar , Hari Bathini , Thomas Gleixner , Greg Kurz , Nicholas Piggin , Masahiro Yamada , Alexey Kardashevskiy , Linux Kernel Mailing List , linuxppc-dev , linux-nvdimm , Linux MM X-Mailman-Version: 3.1.1 Precedence: list List-Id: "Linux-nvdimm developer list." Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Wed, 2020-04-01 at 01:49 -0700, Dan Williams wrote: > On Sun, Mar 29, 2020 at 10:23 PM Alastair D'Silva wrote: > > This patch emits a message showing how much LPC memory & special purpose > > memory was detected on an OCXL device. [] > > diff --git a/drivers/misc/ocxl/config.c b/drivers/misc/ocxl/config.c [] > > @@ -568,6 +568,10 @@ static int read_afu_lpc_memory_info(struct pci_dev *dev, > > afu->special_purpose_mem_size = > > total_mem_size - lpc_mem_size; > > } > > + > > + dev_info(&dev->dev, "Probed LPC memory of %#llx bytes and special purpose memory of %#llx bytes\n", > > + afu->lpc_mem_size, afu->special_purpose_mem_size); > > A patch for a single log message is too fine grained for my taste, > let's squash this into another patch in the series. Is the granularity of lpc_mem_size actually bytes? Might this be better as KiB or something using functions Maybe something like: unsigned long si_val(unsigned long val) { static const char units[] = "BKMGTPE"; const char *unit = units; while (!(val & 1023) && unit[1]) { val >>= 10; unit++; } return val; } char si_type(unsigned long val) { static const char units[] = "BKMGTPE"; const char *unit = units; while (!(val & 1023) && unit[1]) { val >>= 10; unit++; } return *unit; } so this could be something like: dev_info(&dev->dev, "Probed LPC memory of %#llu%c and special purpose memory of %#llu%c\n", si_val(afu->lpc_mem_size), si_type(afu->lpc_mem_size), si_val(afu->special_purpose_mem_size), si_type(afu->special_purpose_mem_size)); _______________________________________________ Linux-nvdimm mailing list -- linux-nvdimm@lists.01.org To unsubscribe send an email to linux-nvdimm-leave@lists.01.org