Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp481231rwb; Sun, 6 Nov 2022 08:46:42 -0800 (PST) X-Google-Smtp-Source: AMsMyM5kHbEitbELgfVcBFUVtNVY/Tu4L9vRxiZ9HxQ5DfOB3EOOlWmUddIqjHxuYsdvKSYZTawO X-Received: by 2002:a17:906:3054:b0:7ad:e82b:ac23 with SMTP id d20-20020a170906305400b007ade82bac23mr30808173ejd.235.1667753202396; Sun, 06 Nov 2022 08:46:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667753202; cv=none; d=google.com; s=arc-20160816; b=oCwtWdhFp/grFXFj11MpgHgzR0ReFIboE6XZek2MdUnemXobr7BEWpFPbiX2eMg9iq KztxjlNz+IvMRitE0b6KS739EWJ3yuRdZ6d/foTthRQsHnt1wUhhk8JmEAdNmQxPUf4e Tsv7GSlH6DcRaO3dyceiw748uIzBN5wjuOdmf5rM+wAMQqJ/2iITLAywJby8ONLiV8DK o0i0zvmJ7dwFQTcP4M4X7j1AH+kxFbRRlbkqXA+80DLTlMII2JUMWna41UukTrWk2Vsp egUtmcw0pGSmctZpj77F5kVgIZfj0V3ZzacGDuTETJgdYGC/ULiATi6qPGkuP1T2Wu0Y Swrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id; bh=GNxnbUQt8u/LkY23tJftLp/VWog7CcUMI9BaeBmu6Bk=; b=Ucl6XPfWKodoaI7JirGI7qRcU/xPR5pdG+Z7pYZbcufh/Sqj6lAeaEFLpVm5SLklJo JoPf3Gu0skWiwZSx+dR7g6QlNdpawhpZd7BPHnfIKcnvl1Y1fY40afZ3BjK8tq30B0Hh lp9iZfWtaaEr+G5r3DTD2ZDy4b6kF0flB+gZYA8ix0SSQeRjWSbCeRoYDUxNG/Wqvh3F GPS/4z378IEuas0J12jmykhflelfa6u49o6yTqFV8uIFkp9p0SQQLJQ4scZKHlToLRyO 0bkjfJ+EvX2txwImGCb4gabo5vwW1unKadg659MQk6cXoPou3ozE4ho4Jn6pQgUebElo Wp4w== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa44-20020a17090786ac00b0078b6559a610si6737409ejc.12.2022.11.06.08.46.18; Sun, 06 Nov 2022 08:46:42 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230084AbiKFP43 (ORCPT + 97 others); Sun, 6 Nov 2022 10:56:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229952AbiKFP42 (ORCPT ); Sun, 6 Nov 2022 10:56:28 -0500 Received: from smtp.smtpout.orange.fr (smtp-25.smtpout.orange.fr [80.12.242.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3DC3DFAB for ; Sun, 6 Nov 2022 07:56:27 -0800 (PST) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id ri0QodMHhvd84ri0QoTlm3; Sun, 06 Nov 2022 16:56:26 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 06 Nov 2022 16:56:26 +0100 X-ME-IP: 86.243.100.34 Message-ID: Date: Sun, 6 Nov 2022 16:56:18 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH] recordmcount: Fix warning comparing pointer to 0 Content-Language: fr To: wangkailong@jari.cn, linux-kernel@vger.kernel.org References: <10ee62bd.c2.1844d7ee28a.Coremail.wangkailong@jari.cn> From: Christophe JAILLET In-Reply-To: <10ee62bd.c2.1844d7ee28a.Coremail.wangkailong@jari.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org Le 06/11/2022 à 16:11, wangkailong@jari.cn a écrit : > Fix the following coccicheck warning: > > scripts/recordmcount.c:142:13-14: WARNING comparing pointer to 0. > > Signed-off-by: KaiLong Wang > --- > scripts/recordmcount.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/scripts/recordmcount.c b/scripts/recordmcount.c > index cce12e1971d8..750f5196608c 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) { Hi, this change looks incorrect. if (!addr) maybe? CJ > fprintf(stderr, "malloc failed: %zu bytes\n", size); > file_append_cleanup(); > mmap_cleanup();