Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp400912ybe; Wed, 4 Sep 2019 22:54:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJj3425ihqXYeS+4DIv8ASccfceMp7ON31ysqZ+DnjHYvxpHub4fRL3nm1E1JuV6VJ8hHN X-Received: by 2002:aa7:9591:: with SMTP id z17mr1713427pfj.215.1567662871095; Wed, 04 Sep 2019 22:54:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567662871; cv=none; d=google.com; s=arc-20160816; b=L+aqR6emuIyi1a6JhQG/FF0bQ/H7jla8cr7EL5Xj0sm6Kkauq7SgFs1TIoSOl1YvI2 trGzkBp6aqgszxTklkY1oWxijT9j2t081ODFy0/OE9/hzGtGZ6kzf0IkEljtj+uZXta7 NAP140KCqLCb4VbH7UO5FaX67nW7MZWG2xrsB+O9AEsiZXCoUh8KHngXOmquAOEPURQu gQo9VnCyrMK74pBQrMu5zb5tZ6cSgjK1yI4tVDmqQoWnt4vc3FaIaZvJ1Qk9gotlvAx4 stfTzuOuuQ7pUiVazgzQjjfoRk1S2UGK8NXtd9G8xEKFXvcccXe3rii8YdkGTrWP+FIA aQ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :references:subject:cc:to:mime-version:user-agent:from:date :message-id; bh=XrorGVRnbYawTixxfwdm1hPG2OE8lBQGYQYAvhLLW64=; b=MJhO88npgPf158/r473qcWeDnCbeU1+EooX1DKWevrNN20gNcePPp3vGjZN4ruOGgQ L3l2h3GfPxD/JLuFpVQPTA1NOb5gHGa4u+9YQZp3scoC4Na2VTGFExPaZ9E1qFBr9fxX Kw2MCIDnz8aUfvYtIwTDOwwrbMrLwkVNPNeR7HQvzpt8sUZrI01Yxd/RVwxEGo52oyCt u7yUyKw2h0JN0YJJyizF5Fvd0Hw4jfyLpKOpeAIskCvc5wAgn8nyBp4ngnB/c7aDXAPa 70vSIcO0csN5i2w6P8Fs1+934sD62mzfkY8pkKGepPOJEUer5Nk5sUJLhUm7OzmVQJEE QMpQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k192si871427pge.222.2019.09.04.22.54.15; Wed, 04 Sep 2019 22:54:31 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731235AbfIEFsN (ORCPT + 99 others); Thu, 5 Sep 2019 01:48:13 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:59746 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726042AbfIEFsN (ORCPT ); Thu, 5 Sep 2019 01:48:13 -0400 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 8D9BB35487A5F82F717B for ; Thu, 5 Sep 2019 13:48:11 +0800 (CST) Received: from [127.0.0.1] (10.177.29.68) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.439.0; Thu, 5 Sep 2019 13:48:07 +0800 Message-ID: <5D70A196.3020106@huawei.com> Date: Thu, 5 Sep 2019 13:48:06 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Markus Elfring CC: LKML Subject: Re: drm/amdgpu: remove the redundant null check References: <1567491305-18320-1-git-send-email-zhongjiang@huawei.com> <62b33279-9ca9-5970-5336-a8511ce54197@web.de> In-Reply-To: <62b33279-9ca9-5970-5336-a8511ce54197@web.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/9/5 1:50, Markus Elfring wrote: >> debugfs_remove and kfree has taken the null check in account. >> hence it is unnecessary to check it. Just remove the condition. > How do you think about a wording like the following? > > The functions “debugfs_remove” and “kfree” tolerate the passing > of null pointers. Hence it is unnecessary to check such arguments > around the calls. Thus remove the extra condition check at two places. > It's better, Thanks >> No functional change. > I find this information questionable while it is partly reasonable > according to the shown software refactoring. > > Can a subject like “[PATCH] drm/amdgpu: Remove two redundant > null pointer checks” be nicer here? > It's more clearer, thanks, Will repost using above description in v2. > Were any source code analysis tools involved for finding > these update candidates? With the help of Coccinelle. You can find out some example in scripts/coccinelle/. Sincerely, zhong jiang > Regards, > Markus > > . >