Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp618513imn; Fri, 29 Jul 2022 18:23:14 -0700 (PDT) X-Google-Smtp-Source: AA6agR6gemqgTSIvWzUFiltI67GYfLOL/ZjupXkBZPAe78Wbwc9Vhb5cHt/eXjYxO2htBI0CVEak X-Received: by 2002:a05:6402:3206:b0:43d:4e0e:b693 with SMTP id g6-20020a056402320600b0043d4e0eb693mr787636eda.316.1659144193760; Fri, 29 Jul 2022 18:23:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659144193; cv=none; d=google.com; s=arc-20160816; b=TfyAy2tYvLWRk3gzKEonKZBTsiiwfk9QouLDRfbudlEJewO2ffqjFLyS64Wlq5GJha mW4io/UDYlGyGT+FCkLQeYa9xMVGGf3na22w/AoeIKVf46YztQD7xIBIvKvMtqOD4BIC YcxBQUvIVlwpeyoWUxAjBeopJQMljBePQcaAJfP/eQFkQofquvTUgGe/5T0Kxwv+iZZ8 CgPuXtvfXArFqAi9dEMv88Emqbg6enN2PGCpYGz5OI5Of5+PNTRyvvKXUFbziwL5FkyS PrqAFwfoNqFgXFqHlKa8nJgJQlvU5DM+1FcwZJB7F/0fYO3+XCjuMyyIHX78jrND3K2t R2xg== 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=s9FdqmDlhWH4uLRQHc4In9g2i2wrewKFaeLm3GeQV80=; b=dIlKnvSo+E/JPFKK3Cxw+Z1pEGe9FK6CEps8DXT1fChP4A4XSj9hNdHHL0Jc+XG5ES BrdYAw+zY+6Av8grrTYc/tgN/NBgGa8ZPxQ8tyy3FMCAcPV7vastKg8QWPBWa7TtkvEf AxQZFKuhCgUPr2IycNgwHdXgOBjs59nwjNkggJyicNfQJ5YQGes9GA35+FAPRUn1FsGh HSegR3EK2Dih9rbgTdwo7w7b5MFetkxCAxdVs3EMLd2sEAb3o87U8e04Ok+dz0JiMs5C W7StbrgZyNW0e7ENuMgwtuz/Oe6oAWWKf649HW/8SOKAqW1gLQOg8H/F6dvvp2VARmHN WsFA== 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 v16-20020a50d590000000b0043c45284ef9si4626235edi.562.2022.07.29.18.22.46; Fri, 29 Jul 2022 18:23: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 S230117AbiG3BUN (ORCPT + 99 others); Fri, 29 Jul 2022 21:20:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiG3BUL (ORCPT ); Fri, 29 Jul 2022 21:20:11 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5E929B61 for ; Fri, 29 Jul 2022 18:20:09 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id BE76A1E80D33; Sat, 30 Jul 2022 09:19:54 +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 jYse286_FaGi; Sat, 30 Jul 2022 09:19:52 +0800 (CST) Received: from [192.168.10.17] (unknown [183.208.208.157]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id EA4441E80D0B; Sat, 30 Jul 2022 09:19:51 +0800 (CST) Message-ID: <61a8a192-d10a-18f2-94f5-69c0902bb403@nfschina.com> Date: Sat, 30 Jul 2022 09:20:06 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH] tracing: Do PTR_ERR() after IS_ERR() Content-Language: en-US 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> <20220729125647.746379e5@rorschach.local.home> From: =?UTF-8?B?5p2O5Yqb55C8?= In-Reply-To: <20220729125647.746379e5@rorschach.local.home> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,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/7/30 00:56, Steven Rostedt 写道: > On Thu, 28 Jul 2022 08:28:08 +0800 > liqiong wrote: > >> 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. > No it does not. It adds unnecessary brackets. > > It is common in the kernel to have: > > ret = ERROR; > if (some_condition()) > goto out; > > ret = ERROR1; > if (some_other_condition()) > goto out; > > ret = ERROR2; > if (some_new_condition()) > goto out; > > ret = 0; > out: > return ret; > > And your change breaks this. > > -- Steve I got it, Thanks.