From patchwork Mon Feb 13 22:20:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 9570835 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 82CFC60572 for ; Mon, 13 Feb 2017 22:20:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BE4327BFF for ; Mon, 13 Feb 2017 22:20:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F30A27C2D; Mon, 13 Feb 2017 22:20:59 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id 7278C27BFF for ; Mon, 13 Feb 2017 22:20:58 +0000 (UTC) Received: (qmail 19742 invoked by uid 550); 13 Feb 2017 22:20:57 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 19710 invoked from network); 13 Feb 2017 22:20:55 -0000 X-Session-Marker: 6A6F6540706572636865732E636F6D X-HE-Tag: mouth25_405eab440cd39 X-Filterd-Recvd-Size: 5209 Message-ID: <1487024441.6214.12.camel@perches.com> From: Joe Perches To: "Roberts, William C" Cc: "linux-kernel@vger.kernel.org" , "apw@canonical.com" , "kernel-hardening@lists.openwall.com" Date: Mon, 13 Feb 2017 14:20:41 -0800 In-Reply-To: <476DC76E7D1DF2438D32BFADF679FC562305F62F@ORSMSX103.amr.corp.intel.com> References: <1486755469-21573-1-git-send-email-william.c.roberts@intel.com> <1486757549.2192.20.camel@perches.com> <476DC76E7D1DF2438D32BFADF679FC562305C559@ORSMSX103.amr.corp.intel.com> <476DC76E7D1DF2438D32BFADF679FC562305C5BA@ORSMSX103.amr.corp.intel.com> <1486766996.2192.30.camel@perches.com> <476DC76E7D1DF2438D32BFADF679FC562305DC7B@ORSMSX103.amr.corp.intel.com> <1486783428.2192.44.camel@perches.com> <476DC76E7D1DF2438D32BFADF679FC562305F372@ORSMSX103.amr.corp.intel.com> <1487016251.6214.6.camel@perches.com> <476DC76E7D1DF2438D32BFADF679FC562305F62F@ORSMSX103.amr.corp.intel.com> X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Subject: [kernel-hardening] Re: [PATCH] checkpatch: add warning on %pk instead of %pK usage X-Virus-Scanned: ClamAV using ClamSMTP (Adding back the cc's) On Mon, 2017-02-13 at 21:28 +0000, Roberts, William C wrote: > > > No worries. > > No idea why it doesn't work for you. > > Maybe the hand applying was somehow > > faulty? > > > > The attached is on top of -next so it does have offsets on Linus' tree, but it seems > > to work. > > > > (on -linux) > > > > $ patch -p1 < cp_vsp.diff > > patching file scripts/checkpatch.pl > > Hunk #1 succeeded at 5634 (offset -36 lines). > > > > $ cat t_block.c > > { > > MY_DEBUG(drv->foo, > >  "%pk", > >  foo->boo); > > } > > $ ./scripts/checkpatch.pl -f t_block.c > > WARNING: Invalid vsprintf pointer extension '%pk' > > #2: FILE: t_block.c:2: > > + MY_DEBUG(drv->foo, > > +  "%pk", > > +  foo->boo); > > > > total: 0 errors, 1 warnings, 5 lines checked > > > > NOTE: For some of the reported defects, checkpatch may be able to > >       mechanically convert to the typical style using --fix or --fix-inplace. > > > > t_block.c has style problems, please review. > > > > NOTE: If any of the errors are false positives, please report > >       them to the maintainer, see CHECKPATCH in MAINTAINERS. > > > Applied. It works fine with your example (see attached 0001-tblock.patch) but it doesn't provide > Output for me with 0002-drv-hack.patch (attached as well) > > $ ./scripts/checkpatch.pl 0002-drv-hack.patch > total: 0 errors, 0 warnings, 10 lines checked > > 0002-drv-hack.patch has no obvious style problems and is ready for submission. > > ./scripts/checkpatch.pl 0001-tblock.patch > WARNING: added, moved or deleted file(s), does MAINTAINERS need updating? > #13: > new file mode 100644 > > WARNING: Invalid vsprintf pointer extension '%pk' > #19: FILE: t_block.c:2: > + MY_DEBUG(drv->foo, > + "%pk", > + foo->boo); > > total: 0 errors, 2 warnings, 6 lines checked > > NOTE: For some of the reported defects, checkpatch may be able to > mechanically convert to the typical style using --fix or --fix-inplace. > > 0001-tblock.patch has style problems, please review. > > NOTE: If any of the errors are false positives, please report > them to the maintainer, see CHECKPATCH in MAINTAINERS. This means _all_ the $stat checks aren't being done on patches that add just a single multi-line statement. Andrew? Any thoughts on how to enable $stat appropriately for patch contexts with a single multi-line statement? From 00191661141fb11abac22efe98ee58d37a9d9391 Mon Sep 17 00:00:00 2001 From: William Roberts Date: Mon, 13 Feb 2017 11:35:03 -0800 Subject: [PATCH 2/2] drv hack Signed-off-by: William Roberts --- drivers/char/applicom.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/char/applicom.c b/drivers/char/applicom.c index e5c62dc..4f6934d 100644 --- a/drivers/char/applicom.c +++ b/drivers/char/applicom.c @@ -153,6 +153,10 @@ static int ac_register_board(unsigned long physloc, void __iomem *loc, return 0; } + MY_DEBUG(drv->foo, + "%pk", + foo->boo); + boardno--; apbs[boardno].PhysIO = physloc; -- 2.7.4