Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp784223imd; Thu, 1 Nov 2018 05:39:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5dBTCy1OvTn/Nixi5LnSJOeDnYmSSDEj/3Gi46emCTkXiAJHMpno7HnurkuyJbRDSYAMMlH X-Received: by 2002:a63:7f0e:: with SMTP id a14-v6mr7078136pgd.296.1541075988095; Thu, 01 Nov 2018 05:39:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541075988; cv=none; d=google.com; s=arc-20160816; b=g3XL121juyJUwOD1rLmp77fqTkgCqeVSpQKQMNd4JD+8jY1Wz+kgHdv1xLUV7XKsrk fGvaDFM54ZBgG74seYMsfANfhQkihnI0NuRqbtdek+EIzRrWU8mWmYJJakLjWYYq4LnO vJgTRRHkehmXhocZItPfk95t6/1L0bSgEb2M9hlqZl3+q+P0OCMBX5++eIPFBDG13dUh pnwxYNX68b+X7MTl1Sy0w44eR5gmxjKlKic9lS9YNUawUdjWXlFkxzJlymeMj4tD3dLO 2sBQ7o0KkCoYovGHf/VVzlIwJb13n1Y1H1G107swVWuGiNpTl/BlV/t2qoqhMv9VWMj6 /fMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=v0SeJkknGz3q/Lv9yKR6sTgb2RV0so/rhhrkkVIJNcE=; b=KdbbxIScZXq1QJnvj5oJmHiNOta68LKGxZ19mexSZ7xudaHHDuR3iq+M8QDqPVnfJc IWvvxZc3WKR0kg1BTYvYhPji2rP5A+jjkAZ782gHIvstOZBAV8BAEOOttXMH1nLpVnep mZO6GWbcJotxMc33UcaRk1h1fOdQvVo7HL8xHYT1kV5p8gkVrwvVJvJ/YMGKfdgga+7p vKhtG/tJLsc6Sfdi7qLGlW5ZixkaF2r82TbuD0UG8WsidaRPROzu+fmNyIZaxWv9jwma JZVti5pkxfOHQS7YScsUP/C9cPCSK2WGg+a/ZQiC5N86OjgxMvfoZGuMQasrAy15CWZj tqiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H1NAz7nr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e4-v6si30794832pls.214.2018.11.01.05.39.30; Thu, 01 Nov 2018 05:39: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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H1NAz7nr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728076AbeKAU0q (ORCPT + 99 others); Thu, 1 Nov 2018 16:26:46 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42456 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727644AbeKAU0p (ORCPT ); Thu, 1 Nov 2018 16:26:45 -0400 Received: by mail-pg1-f193.google.com with SMTP id i4-v6so8892388pgq.9 for ; Thu, 01 Nov 2018 04:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=v0SeJkknGz3q/Lv9yKR6sTgb2RV0so/rhhrkkVIJNcE=; b=H1NAz7nrGafM3wfSSz/dtqf/u/IhVVsaX06OnRXk9b+Z/bkiL+jk5cYMk342TGwJod bbmRuKPE1hJO6sZeyGv16tOdbQ62u6p3D2o2F6u2OxtV44nQYVWij9fBpdFSc7dNiZTC 1DZ9hheUOmjQD5BZvJKcNDqZJ2dvK108Mtmy7GnjKm1DD7Lje9VUZc0FMBwoBkW6MX3O cRpWTuw9x/Ipy8T7dn16QDX9c1E4As9D7umjhOQQfG367jlY/ZG8mUZrmEFHhMcL4XRM rtcRqvWZ7xZqwVax4C7KKZZY5iKlGEy+NCXWg/+AevElXKCRIrKa2cQxGW56ddYTYktu NIGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=v0SeJkknGz3q/Lv9yKR6sTgb2RV0so/rhhrkkVIJNcE=; b=G/T4tvh3UJVdPFB51hEYz0vl8RWhjow3XaAJBMPuP5vGF27DMQ8rLLCVrxvFoyCAs3 Pu372dm+PZMkLouiYvoggSRRoelHd76EujE0yK43A0KNrHqFCHco0VlDYQvSBWuOPilT MZHQ0HNu0ijPuboJEIre5kwVULCCVjmltddv5lFR2/agdw+IQ9uFTFhUguqH3xL5XeBo lU5+U2Iq/pIQMzhADKTrZjFKYnHC81/wOX5i0t9uPu3d4hDShP3w5rSjet65M2AZ5X+T 1GAZpV22bLIYkHvVTcgOHmvp2L5M56/zPFAhWtwqCFP7R4Od81NH/J+efhCIis/Kwm6F Qt/w== X-Gm-Message-State: AGRZ1gJMtfS6mstBpv7lBxU3R81x2gHzsahIL74vWpkxPWItVI/OG8lD 1EULi69wBKCQQXdwP8Zg5SM= X-Received: by 2002:a63:64c:: with SMTP id 73mr6733526pgg.373.1541071453802; Thu, 01 Nov 2018 04:24:13 -0700 (PDT) Received: from yubo-2 ([191.101.9.198]) by smtp.gmail.com with ESMTPSA id l5-v6sm53174211pfl.28.2018.11.01.04.24.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Nov 2018 04:24:13 -0700 (PDT) Date: Thu, 1 Nov 2018 07:24:12 -0400 From: YU Bo To: Joe Perches Cc: gregkh@linuxfoundation.org, rafael@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] kobject: fix warnings use pr_* to replace printk Message-ID: <20181101112411.4itilpv7mruybiat@yubo-2> Mail-Followup-To: Joe Perches , gregkh@linuxfoundation.org, rafael@kernel.org, linux-kernel@vger.kernel.org References: <20181031134109.7t3fy5p6uzj4tpa6@yubo-2> <4229ff1aa3d11cf302f6d0a4eec8e8f8f2bb919b.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Disposition: inline In-Reply-To: <4229ff1aa3d11cf302f6d0a4eec8e8f8f2bb919b.camel@perches.com> User-Agent: NeoMutt/20180512-62-03f98a Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 31, 2018 at 09:48:15AM -0700, Joe Perches wrote: >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. Thank you, joe, i will do. > >