From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755823AbdBOXtO convert rfc822-to-8bit (ORCPT ); Wed, 15 Feb 2017 18:49:14 -0500 Received: from mga05.intel.com ([192.55.52.43]:17080 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754088AbdBOXtL (ORCPT ); Wed, 15 Feb 2017 18:49:11 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,167,1484035200"; d="scan'208";a="45272745" From: "Roberts, William C" To: Joe Perches CC: "linux-kernel@vger.kernel.org" , "apw@canonical.com" , "kernel-hardening@lists.openwall.com" Subject: RE: [PATCH] checkpatch: add warning on %pk instead of %pK usage Thread-Topic: [PATCH] checkpatch: add warning on %pk instead of %pK usage Thread-Index: AQHSg9UvWAPxVS9whUiJ3t5Bad2kYaFjMnOA//+bwQCAAAERAIAAjywA//9+SKCAAAx1gIAAGxWQgACmswCAA66QIIAAjZqA//+NZIAAExf+gABW2fJQ Date: Wed, 15 Feb 2017 23:49:04 +0000 Message-ID: <476DC76E7D1DF2438D32BFADF679FC5623064D3F@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> <1487024441.6214.12.camel@perches.com> In-Reply-To: <1487024441.6214.12.camel@perches.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjg4ZmY4M2YtMzRkNi00MDlkLWJlODItMGY2M2RjYmNmYTJhIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlBYdkpDSitaMlgwSFlZd1cra2JkSGYwMnh3eForOFpycVp1OE1vaXRuVzA9In0= x-ctpclassification: CTP_IC x-originating-ip: [10.22.254.139] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Joe Perches [mailto:joe@perches.com] > Sent: Monday, February 13, 2017 2:21 PM > To: Roberts, William C > Cc: linux-kernel@vger.kernel.org; apw@canonical.com; kernel- > hardening@lists.openwall.com > Subject: Re: [PATCH] checkpatch: add warning on %pk instead of %pK usage > > (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? I'm for merging your patch as is, and then take up the fact that $stat is not working correctly as a separate change, does that seem reasonable?