Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2985562ybl; Sun, 11 Aug 2019 12:47:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqyU20i6Q37qQEgPkIg3oVJpin3j0GHS2C2OcsVaxr3wElmynkz+OADAnwLRHJnf+UnmWWcT X-Received: by 2002:a17:90b:8c1:: with SMTP id ds1mr9090528pjb.114.1565552853908; Sun, 11 Aug 2019 12:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565552853; cv=none; d=google.com; s=arc-20160816; b=IN0vX3qRUiQkMryvHD27gbN0Vtp42HC/y8LvgIBOiwqJFjrzo6vSiibS0HjSyFYoxh nculy/1yOkOZxnHFlmZ8xrCVcxAKR/i3NWFC0kJdT6HSfj+iQjtC1NYseViEdq5JtK/q /vIAQXwqn89N3E2DF/hxpbHW2h4zEzbD1EgQLqf4dO1cEEWlCfF7WpRtqiTQA+ZtjTBx ECBeykUHJy55BYuaTyWIz6VPgUM+bm1dbfd1JYKy/17QCT+bJSNrYtgbavG4uMaa98B2 ruVV+ixa4/ESRpBZoXcwSn1hYDOIt7JSQoTSJNv+5XURSMBCFRQqpwaDJ6i84Xs+COZS oUAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=2JM7oqrhQCTVMvk3eVplIHNbjHRhWyn3FtkoaPBDQIA=; b=d06haI63ykTdMfXIuJZYePGznMh6BoN2Nkqyo9rqiJ3XVoakn5n08p2Kc4JmUwzMCP 8i5QbRY267S1VobNLh+LKS0J5Wn4gfr+vpesOZbeaRH2Ic3eE+nU7W8aGEAdVQnlnYuw tz1UgMRGsRymT7ebV/K3Z0WDO3vA6UmrSeIfQiQVS28U1Dh+gG9ewopeXmLkrf7N/nDc RjEEsCgV8CDoV/YAlQS8UVUwJH90bGpFiqHll85KAk1Y1lBGGXRLb/WbGoeaOq2fk3S1 a5dnmGEVkLrZ5reDi5jtI8gX40ZY+TO1EqV/k0bjOAb9tGiN7//AI3KG00r/tnfg7Qci JTOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=IgyVz+Gq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si61794923pfo.22.2019.08.11.12.47.18; Sun, 11 Aug 2019 12:47:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=IgyVz+Gq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726179AbfHKTnw (ORCPT + 99 others); Sun, 11 Aug 2019 15:43:52 -0400 Received: from mail-lj1-f194.google.com ([209.85.208.194]:40632 "EHLO mail-lj1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726014AbfHKTnv (ORCPT ); Sun, 11 Aug 2019 15:43:51 -0400 Received: by mail-lj1-f194.google.com with SMTP id e27so1365291ljb.7 for ; Sun, 11 Aug 2019 12:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=2JM7oqrhQCTVMvk3eVplIHNbjHRhWyn3FtkoaPBDQIA=; b=IgyVz+Gq75priv9lK3TzHFpAv3V2oXw8fKQJjqjm4A6m6e1qS+tK/DusATZpvDdLG/ XQ+nPOAEJcnAhCtuVzlWJq6OYpwk12TSknR11FbXkGDy9kQD9cTU+FSM8ixXiAuQxkMG VOxY1bpJvnpNqogOZS2h7XcPJ76W8hkeWvuIo8VfX2sOOQvBw2AJRhL2dZy1Rx9vyrQS d4vtKFziknmn5FqWlMLEnWccsLaFXYWhxWXWcUDI2LUCn4NNSNB2VtwLEU2KkL5cZEYS eyWJjo9jEB3VjzpLdzZcUpzGgZN8+OdP9bAtUQC92UtbIAo9QzVtSe9JlE2otvD2XdRf p5gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=2JM7oqrhQCTVMvk3eVplIHNbjHRhWyn3FtkoaPBDQIA=; b=UD1kDzZvHXs69I0y55uiyRjZ64Esn4x+zhYTHsvdsc7qVxAP0mUL1PGLZ6UWflix3A XjmTCVCT0RqcvcFhhz2FXPfnMJp7mXs42aldof/8mtqSjHROf5cDVpyUH57hYph3b+xX PIHk1N3gVbJxQqeWI5XYtTuOWvkchvOGg6KSWfv/O7UONoJ4jBIUBohHP/MnAhkaY9XL FDEMGeR0otvhJC84UcNabITTrjufAjORGGVbuMqN1FEMH5t0WAHRmgBBNB0PR8lRGqeV mvUD18DQlvsPs344UyZQfl5d1iAPSsNzUoSmmRUpi9vUvjwHOBoC18H0VqDp1YyfpgmN nmIw== X-Gm-Message-State: APjAAAV3HshdJ9cmeu+Y167jp+LmxNXnZnsySXfPXVkH2Vm5tz1wpzTl 4Len4rP5396GdU6DwGTN5XaqhA== X-Received: by 2002:a2e:9048:: with SMTP id n8mr17085129ljg.37.1565552628036; Sun, 11 Aug 2019 12:43:48 -0700 (PDT) Received: from [192.168.0.36] (2-111-91-225-cable.dk.customer.tdc.net. [2.111.91.225]) by smtp.googlemail.com with ESMTPSA id f1sm20432278ljk.86.2019.08.11.12.43.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Aug 2019 12:43:47 -0700 (PDT) Subject: Re: [PATCH 1/2] lightnvm: introduce pr_fmt for the prefix nvm To: Minwoo Im , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Klaus Birkelund , =?UTF-8?Q?Javier_Gonz=c3=a1lez?= , Chaitanya Kulkarni References: <20190727182626.27991-1-minwoo.im.dev@gmail.com> <20190727182626.27991-2-minwoo.im.dev@gmail.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <712c30cc-4b23-087c-39fa-b919ed0529da@lightnvm.io> Date: Sun, 11 Aug 2019 21:43:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190727182626.27991-2-minwoo.im.dev@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/27/19 8:26 PM, Minwoo Im wrote: > all the pr_() family can have this prefix by pr_fmt. > > Changes to V2: > - Fix typo in title (s/previx/prefix) > > Changes to V1: > - Squashed multiple lines to make it short (Chaitanya) > > Cc: Matias Bjørling > Cc: Javier González > Cc: Chaitanya Kulkarni > Signed-off-by: Minwoo Im > Reviewed-by: Javier González > --- > drivers/lightnvm/core.c | 48 ++++++++++++++++++++--------------------- > 1 file changed, 24 insertions(+), 24 deletions(-) > > diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c > index a600934fdd9c..4c7b48f72e80 100644 > --- a/drivers/lightnvm/core.c > +++ b/drivers/lightnvm/core.c > @@ -4,6 +4,7 @@ > * Initial release: Matias Bjorling > */ > > +#define pr_fmt(fmt) "nvm: " fmt > #include > #include > #include > @@ -74,7 +75,7 @@ static int nvm_reserve_luns(struct nvm_dev *dev, int lun_begin, int lun_end) > > for (i = lun_begin; i <= lun_end; i++) { > if (test_and_set_bit(i, dev->lun_map)) { > - pr_err("nvm: lun %d already allocated\n", i); > + pr_err("lun %d already allocated\n", i); > goto err; > } > } > @@ -264,7 +265,7 @@ static int nvm_config_check_luns(struct nvm_geo *geo, int lun_begin, > int lun_end) > { > if (lun_begin > lun_end || lun_end >= geo->all_luns) { > - pr_err("nvm: lun out of bound (%u:%u > %u)\n", > + pr_err("lun out of bound (%u:%u > %u)\n", > lun_begin, lun_end, geo->all_luns - 1); > return -EINVAL; > } > @@ -297,7 +298,7 @@ static int __nvm_config_extended(struct nvm_dev *dev, > if (e->op == 0xFFFF) { > e->op = NVM_TARGET_DEFAULT_OP; > } else if (e->op < NVM_TARGET_MIN_OP || e->op > NVM_TARGET_MAX_OP) { > - pr_err("nvm: invalid over provisioning value\n"); > + pr_err("invalid over provisioning value\n"); > return -EINVAL; > } > > @@ -334,23 +335,23 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create) > e = create->conf.e; > break; > default: > - pr_err("nvm: config type not valid\n"); > + pr_err("config type not valid\n"); > return -EINVAL; > } > > tt = nvm_find_target_type(create->tgttype); > if (!tt) { > - pr_err("nvm: target type %s not found\n", create->tgttype); > + pr_err("target type %s not found\n", create->tgttype); > return -EINVAL; > } > > if ((tt->flags & NVM_TGT_F_HOST_L2P) != (dev->geo.dom & NVM_RSP_L2P)) { > - pr_err("nvm: device is incompatible with target L2P type.\n"); > + pr_err("device is incompatible with target L2P type.\n"); > return -EINVAL; > } > > if (nvm_target_exists(create->tgtname)) { > - pr_err("nvm: target name already exists (%s)\n", > + pr_err("target name already exists (%s)\n", > create->tgtname); > return -EINVAL; > } > @@ -367,7 +368,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create) > > tgt_dev = nvm_create_tgt_dev(dev, e.lun_begin, e.lun_end, e.op); > if (!tgt_dev) { > - pr_err("nvm: could not create target device\n"); > + pr_err("could not create target device\n"); > ret = -ENOMEM; > goto err_t; > } > @@ -686,7 +687,7 @@ static int nvm_set_rqd_ppalist(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd, > rqd->nr_ppas = nr_ppas; > rqd->ppa_list = nvm_dev_dma_alloc(dev, GFP_KERNEL, &rqd->dma_ppa_list); > if (!rqd->ppa_list) { > - pr_err("nvm: failed to allocate dma memory\n"); > + pr_err("failed to allocate dma memory\n"); > return -ENOMEM; > } > > @@ -1048,7 +1049,7 @@ int nvm_set_chunk_meta(struct nvm_tgt_dev *tgt_dev, struct ppa_addr *ppas, > return 0; > > if (nr_ppas > NVM_MAX_VLBA) { > - pr_err("nvm: unable to update all blocks atomically\n"); > + pr_err("unable to update all blocks atomically\n"); > return -EINVAL; > } > > @@ -1111,27 +1112,26 @@ static int nvm_init(struct nvm_dev *dev) > int ret = -EINVAL; > > if (dev->ops->identity(dev)) { > - pr_err("nvm: device could not be identified\n"); > + pr_err("device could not be identified\n"); > goto err; > } > > - pr_debug("nvm: ver:%u.%u nvm_vendor:%x\n", > - geo->major_ver_id, geo->minor_ver_id, > - geo->vmnt); > + pr_debug("ver:%u.%u nvm_vendor:%x\n", geo->major_ver_id, > + geo->minor_ver_id, geo->vmnt); > > ret = nvm_core_init(dev); > if (ret) { > - pr_err("nvm: could not initialize core structures.\n"); > + pr_err("could not initialize core structures.\n"); > goto err; > } > > - pr_info("nvm: registered %s [%u/%u/%u/%u/%u]\n", > + pr_info("registered %s [%u/%u/%u/%u/%u]\n", > dev->name, dev->geo.ws_min, dev->geo.ws_opt, > dev->geo.num_chk, dev->geo.all_luns, > dev->geo.num_ch); > return 0; > err: > - pr_err("nvm: failed to initialize nvm\n"); > + pr_err("failed to initialize nvm\n"); > return ret; > } > > @@ -1169,7 +1169,7 @@ int nvm_register(struct nvm_dev *dev) > dev->dma_pool = dev->ops->create_dma_pool(dev, "ppalist", > exp_pool_size); > if (!dev->dma_pool) { > - pr_err("nvm: could not create dma pool\n"); > + pr_err("could not create dma pool\n"); > kref_put(&dev->ref, nvm_free); > return -ENOMEM; > } > @@ -1214,7 +1214,7 @@ static int __nvm_configure_create(struct nvm_ioctl_create *create) > up_write(&nvm_lock); > > if (!dev) { > - pr_err("nvm: device not found\n"); > + pr_err("device not found\n"); > return -EINVAL; > } > > @@ -1288,7 +1288,7 @@ static long nvm_ioctl_get_devices(struct file *file, void __user *arg) > i++; > > if (i > 31) { > - pr_err("nvm: max 31 devices can be reported.\n"); > + pr_err("max 31 devices can be reported.\n"); > break; > } > } > @@ -1315,7 +1315,7 @@ static long nvm_ioctl_dev_create(struct file *file, void __user *arg) > > if (create.conf.type == NVM_CONFIG_TYPE_EXTENDED && > create.conf.e.rsv != 0) { > - pr_err("nvm: reserved config field in use\n"); > + pr_err("reserved config field in use\n"); > return -EINVAL; > } > > @@ -1331,7 +1331,7 @@ static long nvm_ioctl_dev_create(struct file *file, void __user *arg) > flags &= ~NVM_TARGET_FACTORY; > > if (flags) { > - pr_err("nvm: flag not supported\n"); > + pr_err("flag not supported\n"); > return -EINVAL; > } > } > @@ -1349,7 +1349,7 @@ static long nvm_ioctl_dev_remove(struct file *file, void __user *arg) > remove.tgtname[DISK_NAME_LEN - 1] = '\0'; > > if (remove.flags != 0) { > - pr_err("nvm: no flags supported\n"); > + pr_err("no flags supported\n"); > return -EINVAL; > } > > @@ -1365,7 +1365,7 @@ static long nvm_ioctl_dev_init(struct file *file, void __user *arg) > return -EFAULT; > > if (init.flags != 0) { > - pr_err("nvm: no flags supported\n"); > + pr_err("no flags supported\n"); > return -EINVAL; > } > > Thanks Minwoo. Applied.