From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750975AbdDACQp (ORCPT ); Fri, 31 Mar 2017 22:16:45 -0400 Received: from smtprelay0174.hostedemail.com ([216.40.44.174]:45625 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750769AbdDACQo (ORCPT ); Fri, 31 Mar 2017 22:16:44 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::,RULES_HIT:41:355:379:541:599:800:960:968:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1381:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3870:3871:3872:4321:5007:8660:10004:10400:10848:11026:11232:11658:11914:12043:12048:12296:12555:12731:12737:12740:12760:12895:13069:13148:13230:13311:13357:13439:14659:14721:21080:21451:30012:30030:30046:30054:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: coach56_669c0b4e747 X-Filterd-Recvd-Size: 2174 Message-ID: <1491013001.27353.27.camel@perches.com> Subject: Re: [PATCH 001/001] drivers/staging/vt6656/main_usb.c: checkpatch warning From: Joe Perches To: Chewie Lin , greg@kroah.com, forest@alittletooquiet.net, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Date: Fri, 31 Mar 2017 19:16:41 -0700 In-Reply-To: <20170401015919.9181-2-linsh@oregonstate.edu> References: <20170401015919.9181-1-linsh@oregonstate.edu> <20170401015919.9181-2-linsh@oregonstate.edu> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.3-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2017-03-31 at 18:59 -0700, Chewie Lin wrote: > Replace string with formatted arguments in the dev_warn() call. It removes > the checkpatch warning: > > WARNING: Prefer using "%s", __func__ to embedded function names > #417: FILE: main_usb.c:417: > + "usb_device_reset fail status=%d\n", status); > > total: 0 errors, 1 warnings, 1058 lines checked > > And after fix: > > main_usb.c has no obvious style problems and is ready for submission. > > Signed-off-by: Chewie Lin > --- > drivers/staging/vt6656/main_usb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c > index 9e074e9..2d9e7af 100644 > --- a/drivers/staging/vt6656/main_usb.c > +++ b/drivers/staging/vt6656/main_usb.c > @@ -414,7 +414,7 @@ static void usb_device_reset(struct vnt_private *priv) > status = usb_reset_device(priv->usb); > if (status) > dev_warn(&priv->usb->dev, > - "usb_device_reset fail status=%d\n", status); > + "%s=%d\n", "usb_device_reset fail status", status); So, what is failing? usb_reset_device or usb_device_reset? And this function is used exactly once, is trivial, and would likely be better as direct code in the one place it's used.