From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750727AbdAWGoD (ORCPT ); Mon, 23 Jan 2017 01:44:03 -0500 Received: from smtprelay0219.hostedemail.com ([216.40.44.219]:38333 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750703AbdAWGoB (ORCPT ); Mon, 23 Jan 2017 01:44:01 -0500 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::,RULES_HIT:41:355:379:541:599:960:973:982:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3653:3865:3866:3867:3870:3871:3872:4321:5007:7903:10004:10400:10848:11232:11658:11914:12296:12740:12760:12895:13069:13161:13229:13311:13357:13439:14096:14097:14659:14721:21080:21433:30054: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:1,LUA_SUMMARY:none X-HE-Tag: cord44_7a0174f853226 X-Filterd-Recvd-Size: 2701 Message-ID: <1485153837.12563.23.camel@perches.com> Subject: Re: [PATCH 1/2] hwmon: (lm70) Utilize dev_warn instead of pr_warn From: Joe Perches To: Florian Fainelli , linux-kernel@vger.kernel.org, Julia Lawall Cc: Rob Herring , Mark Rutland , Jean Delvare , Guenter Roeck , Jonathan Corbet , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , "open list:HARDWARE MONITORING" , "open list:DOCUMENTATION" Date: Sun, 22 Jan 2017 22:43:57 -0800 In-Reply-To: <20170121192010.30681-2-f.fainelli@gmail.com> References: <20170121192010.30681-1-f.fainelli@gmail.com> <20170121192010.30681-2-f.fainelli@gmail.com> 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 Sat, 2017-01-21 at 11:20 -0800, Florian Fainelli wrote: > We have a device reference, utilize it instead of pr_warn(). There is at least one more hwmon to convert in applesmc.c Perhaps a coccinelle script? Two questions for Julia Lawall: o is there a better way to do this than repeat the blocks one for each replacement o can struct device * dev be made an arbitrary identifier $ cat dev_printk.cocci @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_emerg( + dev_emerg(dev, ...); ...> } @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_crit( + dev_crit(dev, ...); ...> } @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_alert( + dev_alert(dev, ...); ...> } @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_err( + dev_err(dev, ...); ...> } @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_notice( + dev_notice(dev, ...); ...> } @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_warn( + dev_warn(dev, ...); ...> } @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_info( + dev_info(dev, ...); ...> } @@ identifier fn; type T; @@ T fn ( ..., struct device * dev, ... ) { <... - pr_debug( + dev_dbg(dev, ...); ...> }