Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp540426rwb; Sun, 6 Nov 2022 09:36:16 -0800 (PST) X-Google-Smtp-Source: AMsMyM4KD0hkl9x0YxD1qlm3sZPZAir+f9LyWDMrCXy7xIhBSyKeJ6gGJe7Fl9TTp6Sc/dSKZ+Bk X-Received: by 2002:a05:6402:298b:b0:44f:20a:2db2 with SMTP id eq11-20020a056402298b00b0044f020a2db2mr46311103edb.138.1667756176561; Sun, 06 Nov 2022 09:36:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667756176; cv=none; d=google.com; s=arc-20160816; b=IvwkA/3OCMAaBYo8Pxi28MioomUmjCEyeV7zsoqeyx23ymC7hQ9xAtxnUb7olyI1jI wzl/TaDOKN/gVWOFjO6esaA5mt4Hbq+KM5cH66gR3G6QWwNANXbq4l13jIX/9/0sp0DC khyeodB7in8Z3S6/aBsXfPvTVc8JEA4n4GOAkwFKQSWnSZu3oXctK5TJOg0YWsxIz9dg AnW9Ln0tmPVVJbaHw6nFaYRt8arhViWP9HZe3cCW3MuZqFI2aNd1DfY+pZq74ErDO/2H ofhGNZipo4BjEd4ror2R70kCuNld6SgwbW3dCm4j/Ro7f/kFL8YTdsc9n3u2NLpBLZM1 KA6Q== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=z181q4z6jlyaLz0cP8niS7uDoKiPhQHwT/pkbmPsQs0=; b=OYcPCE0KjaKSXuM6u4waZMGM3skjCW5+RGmCAsV23/j7FpJQ0m7oteL8o2ENcr3pKu fJCEouLbxe5GfIDeFXEQDKoBJ27t68daB18ScGWVIpUTGSaOrl/4XfN80bJ97Rh7WHIV ukDGVEarOE6xYDmLsU4pzH3gnOu2uBjYXQ20Ls5VLyr5E9I6aEOijhx9tGi3laI9NA/U paizdOFae3eqVdf0Ti1coliReqw28ZKYUMPT2PQrLlmMcIpLW6hv/picEFQDz5elAfmK zSHXjvGEdxx14oa9/XzyfNHQ9450sUFh8L+MZNfuWrkX5RQZ2fdPsYCSomuzwiVlGF7k tY4g== 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 nd19-20020a170907629300b0078db6f56d51si6852550ejc.808.2022.11.06.09.35.54; Sun, 06 Nov 2022 09:36:16 -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 S230132AbiKFQND (ORCPT + 96 others); Sun, 6 Nov 2022 11:13:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53622 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229841AbiKFQNC (ORCPT ); Sun, 6 Nov 2022 11:13:02 -0500 Received: from smtp.smtpout.orange.fr (smtp-17.smtpout.orange.fr [80.12.242.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61D9E38A0 for ; Sun, 6 Nov 2022 08:13:01 -0800 (PST) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id riGKoGCAyXaJmriGKor48n; Sun, 06 Nov 2022 17:12:59 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 06 Nov 2022 17:12:59 +0100 X-ME-IP: 86.243.100.34 Message-ID: <7924fc05-02d7-a2b3-85e3-d30dfe081da3@wanadoo.fr> Date: Sun, 6 Nov 2022 17:12:44 +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] macintosh/adb: Fix warning comparing pointer to 0 Content-Language: fr To: wangkailong@jari.cn, benh@kernel.crashing.org, mpe@ellerman.id.au, gregkh@linuxfoundation.org, sohu0106@126.com, christophe.leroy@csgroup.eu Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <2ef267c.c4.1844d8ef2d8.Coremail.wangkailong@jari.cn> From: Christophe JAILLET In-Reply-To: <2ef267c.c4.1844d8ef2d8.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,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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:28, wangkailong@jari.cn a écrit : > Fix the following coccicheck warning: > > drivers/macintosh/adb.c:676:14-15: WARNING comparing pointer to 0. > > Signed-off-by: KaiLong Wang > --- > drivers/macintosh/adb.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/macintosh/adb.c b/drivers/macintosh/adb.c > index 1bbb9ca08d40..076253599bd4 100644 > --- a/drivers/macintosh/adb.c > +++ b/drivers/macintosh/adb.c > @@ -673,7 +673,7 @@ static int adb_open(struct inode *inode, struct file *file) > goto out; > } > state = kmalloc(sizeof(struct adbdev_state), GFP_KERNEL); > - if (state == 0) { > + if (state) { Hi no, this should be "if (!state)" CJ > ret = -ENOMEM; > goto out; > }