Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1326874imu; Mon, 5 Nov 2018 18:45:04 -0800 (PST) X-Google-Smtp-Source: AJdET5evIF3PbLvkoBEIO+dIJaB+i0+0m+sw5bnDb6BG99MC064wgeYEIJGQN1zn2rzO8aI9mrCT X-Received: by 2002:a63:5b1f:: with SMTP id p31mr22230293pgb.56.1541472304554; Mon, 05 Nov 2018 18:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541472304; cv=none; d=google.com; s=arc-20160816; b=Kb11z7VK4cisMAc/sRuaB9miuhnrcY7nPV6QX0oeBPHebETu/PBX4lAT4+TdVIXrLc vI+GBT5IpOmRmOVSDOmyPX5LulIXSWgkLE8ukt741hKvwRh1ZckRyAn+jDzosgEzo2nK O9ZkoF01euYYRSYbXxWJAu0EQPff/10KsZ11MSdrgqotZYaV7DpPnCjIzAVasOeWb4nS PhKG0m0d6OalVCj15mgzZTd1HNwh6V4ySlCfI3rTbuIlovogfX/vP/x63O1MtNjvWeIU NLJc0//YSGdGjOi3XZF0YNbhowEC/Lhj+rGK7SdnKVIrm33Z7tS38VIy1je/DrrsGMMu ZmYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=GLAq8GY8CZsb5fB6RWVYwTg7W6cIpwgOEdXW0XhH0p8=; b=XmD3t6vGh4sDdH/iIzmBZPtEKs/QcPoKr57Akd0KkGY2P2zTaAk/+RXe1KUgtZqFjq IrjuxgnYH7Tr6QVoELdUnYyIq0cVvRm+vkkUSM/CwMe6EILsDaamEfY4jkX3wU2UwK5/ 1ne9UyDWjHcWURKA0b0oKzEC3ivx7rOkfBsKVYzq8vx3qVt5j8TewJo0ARGajLybvYdv cw3zL5hdAsk6O56/4DApQryvWyIFTVOio0DRPVkII4fXT2ufzNwdqcSAhWoo40escSm6 CA6QuJZNi1KXhESNgiSlyfaCx82yN35slgiIP23kwujH40wTv/P7JLhTKdAooUvHCJvV TrQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="N4DGJxx/"; 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 v1-v6si6769012plo.134.2018.11.05.18.44.48; Mon, 05 Nov 2018 18:45:04 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b="N4DGJxx/"; 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 S1729428AbeKFMEw (ORCPT + 99 others); Tue, 6 Nov 2018 07:04:52 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:39431 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727358AbeKFMEw (ORCPT ); Tue, 6 Nov 2018 07:04:52 -0500 Received: by mail-pl1-f194.google.com with SMTP id b5-v6so5424671pla.6 for ; Mon, 05 Nov 2018 18:42:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=GLAq8GY8CZsb5fB6RWVYwTg7W6cIpwgOEdXW0XhH0p8=; b=N4DGJxx/x+lzANEnLwpIMq1LOxYA7LAVeSHtlNIJWz8608dyTbfg4SRrcyCuqs0ONk ntlHr2YTisMJyZe3LbMCQ5qP1qzkNlD6uyEkBMT6rykPo2lsb7PEhvSou2Q7HGiGVoap /rCa3oDsdIKh4+qZ97tlhfhb+MSKMCFsT8l7CphM+5og1I2bdeLWkbyVRzJ9am9N/ap0 WUlheUL2uh8OSqvUL5GKqnCu+I+ZTMFh9JbdwB/aRx5z5iIPBXbIojcnTjIysq6/9B+S zwI79tWcbRHswX+S64tAQLC3nyP1i+bGQcUJXFgjx+S+h6dpMC19BiMHvrhhXAlI6BPA i+1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GLAq8GY8CZsb5fB6RWVYwTg7W6cIpwgOEdXW0XhH0p8=; b=jvpzdAclh+6Q0ycQqPeKZoe1ZJr1VIjvBMF5vAfFJmpeppXssPB2o4SgRxrdQ/STOo AEWDFo42/P9Ta9s2sjOZqqvvSnRfpBuFmA23Jb8SZ7sgFtRAkDEaxVhk39GFFiCI3uAE 9uP6PaEXA9F0AlV6XdO6+PaeWxSTS7iMs5hQrqMQoWr33LeMawjgpSd+DcyIqMeskTrG KlmyAcbCV2seoT+RIsSyZmvDq9CAyAqjHWLZdhirhBYH7gY733sH84FI9GT/GhDu7FMZ WrXPWHfE3FKNhA9yXFAmACs9Lvjrj9BhQXEH5EWohn/jj3pBdYiSJmpfwB+C0dJtC/0P Lmqw== X-Gm-Message-State: AGRZ1gIt6UIp3HAvxz3X1ag7WIf0ZOSQFC8sUImQSbeo9/yVE4GLAUBO M8HDpndduW1gwF6mYOrOOYM= X-Received: by 2002:a17:902:2bc5:: with SMTP id l63-v6mr24645210plb.241.1541472119788; Mon, 05 Nov 2018 18:41:59 -0800 (PST) Received: from localhost.localdomain ([191.101.9.198]) by smtp.gmail.com with ESMTPSA id f13-v6sm50520506pfa.109.2018.11.05.18.41.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 05 Nov 2018 18:41:59 -0800 (PST) From: Bo YU To: gregkh@linuxfoundation.org Cc: Bo YU , rafael@kernel.org, linux-kernel@vger.kernel.org, joe@perches.com Subject: [PATCH v2] kobject: to use pr_warn replace KERN_WARNING Date: Mon, 5 Nov 2018 21:41:43 -0500 Message-Id: <1541472103-6212-1-git-send-email-tsu.yubo@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix warning form checkpatch, use pr_warn replace KERN_WARNING Signed-off-by: Bo YU --- 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"; 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