Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755245AbbHGGzi (ORCPT ); Fri, 7 Aug 2015 02:55:38 -0400 Received: from mail-pa0-f52.google.com ([209.85.220.52]:35750 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753306AbbHGGzh (ORCPT ); Fri, 7 Aug 2015 02:55:37 -0400 Date: Fri, 7 Aug 2015 15:56:11 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Salah Triki , ngupta@vflare.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: Re: [PATCH 0/3] zram: Replace pr_* with dev_* Message-ID: <20150807065611.GI1891@swordfish> References: <20150807000520.GA1891@swordfish> <20150807060559.GA7716@bgram> <20150807063756.GH1891@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150807063756.GH1891@swordfish> User-Agent: Mutt/1.5.23+102 (2ca89bed6448) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2194 Lines: 76 On (08/07/15 15:37), Sergey Senozhatsky wrote: [..] > we now have errors like > 'zram: Cannot initialise lzo compressing backend' > > and they will transform into > > 'block zram0: Cannot initialise lzo compressing backend' > > note the prefix 'zram:' became 'block zram0:' but it doesn't come for free. where we had clean and nice pr_err("Decompression failed!... pr_info("Unable to allocate temp memory\n"... etc... now we have monsters dev_err(disk_to_dev(zram->disk), "Decompression failed!... dev_info(disk_to_dev(zram->disk), "Unable to allocate temp memory\n"... etc. other changes are very questionable... for example pr_info("Added device: %s\n", zram->disk->disk_name); becomes dev_info(disk_to_dev(zram->disk), "Added device: %s\n", zram->disk->disk_name); why? there is no reason to do this! and messages are converted in a bit random manner, shall I say. so now we have a mix of dev_* and pr_* errors. to convert them all to dev_* (which is not possible in all the cases) we would need to change some function prototypes and start passing zram pointer, or disk... example: static struct zram_meta *zram_meta_alloc(int device_id, u64 disksize) { size_t num_pages; char pool_name[8]; struct zram_meta *meta = kmalloc(sizeof(*meta), GFP_KERNEL); if (!meta) return NULL; num_pages = disksize >> PAGE_SHIFT; meta->table = vzalloc(num_pages * sizeof(*meta->table)); if (!meta->table) { pr_err("Error allocating zram address table\n"); goto out_error; } snprintf(pool_name, sizeof(pool_name), "zram%d", device_id); meta->mem_pool = zs_create_pool(pool_name, GFP_NOIO | __GFP_HIGHMEM); if (!meta->mem_pool) { pr_err("Error creating memory pool\n"); goto out_error; } ... so I see a little value. really. too much things to change. -ss -- 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/