Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp151160imn; Wed, 27 Jul 2022 18:20:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vW5pNl8NwSwYHETKjs/RcEEbxyl1dxUvkNwXIuPCg+Rx3dXzOKHP3AQYtbUiY4w7w1k2Rb X-Received: by 2002:a05:6a00:b4d:b0:52a:f2cf:b0e4 with SMTP id p13-20020a056a000b4d00b0052af2cfb0e4mr24811118pfo.2.1658971213398; Wed, 27 Jul 2022 18:20:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658971213; cv=none; d=google.com; s=arc-20160816; b=FNfC8r5PUUz3uwPJ+RRDchW09ULG86XfOAceYLOvbGWdpdL2oj0KcQeYKnof5o+drv wbrwEvBvRaBDnnKJw5GeEPCL1t/UErG5zCbN/G9/D+5VcS6omheIElHWJjwrEPE7YHhS XVP26WPQv39iw+Cks9ZvwHcBqT99e3ClLlJ46BCqNNFB7opRXET5e90C9CdNs+xzBR9B cfSAZYkO8/QdTm7YpWYV+ZapxLUKa/ePkmg9FV3Fvw+nhUsrio/HJPt0qBleG3f0+SCb AmYgsPAT9Cfo4oLF7vD+s+D1N6Q6U8JEBiKWcjBPnTN6IjIM4YEqCqs8/Gr6OQcMdxFv cmtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=1WO40B+zvr3BR+7Z2TL8pi9EdyEEaxruDSSrN0PcZj0=; b=fvfU0azgc8jHe40ZcEdLO5akImln6O2vijXQkG16knzasxRhp7U4n0FMT7dsOu6sKW GNeVgzCqkhpF+zE+pDnKHBbCpsP8c/IPKVc6lVl+gF70zd/AHO8uWfmCXugJbhHqL1Tj RN3zhJd2digxaFuuYLsYBvW5NUuJyjfroq2u+P/Ngjzk9chg/EMTETk9lK0J5iOT0PLN 290z0OeDKeGg8dsFKbOCdgPnvaAR7BaPCPto2JaF89tfhKrUd+dZnD6EzGURkC7geMLg zWA9nSsEXsJCB/q+Xc4QcemW3+5hTJRLTeERmOo9q9S8N+PDA7uvlpXZn2i5FVpx4jD6 DcCQ== 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 bi4-20020a170902bf0400b0016ca4b6f18fsi19827474plb.63.2022.07.27.18.19.57; Wed, 27 Jul 2022 18:20:13 -0700 (PDT) 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 S236003AbiG1A2Q (ORCPT + 99 others); Wed, 27 Jul 2022 20:28:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbiG1A2O (ORCPT ); Wed, 27 Jul 2022 20:28:14 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5E89D51436 for ; Wed, 27 Jul 2022 17:28:13 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id 88D631E80D72; Thu, 28 Jul 2022 08:28:16 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VSybt8IYnz-4; Thu, 28 Jul 2022 08:28:14 +0800 (CST) Received: from [172.30.38.102] (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id A6EED1E80CF5; Thu, 28 Jul 2022 08:28:13 +0800 (CST) Subject: Re: [PATCH] tracing: Do PTR_ERR() after IS_ERR() To: Steven Rostedt Cc: Ingo Molnar , linux-kernel@vger.kernel.org, yuzhe@nfschina.com, renyu@nfschina.com, jiaming@nfschina.com References: <20220727153519.6697-1-liqiong@nfschina.com> <20220727122847.6b00e29d@rorschach.local.home> From: liqiong Message-ID: Date: Thu, 28 Jul 2022 08:28:08 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20220727122847.6b00e29d@rorschach.local.home> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_20,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,SPF_NONE autolearn=no 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 在 2022年07月28日 00:28, Steven Rostedt 写道: > On Wed, 27 Jul 2022 23:35:19 +0800 > Li Qiong wrote: > >> Check IS_ERR() firstly, then do PTR_ERR(). > Why? > > The code is fine as is. > > -- Steve > Hi, It's all right, assign PTR_ERR() to 'ret' anyway. But this assignment is valid only at the "IS_ERR()" path. Maybe it is better put "PTR_ERR()" at error path, keep the code clear. -- 李力琼 <13524287433> 上海市浦东新区海科路99号中科院上海高等研究院3号楼3楼