From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yh0-f53.google.com (mail-yh0-f53.google.com [209.85.213.53]) by dpdk.org (Postfix) with ESMTP id 3669A5941 for ; Tue, 2 Sep 2014 19:52:33 +0200 (CEST) Received: by mail-yh0-f53.google.com with SMTP id a41so4467321yho.26 for ; Tue, 02 Sep 2014 10:57:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=yrZB8Ly2Ei2jmM6KLr1PwyfdbJny7bTrrqYbyZ+vXtI=; b=duEHlPZ4Q7B+1jrZOKDlEOCQWSd9An2QodCbNDfR6lxhcdr5IsQRbRDtxZ4s2d1xIP IF0fk/g89q/nmWv1FOQsRlIaayWY1JzXiN0eGyzpQypaSHbnYbNg/KtUfFXdpKtMGJND Cm0epvHdXLrlW3QMOopYl0G+4mSueC3SvkcqhJ1BEb29sRaOte2VrP1M+0a2uty+7WtY HmAnv2UqVKWQVmqN5ODcuYL5eUaJwpi9heMUZOXEQ3pVpbL+Kp4WvFTGvqYKymaXdnG8 DqfWZ6UlozxvCCH9yyJeT4Kf9rFlSpDDdI3NRcuHmFg73dHfYqGRjhFrtQ0OgZoUZuaq le0w== X-Gm-Message-State: ALoCoQkByaUY+L87/s3xoBTN3814KNSbkWBUL4wup1fpkXEg9IhcvyRe3IRsZqha0+LNuY6HVFb6 MIME-Version: 1.0 X-Received: by 10.236.66.142 with SMTP id h14mr14617375yhd.104.1409680625344; Tue, 02 Sep 2014 10:57:05 -0700 (PDT) Received: by 10.170.96.213 with HTTP; Tue, 2 Sep 2014 10:57:05 -0700 (PDT) In-Reply-To: <3333103.135tnuTvaT@xps13> References: <1409567080-27083-1-git-send-email-david.marchand@6wind.com> <3333103.135tnuTvaT@xps13> Date: Tue, 2 Sep 2014 12:57:05 -0500 Message-ID: From: Jay Rolette To: Thomas Monjalon Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Cc: "dev@dpdk.org" Subject: Re: [dpdk-dev] [PATCH v2 01/17] ixgbe: use the right debug macro X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Sep 2014 17:52:33 -0000 On Tue, Sep 2, 2014 at 9:21 AM, Thomas Monjalon wrote: > >> -#define FUNC_PTR_OR_ERR_RET(func, retval) do { \ > > >> - if ((func) == NULL) { \ > > >> - DEBUGOUT("%s:%d function not supported\n", \ > > >> - __func__, __LINE__); \ > > >> - return (retval); \ > > >> - } \ > > >> +#define FUNC_PTR_OR_ERR_RET(func, retval) do { \ > > >> + if ((func) == NULL) { \ > > >> + PMD_DRV_LOG("%s:%d function not supported", \ > > >> + __func__, __LINE__); \ > > >> + return retval; \ > > >> > > > Need to keep the parens around retval in your macro > > > > Actually, checkpatch complained about this. > > So I can keep the parenthesis, but then I don't want Thomas to tell me my > > patch does not pass checkpatch :-) > > You're right, I care about checkpatch :) > I don't see a case where parens are needed with return. Please give an > example. Looking at it again, in this specific case you are correct. It is good hygiene to always use parens around macro arguments, but this specific case is ok without. It does add a small bit of danger if retval ends up getting used elsewhere in the macro, but that's about it. Probably not worth redoing the patch over that. Jay