Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5047679ybi; Sat, 20 Jul 2019 11:42:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfvWGyR875VuYp4mjJ3EDEs+F2Du4+ecqy93rvIOFIq2sfexoMSRLqpqNZMBdlBlIa9m9q X-Received: by 2002:a17:902:1486:: with SMTP id k6mr63338332pla.177.1563648154094; Sat, 20 Jul 2019 11:42:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563648154; cv=none; d=google.com; s=arc-20160816; b=oY33cTgh3qDT3O/eP72Bm1OSTNepav84HGClAiAACvHHvqX9tebTxFKs2otZo4Ucrb EJS6M3h+014OpZwxKrmkpkfQzPiPGmZDKyH4GTBbTStx9StZZ67QP9AUu+RrCyMDyAnk LxLyRrFTtInzugrAzyj2RIoLZTBmyFVfM7qrpaDYRAu8NOYSv1wylCqXO4PEwrxClnd1 aXkbhIwr9ULY+vwOla0h+b4+VDDaqiTeertvQAxL5oB6efJXhBfKpT7fYiJ1pUWRcE6o cXKTL5zhocNs+5Ow2z1vdZ9YuCkzmnRXfaDQ50UTAbzE5s9dcAhynDSkq6Ffziz9Im/i y2DQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=S/LQ6AMTRZ8uyzBXfFszhu0ymD6cM0Cwh4wcwXihWfc=; b=f18Rshc+aVr7CqUjxFHYG1HkuHxIvMaRPQX9+7uQeVxiPSVPIfsF6PQDnqUtXP1H8H UT4KsVlgft/R0dRJ/qV+fv/7vD/YI6TenA0fal8LTRCppvxbqakIJOYla6Lp6EV/nAD1 rzLeyF/a+YFdkMUTFjULkd/CNN+JOLKFmyFtBMKxgMOe8R60YuUve2Tk6kKCQWA2oAJx zO4dz6nILHnxNLcShX461MYQ8V2ToFfAGUYdE1tKKg/nWPXw1+9C5HD4pVRCEc3ua6F6 M5QiOY8MZUReNkB8gGew29uBEMwiHC+sJHG+mgKsdE3bURWug4CNl/3ChpjNMgg+uJTU trGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZA9iECSr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z23si9285556pgi.116.2019.07.20.11.42.18; Sat, 20 Jul 2019 11:42:34 -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=@gmail.com header.s=20161025 header.b=ZA9iECSr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbfGTIbB (ORCPT + 99 others); Sat, 20 Jul 2019 04:31:01 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:39044 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbfGTIbB (ORCPT ); Sat, 20 Jul 2019 04:31:01 -0400 Received: by mail-pf1-f196.google.com with SMTP id f17so11181273pfn.6; Sat, 20 Jul 2019 01:31:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=S/LQ6AMTRZ8uyzBXfFszhu0ymD6cM0Cwh4wcwXihWfc=; b=ZA9iECSrQXkkvvk10OmJdl5Vm1Tz3OODAO1jIfYsJxZRBtg3u0MB2Ltf/I96oOMCwY ps3Zlhvb+LbUO1npqiO9rdLwRduGPjJqNx2tUSFNi4qIk/kLNGyXLysDnD2cjT5mgOPM iC5jptwd0CoDoFmx26omTU5pcIJddTe+RdaX5IKh+hkFATzRjSc1HKp9lyfs87JiUKEE rZyJrWvGPjqxwj4t23IJnd8VSZ0Bt2vfCUsqDtdEIp+KgaRr6AGD3VWgd1ZjMXedmJRD T70t6ZYNmIevNNfXVV+tTHo+DYX/am8HA+EdVK0mKqX4ykMGMOz3Nce31ktHy/H3WxaX qzYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=S/LQ6AMTRZ8uyzBXfFszhu0ymD6cM0Cwh4wcwXihWfc=; b=jqkA73MNSlJA66s8HfVtqjsbDchOUUl5YQMleSnrKZ/YctjRqNPvT3DqmjdGeierwn HmeocovSNwtSQiNLgE0c7xyl78L3ciAyMuDNRj0pva2QaV9mhCzJM09D5jNeuhwiKVDc vWqWVh+eI3Rytj0NfP59ORB53f+ygN/w5Gztnjbs28BpehmFVQwfhGFJZDJJwgCyc1nf YsVhoBiGFcThWfvUiJxlFY9wk+9FzardEnVBKHsKhcqb+QX25/ObfulkuOsPUlyQwHH6 ZR1C+5aOhPOFkvcQSNUDqCVqZSgwPQvvEUT/kV1QZeo5FdsOER+/ZeTAn1x0KrbxALup iwKQ== X-Gm-Message-State: APjAAAUbxhZGmb4nMxZNxfxsjyIrrHnasSK8+rrvk6xjiFclYAhN1xQa fhGa2GtUZKMzCXjVP4FxP/dqqQdB6CY= X-Received: by 2002:a63:1f1f:: with SMTP id f31mr58093611pgf.353.1563611459789; Sat, 20 Jul 2019 01:30:59 -0700 (PDT) Received: from localhost.localdomain ([123.213.206.190]) by smtp.gmail.com with ESMTPSA id z19sm28751356pgv.35.2019.07.20.01.30.57 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sat, 20 Jul 2019 01:30:58 -0700 (PDT) From: Minwoo Im To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Minwoo Im , Matias Bjorling Subject: [PATCH] lightnvm: introduce pr_fmt for the previx nvm Date: Sat, 20 Jul 2019 17:30:43 +0900 Message-Id: <20190720083043.23387-1-minwoo.im.dev@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org all the pr_() family can have this prefix by pr_fmt. Cc: Matias Bjorling Signed-off-by: Minwoo Im --- drivers/lightnvm/core.c | 45 +++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index a600934fdd9c..ba2947083da1 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,27 @@ 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", + 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 +1170,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 +1215,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 +1289,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 +1316,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 +1332,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 +1350,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 +1366,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; } -- 2.17.1