From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753667AbbLITGh (ORCPT ); Wed, 9 Dec 2015 14:06:37 -0500 Received: from smtprelay0195.hostedemail.com ([216.40.44.195]:40800 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753449AbbLITGf (ORCPT ); Wed, 9 Dec 2015 14:06:35 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::,RULES_HIT:41:355:379:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2198:2199:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3871:4321:5007:6117:6119:6238:6261:7974:10004:10400:10848:11026:11232:11658:11914:12043:12517:12519:12555:12740:13069:13311:13357:13894:14659:21080:30054:30064:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:8,LUA_SUMMARY:none X-HE-Tag: play63_907006ee6fb05 X-Filterd-Recvd-Size: 2201 Message-ID: <1449687991.25389.23.camel@perches.com> Subject: Re: [PATCHv2 1/2] Print: Add print format for 8-byte EUI-64 type From: Joe Perches To: Keith Busch , linux-nvme@lists.infradead.org, LKML Cc: Matthew Wilcox , Greg Kroah-Hartman , Jens Axboe , Christoph Hellwig , Dan Williams Date: Wed, 09 Dec 2015 11:06:31 -0800 In-Reply-To: <1449686577-6319-2-git-send-email-keith.busch@intel.com> References: <1449686577-6319-1-git-send-email-keith.busch@intel.com> <1449686577-6319-2-git-send-email-keith.busch@intel.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.2-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2015-12-09 at 11:42 -0700, Keith Busch wrote: > MAC addresses may be formed using rules based on EUI-64, which is 2 bytes > longer than a typical 6-byte MAC. This patch adds a long specifier to > the %pM format to support the extended unique identifier. [] > diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt [] > @@ -136,14 +136,21 @@ Raw buffer as a hex string: >  MAC/FDDI addresses: >   >   %pM 00:01:02:03:04:05 > + %pMl 00:01:02:03:04:05:06:07 >   %pMR 05:04:03:02:01:00 > + %pMRl 07:06:05:04:03:02:01:00 >   %pMF 00-01-02-03-04-05 > + %pMFl 00-01-02-03-04-05-06-07 >   %pm 000102030405 > + %pml 0001020304050607 >   %pmR 050403020100 > + %pmRl 0706050403020100 [] > diff --git a/lib/vsprintf.c b/lib/vsprintf.c [] > @@ -908,14 +908,21 @@ char *mac_address_string(char *buf, char *end, u8 *addr, >   separator = ':'; >   break; >   } > + switch (fmt[2]) { > + case 'l': > + bytes = 8; > + break; > + default: > + break; > + } This doesn't work for formats without pmR or pmF. like "%pml" or "%pMl" as fmt[2] can be anything.