From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by ozlabs.org (Postfix) with ESMTP id 60384B701C for ; Sat, 28 Apr 2012 05:25:44 +1000 (EST) Message-ID: <4F9AF26C.9030808@redhat.com> Date: Fri, 27 Apr 2012 16:24:28 -0300 From: Mauro Carvalho Chehab MIME-Version: 1.0 To: "Luck, Tony" Subject: Re: [PATCH EDACv16 1/2] edac: Change internal representation to work with layers References: <1335289087-11337-1-git-send-email-mchehab@redhat.com> <1335291342-14922-1-git-send-email-mchehab@redhat.com> <20120427133304.GE9626@aftab.osrc.amd.com> <4F9ADCE3.2030506@redhat.com> <3908561D78D1C84285E8C5FCA982C28F170F4A4C@ORSMSX104.amr.corp.intel.com> In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F170F4A4C@ORSMSX104.amr.corp.intel.com> Content-Type: text/plain; charset=ISO-8859-1 Cc: Shaohui Xie , Jason Uhlenkott , Aristeu Rozanski , Hitoshi Mitake , "Gross, Mark" , Dmitry Eremin-Solenikov , Ranganathan Desikan , Borislav Petkov , Egor Martovetsky , =?ISO-8859-1?Q?Niklas_S=F6d?= =?ISO-8859-1?Q?erlund?= , Tim Small , "Arvind R." , Chris Metcalf , Olof Johansson , Doug Thompson , Linux Edac Mailing List , Michal Marek , Jiri Kosina , Linux Kernel Mailing List , Joe Perches , Andrew Morton , "linuxppc-dev@lists.ozlabs.org" List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Em 27-04-2012 15:11, Luck, Tony escreveu: >>>> + for (i = 0; i < dimm->mci->n_layers; i++) { >>>> + printk(KERN_CONT "%d", dimm->location[i]); >>>> + if (i < dimm->mci->n_layers - 1) >>>> + printk(KERN_CONT "."); >>>> + } >>>> + printk(KERN_CONT "\n"); >>> >>> This looks hacky but I don't have a good suggestion what to do instead >>> here. Maybe snprintf into a complete string which you can issue with >>> debugf4()... >> >> This is not hacky. There are several places at the Kernel doing loops like >> that. Look, for example, at lib/hexdump.c (without KERN_CONT, as this >> macro was added later - probably to avoid checkpatch.pl complains). > > There is some benefit to "one printk == one output line" ... it means > that console output will not be (as) jumbled if multiple cpus are > printk'ing at the same time. Ok, but this message only appears when all the conditions below are met: - the driver is compiled with EDAC_DEBUG; - the edac_core is modprobed with edac_debug_level=4; - during the driver modprobe, when the EDAC driver is being registered. Even on several-core machines, those messages won't mangle, in practice. Let's not over-design a simple debug message. Regards, Mauro