From patchwork Sat Aug 13 17:03:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 9278507 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E7BD0600CB for ; Sat, 13 Aug 2016 17:03:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7C5828A4D for ; Sat, 13 Aug 2016 17:03:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB20228A7F; Sat, 13 Aug 2016 17:03:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71F4228A4D for ; Sat, 13 Aug 2016 17:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752729AbcHMRDI (ORCPT ); Sat, 13 Aug 2016 13:03:08 -0400 Received: from smtprelay0022.hostedemail.com ([216.40.44.22]:33395 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752694AbcHMRDH (ORCPT ); Sat, 13 Aug 2016 13:03:07 -0400 Received: from filter.hostedemail.com (unknown [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 2B4166AA96; Sat, 13 Aug 2016 17:03:06 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: quilt66_7207fc627752c X-Filterd-Recvd-Size: 3192 Received: from XPS-9350.home (unknown [96.251.125.34]) (Authenticated sender: joe@perches.com) by omf03.hostedemail.com (Postfix) with ESMTPA; Sat, 13 Aug 2016 17:03:03 +0000 (UTC) Message-ID: <1471107782.3467.28.camel@perches.com> Subject: Re: [PATCH 2/2 v3] be2iscsi: Fix some error messages From: Joe Perches To: Christophe JAILLET , jayamohan.kallickal@avagotech.com, jejb@linux.vnet.ibm.com, ketan.mukadam@avagotech.com, sony.john@avagotech.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Date: Sat, 13 Aug 2016 10:03:02 -0700 In-Reply-To: <1471106498.3467.19.camel@perches.com> References: <4cd24bc3-7953-479a-1dbe-2aac9299ce13@wanadoo.fr> <1471072824-1491-1-git-send-email-christophe.jaillet@wanadoo.fr> <1471088144.3467.11.camel@perches.com> <1471106498.3467.19.camel@perches.com> X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Sat, 2016-08-13 at 09:41 -0700, Joe Perches wrote: > On Sat, 2016-08-13 at 14:31 +0200, Christophe JAILLET wrote: > > Le 13/08/2016 à 13:35, Joe Perches a écrit : > > > > @@ -268,7 +268,7 @@ static int beiscsi_eh_abort(struct scsi_cmnd *sc) > > > >    &nonemb_cmd.dma); > > > >    if (nonemb_cmd.va == NULL) { > > > >    beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_EH, > > > > -     "BM_%d : Failed to allocate memory for" > > > > +     "BM_%d : Failed to allocate memory for " > > > >        "mgmt_invalidate_icds\n"); This is the first time I've looked at the beiscsi_log macro. It sure is odd and undesirable. It's _very_ not nice to have a format string take an implied __LINE__ argument. It'd be much more intelligible to take the first bit as a separate string, concatenate it in the macro with "_%d: " and __LINE__ (if that's really useful, I think it's not) and emit that as the format. Something like: So these beiscsi_log uses become something like: beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_EH,     "BM", "Failed to allocate memory for mgmt_invalidate_icds\n"); and the format and its arguments match. --- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/be2iscsi/be_main.h b/drivers/scsi/be2iscsi/be_main.h index 30a4606..3f0fbbf 100644 --- a/drivers/scsi/be2iscsi/be_main.h +++ b/drivers/scsi/be2iscsi/be_main.h @@ -1084,11 +1084,12 @@ struct hwi_context_memory {  #define __beiscsi_log(phba, level, fmt, arg...) \   shost_printk(level, phba->shost, fmt, __LINE__, ##arg)   -#define beiscsi_log(phba, level, mask, fmt, arg...) \ -do { \ - uint32_t log_value = phba->attr_log_enable; \ - if (((mask) & log_value) || (level[1] <= '3')) \ - __beiscsi_log(phba, level, fmt, ##arg); \ -} while (0); +#define beiscsi_log(phba, level, mask, prefix, fmt, ...) \ +do { \ + uint32_t log_value = phba->attr_log_enable; \ + if (((mask) & log_value) || (level[1] <= '3')) \ + __beiscsi_log(phba, level, prefix "_%d: " fmt, \ +       ##__VA_ARGS__); \ +} while (0)    #endif