From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752377AbbCFJdl (ORCPT ); Fri, 6 Mar 2015 04:33:41 -0500 Received: from szxga03-in.huawei.com ([119.145.14.66]:27793 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751095AbbCFJdh (ORCPT ); Fri, 6 Mar 2015 04:33:37 -0500 Message-ID: <54F97456.2070102@huawei.com> Date: Fri, 6 Mar 2015 17:33:10 +0800 From: "Chentao (Boby)" User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Joe Perches CC: , , , , , , , , Subject: Re: [PATCH v2] xen-scsiback: use DRV_PFX in the pr macros and DPRINTK References: <1425493951-41801-1-git-send-email-boby.chen@huawei.com> <1425486739.2712.12.camel@perches.com> In-Reply-To: <1425486739.2712.12.camel@perches.com> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.25.98] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020205.54F9746C.001A,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 652886a39585debda436ec8b10ca84cb Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/3/5 0:32, Joe Perches wrote: > On Wed, 2015-03-04 at 18:32 +0000, Tao Chen wrote: >> Defined the string of {xen-pvscsi: } as DRV_PFX, then use it in the pr sentences and DPRINTK. >> Also fixed up some comments just as eliminate redundant white spaces and format the code. >> These will make the code easier to read. > > It'd probaby be better just to use pr_fmt > before any include and remove all the DRV_PRV uses > > #define pr_fmt(fmt) "xen-pvscsi: " fmt > >> diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c > [] >> @@ -69,8 +69,10 @@ >> #include >> #include >> >> +#define DRV_PFX "xen-pvscsi: " >> #define DPRINTK(_f, _a...) \ >> - pr_debug("(file=%s, line=%d) " _f, __FILE__ , __LINE__ , ## _a) >> + pr_debug(DRV_PFX "(file=%s, line=%d) " _f, \ >> + __FILE__ , __LINE__ , ## _a) > > I'd also remove DPRINTK and just use pr_debug directly > as dynamic_debug can emit file and line as desired. > Joe, your suggested code is like below #ifdef pr_fmt #undef pr_fmt #endif #define pr_fmt(fmt) "xen-pvscsi: " fmt Then replace all DPRINTK with pr_debug. Am I right? >> @@ -84,7 +86,7 @@ struct ids_tuple { >> >> struct v2p_entry { >> struct ids_tuple v; /* translate from */ >> - struct scsiback_tpg *tpg; /* translate to */ >> + struct scsiback_tpg *tpg; /* translate to */ > > superfluous change. > > > > . > I'm sorry, I made a mistake here. I will modify it in my next patch. Thanks, Joe.