Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp6313327imd; Wed, 31 Oct 2018 09:50:06 -0700 (PDT) X-Google-Smtp-Source: AJdET5c7lc0E4IlyQhx/KTLkG/TxgTlTk3EI+SCjq+iMSawaZbWOwkKMkm+TLJPpb48SEJejWH1g X-Received: by 2002:a63:2045:: with SMTP id r5-v6mr3865280pgm.328.1541004606795; Wed, 31 Oct 2018 09:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541004606; cv=none; d=google.com; s=arc-20160816; b=J1sNn3Bs/EtdSDIykIhE1lBffGKEVrGWhxmSwZ3BtjdAkOLz6Mz7uNvSuR+Fv8u8wB YsaVST4uJ196JhKUVsZxy6XKNsX6pKlgzFDaA0aIX4NtOb2D/WZdU1EqWpaHJ6l6Fjcb ZrrHME75k63Gnb0nTkWv6yQGPSFQC7guJ/gwfsRCcUKcIqQ78SxP/i6JJxgkjQGBFXap hlFuK6TzbWst+n6RmOv0Oa3nr0r27KkfSI6oE1nVMBA8mco5jm7e57TwBp1Oq3S9Z8I4 T9S6uequFD9NLp8V4MwAAGu3DXFa0Mv+9ytMAzzd13g8bF3+2VMCGppZ0M9R591C6qTG eEAg== 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=AOeCcSLYsJ3moh6TnFjS48v7bFfv7+zqrQ/yCHyW/mY=; b=B01RTW6nCMwE0bgCcCemFfwR8FU1/i2nM6ncUBYNdyFjZV9XJ2jIunifZSaxv1ffYB yXwa8GOUioRPx+vHR7uVMwAt6rW1k/hN4MKRgGEvzPadw0O6sXo+lqCi2ArJh+6C47c3 52tmQS/JZ617iJAm+13NKXueX7UBbHhiLBWRTyy33CZrNVUEFrLkVQ57rrbx7YDEtcuc UB34qK9cO4Ad0PHOSn/HvQ31lSBYuCifymWPXsoedHJWXJV6CyyHsej+TLSreNKUz2q+ eRFiX+LztMhyr1iZcfhd8hDddMwOs4jZXz9FTrgSzE6aZVldwuj9HbixDGOFSHqfQEEO vIkA== 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 e127-v6si29534846pfe.8.2018.10.31.09.49.51; Wed, 31 Oct 2018 09:50:06 -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 S1729897AbeKABrQ (ORCPT + 99 others); Wed, 31 Oct 2018 21:47:16 -0400 Received: from smtprelay0213.hostedemail.com ([216.40.44.213]:38496 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729826AbeKABrQ (ORCPT ); Wed, 31 Oct 2018 21:47:16 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay07.hostedemail.com (Postfix) with ESMTP id BBB9F181D3419; Wed, 31 Oct 2018 16:48:27 +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:2553:2559:2562:2828:3138:3139:3140:3141:3142:3355:3622:3865:3866:3867:3868:3870:3872:3873:3874:4184:4250:4321:4385:4605:5007:6119:7903:10004:10400:10848:11026:11232:11658:11914:12043:12296:12438:12555:12740:12760:12895:13439:14093:14097:14180:14181:14659:14721:21060:21080:21451:21627:21740:30054:30070:30083:30090:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.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: note22_48520a0328609 X-Filterd-Recvd-Size: 3859 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf18.hostedemail.com (Postfix) with ESMTPA; Wed, 31 Oct 2018 16:48:16 +0000 (UTC) Message-ID: <4229ff1aa3d11cf302f6d0a4eec8e8f8f2bb919b.camel@perches.com> Subject: Re: [PATCH 3/3] kobject: fix warnings use pr_* to replace printk From: Joe Perches To: YU Bo Cc: gregkh@linuxfoundation.org, rafael@kernel.org, linux-kernel@vger.kernel.org Date: Wed, 31 Oct 2018 09:48:15 -0700 In-Reply-To: <20181031134109.7t3fy5p6uzj4tpa6@yubo-2> References: <20181031134109.7t3fy5p6uzj4tpa6@yubo-2> 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 Wed, 2018-10-31 at 09:41 -0400, YU Bo wrote: > Hi, > On Tue, Oct 30, 2018 at 08:01:50AM -0700, Joe Perches wrote: > > 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; > Sorry, but i have two stupid questions to annoy you: > Q1: If i agree with your patch, here should i to do? Acked-by tag or others or nothing to do? Send V2 with content and explanation of what it does and why. > Q2: In fact, i do not know how to test the patch. Only to cat /sys/bus/pci/* or something? That wouldn't work as these go to dmesg only on certain conditions. It's a trivial patch, obviously correct.