Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932375AbbHFXES (ORCPT ); Thu, 6 Aug 2015 19:04:18 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:36701 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932354AbbHFXEP (ORCPT ); Thu, 6 Aug 2015 19:04:15 -0400 From: Salah Triki To: minchan@kernel.org, ngupta@vflare.org, sergey.senozhatsky.work@gmail.com Cc: linux-kernel@vger.kernel.org, Salah Triki Subject: [PATCH 3/3] zram: Replace pr_* with dev_* Date: Fri, 7 Aug 2015 00:03:53 +0100 Message-Id: <17406af72d99018b0a9b815933a4397ce1e88ffb.1438899649.git.salah.triki@acm.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: References: In-Reply-To: <8a155b1ea18b34ea250b22b1f2696e8ba698e0e6.1438899649.git.salah.triki@acm.org> References: <8a155b1ea18b34ea250b22b1f2696e8ba698e0e6.1438899649.git.salah.triki@acm.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4130 Lines: 120 dev_* attach the messages to the devices. --- drivers/block/zram/zram_drv.c | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 1c2f8b9..73f3453 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -589,7 +589,8 @@ static int zram_decompress_page(struct zram *zram, char *mem, u32 index) /* Should NEVER happen. Return bio error if it does. */ if (unlikely(ret)) { - pr_err("Decompression failed! err=%d, page=%u\n", ret, index); + dev_err(disk_to_dev(zram->disk), "Decompression failed! err=%d, page=%u\n", + ret, index); return ret; } @@ -623,7 +624,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec, uncmem = user_mem; if (!uncmem) { - pr_info("Unable to allocate temp memory\n"); + dev_info(disk_to_dev(zram->disk), "Unable to allocate temp memory\n"); ret = -ENOMEM; goto out_cleanup; } @@ -708,7 +709,8 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, } if (unlikely(ret)) { - pr_err("Compression failed! err=%d\n", ret); + dev_err(disk_to_dev(zram->disk), "Compression failed! err=%d\n", + ret); goto out; } src = zstrm->buffer; @@ -720,7 +722,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index, handle = zs_malloc(meta->mem_pool, clen); if (!handle) { - pr_info("Error allocating memory for compressed page: %u, size=%zu\n", + dev_info(disk_to_dev(zram->disk), "Error allocating memory for compressed page: %u, size=%zu\n", index, clen); ret = -ENOMEM; goto out; @@ -1039,15 +1041,15 @@ static ssize_t disksize_store(struct device *dev, comp = zcomp_create(zram->compressor, zram->max_comp_streams); if (IS_ERR(comp)) { - pr_info("Cannot initialise %s compressing backend\n", - zram->compressor); + dev_info(dev, "Cannot initialise %s compressing backend\n", + zram->compressor); err = PTR_ERR(comp); goto out_free_meta; } down_write(&zram->init_lock); if (init_done(zram)) { - pr_info("Cannot change disksize for initialized device\n"); + dev_info(dev, "Cannot change disksize for initialized device\n"); err = -EBUSY; goto out_destroy_comp; } @@ -1206,7 +1208,7 @@ static int zram_add(void) queue = blk_alloc_queue(GFP_KERNEL); if (!queue) { - pr_err("Error allocating disk queue for device %d\n", + dev_err(disk_to_dev(zram->disk), "Error allocating disk queue for device %d\n", device_id); ret = -ENOMEM; goto out_free_idr; @@ -1217,7 +1219,7 @@ static int zram_add(void) /* gendisk structure */ zram->disk = alloc_disk(1); if (!zram->disk) { - pr_warn("Error allocating disk structure for device %d\n", + dev_warn(disk_to_dev(zram->disk), "Error allocating disk structure for device %d\n", device_id); ret = -ENOMEM; goto out_free_queue; @@ -1266,14 +1268,15 @@ static int zram_add(void) ret = sysfs_create_group(&disk_to_dev(zram->disk)->kobj, &zram_disk_attr_group); if (ret < 0) { - pr_warn("Error creating sysfs group"); + dev_warn(disk_to_dev(zram->disk), "Error creating sysfs group"); goto out_free_disk; } strlcpy(zram->compressor, default_compressor, sizeof(zram->compressor)); zram->meta = NULL; zram->max_comp_streams = 1; - pr_info("Added device: %s\n", zram->disk->disk_name); + dev_info(disk_to_dev(zram->disk), "Added device: %s\n", + zram->disk->disk_name); return device_id; out_free_disk: @@ -1321,7 +1324,8 @@ static int zram_remove(struct zram *zram) zram_reset_device(zram); bdput(bdev); - pr_info("Removed device: %s\n", zram->disk->disk_name); + dev_info(disk_to_dev(zram->disk), "Removed device: %s\n", + zram->disk->disk_name); idr_remove(&zram_index_idr, zram->disk->first_minor); blk_cleanup_queue(zram->disk->queue); -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/