Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp4829664imd; Tue, 30 Oct 2018 08:02:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5cQPVXpZO5qP2MsbOJLSI9DXNUbSzUU4jXZTttOi+nMrRT/WbIgKJAU6P3PqXUaj79j2YRa X-Received: by 2002:a63:3546:: with SMTP id c67mr9425177pga.284.1540911768280; Tue, 30 Oct 2018 08:02:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540911768; cv=none; d=google.com; s=arc-20160816; b=VmaXu3e4ZY75CY5j4xbpylR4XUQv8EVTrIx5P3ZPx2Ab41JXy3ax+f5wWgBMVkRjfw afy8iXk4bRRYEQEF8taDXFg/cIAig+GSUSbmYr4lleQzKFEkIg2p3la+wek2jBN9qjVC qbk8D+7hCaBlX9AM17lvqF8+00GmL0HGPOYj3BLdmt2sFdmfOoU1NErjChRnpEE1K5Mk 3BI7C11K8dj/mcSvVF7Tt6W5oUKfqg+hmUhb/qbQP6w0FKzCtPBQ21X3BTEGp51dq99w xZaqKtdx1tgpeWwtMX1b+My1DWr36qFbwSeLx0b3YJ4xTLknPaU9wzQaKZ/dpnPdXgH5 83MA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=pHD9IzizR8gzHd1fQ/oIGZnmyty24ujoHMHYTmTAUlU=; b=VqxvsiLnZ86NRfJiBhPR5QE1ztP2rFdcf7pYJQuZd/nVcJsRuXJyM3W489YFa+p99J 0SSjnJle76zB1IuV4pSecLDaMDGwQZHOUuEi+1gDIxho2HrpTUWGbLoecb4dl1RkwpXV IIKxxiSdbZDsPGOmZgPRWlKYADO9drU6ksj8nOwqr1/PSw1U+Pnw2dKBAgyQy5djhugE 1EdqVhOML/brHkZviar9l3cCgfMBUKgucpF10AqdbLTFGw1Di7GqoKxL/h5NU3ioitEW A4iwlaBGEEmxpKsQjbPxzxOayxRcoG6SryBRBzNRRPeqkYhpYYGk8tLRP9p5VOAjDDh1 i6BQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o4-v6si3529692pgj.306.2018.10.30.08.02.28; Tue, 30 Oct 2018 08:02:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727350AbeJ3Xzm (ORCPT + 99 others); Tue, 30 Oct 2018 19:55:42 -0400 Received: from smtprelay0193.hostedemail.com ([216.40.44.193]:39775 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725853AbeJ3Xzm (ORCPT ); Tue, 30 Oct 2018 19:55:42 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay02.hostedemail.com (Postfix) with ESMTP id BC94B8E52; Tue, 30 Oct 2018 15:01:52 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::,RULES_HIT:41:355:379:599:966:988:989:1260:1277:1311:1313:1314:1345:1359:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2196:2199:2393:2559:2562:2828:3138:3139:3140:3141:3142:3353:3622:3867:3872:3873:4250:4321:4385:4605:5007:6119:7903:10004:10400:10848:11026:11232:11658:11914:12043:12296:12438:12555:12679:12740:12760:12895:13439:14093:14097:14181:14659:14721:21080:21451:21627:30054:30083:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.14.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:28,LUA_SUMMARY:none X-HE-Tag: crack11_678f1c766ad14 X-Filterd-Recvd-Size: 3004 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf14.hostedemail.com (Postfix) with ESMTPA; Tue, 30 Oct 2018 15:01:51 +0000 (UTC) Message-ID: Subject: Re: [PATCH 3/3] kobject: fix warnings use pr_* to replace printk From: Joe Perches To: Bo YU , gregkh@linuxfoundation.org, rafael@kernel.org Cc: linux-kernel@vger.kernel.org Date: Tue, 30 Oct 2018 08:01:50 -0700 In-Reply-To: References: Content-Type: text/plain; charset="ISO-8859-1" User-Agent: Evolution 3.30.1-1build1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-10-30 at 08:01 -0400, Bo YU wrote: > Fix warning from checkpatch.pl use pr_* to replace printk If you look at msg, it can be unterminated with newline. > diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c [] > @@ -224,7 +224,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count) > out: > if (r) { > devpath = kobject_get_path(kobj, GFP_KERNEL); > - printk(KERN_WARNING "synth uevent: %s: %s", > + pr_warn("synth uevent: %s: %s", > devpath ?: "unknown device", > msg ?: "failed to send uevent"); > kfree(devpath); Perhaps this block should be: diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c index 63d0816ab23b..0ba1197f366e 100644 --- a/lib/kobject_uevent.c +++ b/lib/kobject_uevent.c @@ -195,12 +195,12 @@ int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count) enum kobject_action action; const char *action_args; struct kobj_uevent_env *env; - const char *msg = NULL, *devpath; + const char *msg = NULL; int r; r = kobject_action_type(buf, count, &action, &action_args); if (r) { - msg = "unknown uevent action string\n"; + msg = "unknown uevent action string"; goto out; } @@ -212,7 +212,7 @@ int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count) r = kobject_action_args(action_args, count - (action_args - buf), &env); if (r == -EINVAL) { - msg = "incorrect uevent action arguments\n"; + msg = "incorrect uevent action arguments"; goto out; } @@ -223,10 +223,11 @@ int kobject_synth_uevent(struct kobject *kobj, const char *buf, size_t count) kfree(env); out: if (r) { - devpath = kobject_get_path(kobj, GFP_KERNEL); - printk(KERN_WARNING "synth uevent: %s: %s", - devpath ?: "unknown device", - msg ?: "failed to send uevent"); + char *devpath devpath = kobject_get_path(kobj, GFP_KERNEL); + + pr_warn("synth uevent: %s: %s\n", + devpath ?: "unknown device", + msg ?: "failed to send uevent"); kfree(devpath); } return r;