Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1546757imu; Mon, 5 Nov 2018 23:51:31 -0800 (PST) X-Google-Smtp-Source: AJdET5fyurVpqG7zJdnK8SyH/qGZzK9LvDN8ndAEaPDDVSssELnufPQhrmSIFlny1gbMxulDYGNA X-Received: by 2002:a17:902:d696:: with SMTP id v22-v6mr25045555ply.261.1541490691872; Mon, 05 Nov 2018 23:51:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541490691; cv=none; d=google.com; s=arc-20160816; b=LLqIXNYizrg6bRJ1qnmSzy9iLNfYMNs/OrlaNa3Jb0Pb3f7EbJ8N/cCal8oopV49j5 CgfARjW1TDaa6kf9VUhFQN4WIj1XUMblfLCnShlYp0F9BGQ0sEqj7YjvyDry8ltqZCJ2 ae3REIPKeeQGh1XBYYJQy+FUe6wFhLm3aMA4JmCZZSkG/6TL4AM8RbKmvhYfzSSNw2jx D0DS72TSKhzVW5X4+h1tpR8zbVy8kutI1zcJDKwW3De3tmKxh8GEVMhU2eZGFwfujgeu /bL4GhPw2cnSZDPjZoS1Vlww37YAQb3mVIEhKsdO4nrF+Urve9HuMXv62s2tLB/0tZjW fvYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=TM4UXZCRQ2i5Im90yTxafe3arw7a7mxBy1/Au+6raP8=; b=EboX2tCYZ6NCwWdObe3pgZSGI3xOiaMRHN2tu1M7PEzdml2NB0tyhDgDskEfU+0KYn TmkMcv9Ebsn5VLCRC75vCbi6xpEd0ktsOIzTJ5rbEjKpmgV5hkeavGRxFafxylbboHGE g8UCxtyk1nvXg206M6L9h+HsrkZwKWNmgkamKEPXeLkcrFBV/3x5lrCxstSI10I4TChs 6UuOgnoiuIsFJikQe+ziNNwRqkIcsriszM7Esr0e2SXuurnIt/NdtvxlfmBGu0kR0dkV rKqFW6Ki1yi0MeCGKm9oSkogs6utluuxmbKaXUiT2M/T7cnorOHKdIFPVdK7wOMGTYs6 AayQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z9si10185393pgf.54.2018.11.05.23.51.16; Mon, 05 Nov 2018 23:51:31 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387491AbeKFRNY (ORCPT + 99 others); Tue, 6 Nov 2018 12:13:24 -0500 Received: from mail-ot1-f65.google.com ([209.85.210.65]:33311 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729160AbeKFRNY (ORCPT ); Tue, 6 Nov 2018 12:13:24 -0500 Received: by mail-ot1-f65.google.com with SMTP id q1so10622626otk.0 for ; Mon, 05 Nov 2018 23:49:27 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TM4UXZCRQ2i5Im90yTxafe3arw7a7mxBy1/Au+6raP8=; b=n/0EBquozKcf82NynTzinRb2ylwkoHpMC9/G0B77Jprff3LzGBVYl71BaU9LJd/Opj a/6JGB9bCqeMHEeivURliOJ80pAD8RR9vVbqHxU01Z3Y59+yFADRYbTfsQ1LbeNCi/Ul 3BwmRZC190atYr5g3TPmf7bYWcWaQQUaORudDHFO41Yjtg9ZGrbPWWddblfUd6nu4WVr 97dIjBfvnGnjcLVIcyeabdwMRtcgsN4rUoeMRJlJLlkKn53aOgKUMgUG0c0ToJUq2BBI JCRJs9weEEUbS4jBOcY1s6Zg5EIvnEuhk+VhhSQ7FTZu/Nvl9urvuv/HSY9RdPkhwI0/ sAcw== X-Gm-Message-State: AGRZ1gKYPKTHecr1BjFuI4DqE8ZOTKkgM2xnD7X3kNhhpVDjqUyfuMis RAS9kbUTdILq3vfDIz+k8LLYYhBv93EL/0A/nzUEdw== X-Received: by 2002:a9d:4c84:: with SMTP id m4mr9646695otf.124.1541490567300; Mon, 05 Nov 2018 23:49:27 -0800 (PST) MIME-Version: 1.0 References: <1541472103-6212-1-git-send-email-tsu.yubo@gmail.com> In-Reply-To: <1541472103-6212-1-git-send-email-tsu.yubo@gmail.com> From: "Rafael J. Wysocki" Date: Tue, 6 Nov 2018 08:49:15 +0100 Message-ID: Subject: Re: [PATCH v2] kobject: to use pr_warn replace KERN_WARNING To: tsu.yubo@gmail.com Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Linux Kernel Mailing List , Joe Perches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 6, 2018 at 3:42 AM Bo YU wrote: > > Fix warning form checkpatch, use pr_warn replace KERN_WARNING > > Signed-off-by: Bo YU First off, IMO, you should not change the existing code just in order to make checkpatch happy about it. That alone is not a good enough reason for modifying it. If the checkpatch warning indicates an issue like broken white space (and I mean really broken and not lines longer than 80 chars etc), then that may be a reason to modify the existing code, depending. > --- > changes in v2: > According to Joe's suggestion,drop newline from msg, otherwise > it can be unterminated with newline. > --- > lib/kobject_uevent.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c > index 63d0816ab23b..1837765ebf01 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"; Second, this change is not what the changelog of your patch is talking about. > goto out; > } > > @@ -223,8 +223,9 @@ 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", > + char *devpath = kobject_get_path(kobj, GFP_KERNEL); > + > + pr_warn("synth uevent: %s: %s\n", > devpath ?: "unknown device", > msg ?: "failed to send uevent"); > kfree(devpath); > -- > 2.11.0 >