Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932067AbXBSKyr (ORCPT ); Mon, 19 Feb 2007 05:54:47 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932068AbXBSKyr (ORCPT ); Mon, 19 Feb 2007 05:54:47 -0500 Received: from pentafluge.infradead.org ([213.146.154.40]:33748 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932067AbXBSKyq (ORCPT ); Mon, 19 Feb 2007 05:54:46 -0500 Date: Mon, 19 Feb 2007 10:54:45 +0000 From: Christoph Hellwig To: Artem Bityutskiy Cc: Linux Kernel Mailing List , Christoph Hellwig , Frank Haverkamp , Josh Boyer , Thomas Gleixner , David Woodhouse Subject: Re: [PATCH 05/44 take 2] [UBI] internal common header Message-ID: <20070219105445.GA16930@infradead.org> Mail-Followup-To: Christoph Hellwig , Artem Bityutskiy , Linux Kernel Mailing List , Frank Haverkamp , Josh Boyer , Thomas Gleixner , David Woodhouse References: <20070217165424.5845.4390.sendpatchset@localhost.localdomain> <20070217165449.5845.18238.sendpatchset@localhost.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070217165449.5845.18238.sendpatchset@localhost.localdomain> User-Agent: Mutt/1.4.2.2i X-SRS-Rewrite: SMTP reverse-path rewritten from by pentafluge.infradead.org See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1656 Lines: 45 On Sat, Feb 17, 2007 at 06:54:49PM +0200, Artem Bityutskiy wrote: > +#ifndef __UBI_UBI_H__ > +#define __UBI_UBI_H__ > + > +#include > + > +/* Version of this UBI implementation */ > +#define UBI_VERSION 1 We shouldn't have versions for inkernel interfaces. > +/* UBI messages printk level */ > +#define UBI_MSG_LEVEL KERN_INFO > +#define UBI_WARN_LEVEL KERN_WARNING > +#define UBI_ERR_LEVEL KERN_ERR Please use the KERN_ macros directly. > +/* Normal UBI messages */ > +#define ubi_msg(fmt, ...) \ > + printk(UBI_MSG_LEVEL UBI_MSG_PREF " " fmt "\n", ##__VA_ARGS__) > +/* UBI warning messages */ > +#define ubi_warn(fmt, ...) \ > + printk(UBI_WARN_LEVEL UBI_WARN_PREF " %s: " fmt "\n", __FUNCTION__, \ > + ##__VA_ARGS__) > +/* UBI error messages */ > +#define ubi_err(fmt, ...) \ > + printk(UBI_ERR_LEVEL UBI_ERR_PREF " %s " fmt "\n", __FUNCTION__, \ > + ##__VA_ARGS__) you should probably use dev_printk and the wrappers around it in most places. > +extern int ubis_num; > +extern struct ubi_info *ubis[UBI_MAX_INSTANCES]; Having this kind of global information directly exposed is a very bad idea. In general you only want to access it through more specific information and avoid allocating the global array at all. - 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/