From patchwork Fri May 6 16:23:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 9034411 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 09411BF29F for ; Fri, 6 May 2016 16:24:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 834772025B for ; Fri, 6 May 2016 16:24:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B180D20125 for ; Fri, 6 May 2016 16:24:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757270AbcEFQYG (ORCPT ); Fri, 6 May 2016 12:24:06 -0400 Received: from mga11.intel.com ([192.55.52.93]:20033 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751695AbcEFQYE (ORCPT ); Fri, 6 May 2016 12:24:04 -0400 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 06 May 2016 09:24:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,587,1455004800"; d="scan'208";a="697898718" Received: from black.fi.intel.com ([10.237.72.93]) by FMSMGA003.fm.intel.com with ESMTP; 06 May 2016 09:24:02 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id CDC7C207; Fri, 6 May 2016 19:24:00 +0300 (EEST) From: Andy Shevchenko To: "Martin K. Petersen" , linux-scsi@vger.kernel.org Cc: Andy Shevchenko , Sathya Prakash , MPT-FusionLinux.pdl@broadcom.com Subject: [PATCH v1 3/4] fusion: print lan address via %pMR Date: Fri, 6 May 2016 19:23:58 +0300 Message-Id: <1462551839-44380-4-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1462551839-44380-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1462551839-44380-1-git-send-email-andriy.shevchenko@linux.intel.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-9.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP LAN MAC addresses can be printed directly using %pMR specifier. Cc: Sathya Prakash Cc: MPT-FusionLinux.pdl@broadcom.com Signed-off-by: Andy Shevchenko --- drivers/message/fusion/mptbase.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 5537f8d..3af67e6 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c @@ -2584,10 +2584,7 @@ mpt_do_ioc_recovery(MPT_ADAPTER *ioc, u32 reason, int sleepFlag) (void) GetLanConfigPages(ioc); a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; dprintk(ioc, printk(MYIOC_s_DEBUG_FMT - "LanAddr = %02X:%02X:%02X" - ":%02X:%02X:%02X\n", - ioc->name, a[5], a[4], - a[3], a[2], a[1], a[0])); + "LanAddr = %pMR\n", ioc->name, a)); } break; @@ -6782,8 +6779,7 @@ static int mpt_iocinfo_proc_show(struct seq_file *m, void *v) if (ioc->bus_type == FC) { if (ioc->pfacts[p].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN) { u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; - seq_printf(m, " LanAddr = %02X:%02X:%02X:%02X:%02X:%02X\n", - a[5], a[4], a[3], a[2], a[1], a[0]); + seq_printf(m, " LanAddr = %pMR\n", a); } seq_printf(m, " WWN = %08X%08X:%08X%08X\n", ioc->fc_port_page0[p].WWNN.High, @@ -6860,8 +6856,7 @@ mpt_print_ioc_summary(MPT_ADAPTER *ioc, char *buffer, int *size, int len, int sh if (showlan && (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN)) { u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; - y += sprintf(buffer+len+y, ", LanAddr=%02X:%02X:%02X:%02X:%02X:%02X", - a[5], a[4], a[3], a[2], a[1], a[0]); + y += sprintf(buffer+len+y, ", LanAddr=%pMR", a); } y += sprintf(buffer+len+y, ", IRQ=%d", ioc->pci_irq); @@ -6895,8 +6890,7 @@ static void seq_mpt_print_ioc_summary(MPT_ADAPTER *ioc, struct seq_file *m, int if (showlan && (ioc->pfacts[0].ProtocolFlags & MPI_PORTFACTS_PROTOCOL_LAN)) { u8 *a = (u8*)&ioc->lan_cnfg_page1.HardwareAddressLow; - seq_printf(m, ", LanAddr=%02X:%02X:%02X:%02X:%02X:%02X", - a[5], a[4], a[3], a[2], a[1], a[0]); + seq_printf(m, ", LanAddr=%pMR", a); } seq_printf(m, ", IRQ=%d", ioc->pci_irq);