Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751746AbZDLQpJ (ORCPT ); Sun, 12 Apr 2009 12:45:09 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751130AbZDLQo4 (ORCPT ); Sun, 12 Apr 2009 12:44:56 -0400 Received: from mail-bw0-f169.google.com ([209.85.218.169]:40307 "EHLO mail-bw0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbZDLQoz convert rfc822-to-8bit (ORCPT ); Sun, 12 Apr 2009 12:44:55 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=bN/RVAZUBEMvPzD3obTcjNYOL6qthDQRELwEUXb5kjIOlTSSzrQEOc3WscGEdJXGrK d/6ZZ5oyQq8jxlrDU/8ZhOG2z68xBKe/6Q823Pkd1+TocQC6HAwJcNqQsLbxdnoKJ0BY qTEKBDlEhJobYpILnpMBljHDVKax38TSJcozM= MIME-Version: 1.0 In-Reply-To: <1239365545-10356-8-git-send-email-philipp.reisner@linbit.com> References: <1239365545-10356-1-git-send-email-philipp.reisner@linbit.com> <1239365545-10356-2-git-send-email-philipp.reisner@linbit.com> <1239365545-10356-3-git-send-email-philipp.reisner@linbit.com> <1239365545-10356-4-git-send-email-philipp.reisner@linbit.com> <1239365545-10356-5-git-send-email-philipp.reisner@linbit.com> <1239365545-10356-6-git-send-email-philipp.reisner@linbit.com> <1239365545-10356-7-git-send-email-philipp.reisner@linbit.com> <1239365545-10356-8-git-send-email-philipp.reisner@linbit.com> Date: Sun, 12 Apr 2009 18:44:53 +0200 Message-ID: Subject: Re: [PATCH 07/14] DRBD: internal_data_structures From: Bart Van Assche To: Philipp Reisner Cc: linux-kernel@vger.kernel.org, Jens Axboe , Greg KH , Neil Brown , James Bottomley , Andi Kleen , Sam Ravnborg , Dave Jones , Nikanth Karthikesan , Lars Marowsky-Bree , "Nicholas A. Bellinger" , Lars Ellenberg Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1311 Lines: 35 On Fri, Apr 10, 2009 at 2:12 PM, Philipp Reisner wrote: > diff -uNrp linux-2.6.30-rc1/drivers/block/drbd/drbd_int.h linux-2.6.30-rc1-drbd/drivers/block/drbd/drbd_int.h ... > +#define PRINTK(level, fmt, args...) \ > + ? ? ? printk(level "drbd%d: " fmt, \ > + ? ? ? ? ? ? ? mdev->minor , ##args) The above looks similar to dev_printk() from . It would be great if some of the DRBD-specific macro's could be replaced by existing Linux macro's. This would improve the readability of the DRBD source code. ... > +#define D_ASSERT(exp) ?if (!(exp)) \ > + ? ? ? ?ERR("ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__) > + > +#define ERR_IF(exp) if (({ ? ? ? ? ? ? ? ? ? ? ? ? ? ? \ > + ? ? ? int _b = (exp) != 0; ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ > + ? ? ? if (_b) ERR("%s: (%s) in %s:%d\n", ? ? ? ? ? ? ?\ > + ? ? ? ? ? ? ? __func__, #exp, __FILE__, __LINE__); ? ?\ > + ? ? ? ?_b; ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?\ > + ? ? ? })) How about replacing invocations of D_ASSERT() and/or ERR_IF() by WARN_ON() ? Bart. -- 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/