Message ID | 202211301547353578204@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp791610wrr; Wed, 30 Nov 2022 00:08:52 -0800 (PST) X-Google-Smtp-Source: AA0mqf5nJ5dO/4wprJV+N4HUFD+BANlqDVz7nsQCL1bir0yYTFsJDntS41ov1f56ucrC6FTWoqxW X-Received: by 2002:a05:6402:528f:b0:461:9cbd:8fba with SMTP id en15-20020a056402528f00b004619cbd8fbamr31406290edb.19.1669795731852; Wed, 30 Nov 2022 00:08:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669795731; cv=none; d=google.com; s=arc-20160816; b=JwvGYT7kQCPGf/nBa+hJyVBHqVJk5IH8kZPZQANdJ1H1MoSCAQS+D9vGZP46PhGTc9 xsENhZUdscesI3oTlXu9vieEks7BHMfs5Y46mdAlKh+RHuURSqo9nW35ARRLq2DPu6sQ YPp/kQI9qAPm8z/BLKGt40taI3DCizwiDTMuzo9+vLpTP+zsUJ2ULRJMCiKM8mO0G9bq Ar4DMhOkjNJT4F4I2LzHFVsQKVDwJIYrp7PC03zAxDyI5zg+dRyAZ2RHRHh14B6UYlUI K3CUHxAMSuTk5/VSvUA+7K9gm3IHbIN9fhVjZHA7n7AMbVtQ6rviJT2cvyszOIB3STP7 0UxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=jBCch5XE9nzWYuzdqDqyNJoakl9Sk7DJm2D/l4PPZ68=; b=biJ7UABEAgkG8w/o5DbfHbasCPncMUapxBiZJfkgiQse0QUbo/wVwnK2wzg+VhgBks RDgYJZDuLsKsF94+eMnvVJGN3RdfNEg9buDvjONk96n+OX+zhYEWd9OAii5E4jIqDttl zpkCxspZLU5w7zYereik6PVXb4dYxyPesaC3HkV4S+LP5nTHyd+Ghs89j6qtcfdRS9Lh na1uMV3/Pm6gJ2mIfNyLjLNbmGkt7sq14sZfFNT4E0AlWsrspX86meOHISlqZvP4peAG sP8/gz3q9miVxi2JjKd3q3rzQZw/4s1/lW5/0i3cTK9trE50j3k1TzbUN1lRLHUmNgGz gX8Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y22-20020aa7d516000000b00461237816efsi716760edq.120.2022.11.30.00.08.28; Wed, 30 Nov 2022 00:08:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233449AbiK3Hru (ORCPT <rfc822;heyuhang3455@gmail.com> + 99 others); Wed, 30 Nov 2022 02:47:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232267AbiK3Hrs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 30 Nov 2022 02:47:48 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39EFC29C88 for <linux-kernel@vger.kernel.org>; Tue, 29 Nov 2022 23:47:47 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NMWX16KH7z4xVnf; Wed, 30 Nov 2022 15:47:45 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AU7lXpD096474; Wed, 30 Nov 2022 15:47:33 +0800 (+08) (envelope-from zhang.songyi@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Wed, 30 Nov 2022 15:47:35 +0800 (CST) Date: Wed, 30 Nov 2022 15:47:35 +0800 (CST) X-Zmail-TransId: 2af963870a97ffffffffe135a4fe X-Mailer: Zmail v1.0 Message-ID: <202211301547353578204@zte.com.cn> Mime-Version: 1.0 From: <zhang.songyi@zte.com.cn> To: <zhangqing@loongson.cn> Cc: <chenhuacai@kernel.org>, <rostedt@goodmis.org>, <linux-kernel@vger.kernel.org>, <zhang.songyi@zte.com.cn> Subject: =?utf-8?q?=5BPATCH_linux-next=5D_recordmcount=3A_use_=22!P=22_inste?= =?utf-8?q?ad_of_=22P_=3D=3D_0=22?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AU7lXpD096474 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 63870AA1.000 by FangMail milter! X-FangMail-Envelope: 1669794465/4NMWX16KH7z4xVnf/63870AA1.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/<zhang.songyi@zte.com.cn> X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63870AA1.000/4NMWX16KH7z4xVnf X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750907729357772341?= X-GMAIL-MSGID: =?utf-8?q?1750907729357772341?= |
Series |
[linux-next] recordmcount: use "!P" instead of "P == 0"
|
|
Commit Message
zhang.songyi@zte.com.cn
Nov. 30, 2022, 7:47 a.m. UTC
From: zhang songyi <zhang.songyi@zte.com.cn> comparing pointer to 0, use !P instead of it. Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn> --- scripts/recordmcount.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.2
Comments
On Wed, 30 Nov 2022 15:47:35 +0800 (CST) <zhang.songyi@zte.com.cn> wrote: > From: zhang songyi <zhang.songyi@zte.com.cn> > > comparing pointer to 0, use !P instead of it. Both are correct. No need for useless churn like this. -- Steve > > Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn> > --- > scripts/recordmcount.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c > index cce12e1971d8..8d01decd12e9 100644 > --- a/scripts/recordmcount.c > +++ b/scripts/recordmcount.c > @@ -139,7 +139,7 @@ static ssize_t uwrite(void const *const buf, size_t const count) > static void * umalloc(size_t size) > { > void *const addr = malloc(size); > - if (addr == 0) { > + if (!addr) { > fprintf(stderr, "malloc failed: %zu bytes\n", size); > file_append_cleanup(); > mmap_cleanup(); > -- > 2.15.2
diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c index cce12e1971d8..8d01decd12e9 100644 --- a/scripts/recordmcount.c +++ b/scripts/recordmcount.c @@ -139,7 +139,7 @@ static ssize_t uwrite(void const *const buf, size_t const count) static void * umalloc(size_t size) { void *const addr = malloc(size); - if (addr == 0) { + if (!addr) { fprintf(stderr, "malloc failed: %zu bytes\n", size); file_append_cleanup(); mmap_cleanup();