From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C519FC388F9 for ; Wed, 11 Nov 2020 13:24:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B03220756 for ; Wed, 11 Nov 2020 13:24:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="ZZ1ut0Cz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726817AbgKKNYh (ORCPT ); Wed, 11 Nov 2020 08:24:37 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:35576 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726227AbgKKNYh (ORCPT ); Wed, 11 Nov 2020 08:24:37 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 0ABDOKM8046731; Wed, 11 Nov 2020 07:24:20 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1605101060; bh=Q6sOgNRAnnGfgqlURmRzcwNSVvUxAcDKCR46RUyCdUA=; h=From:Subject:To:CC:References:Date:In-Reply-To; b=ZZ1ut0CzsUcaiI0VpkfEcJ9tvN+nRsv9GZUC3prAlbPw/1FluMvjqjhYVfUc1D63g NXNOYw8FwaK0xVahUsLinwa8rG5SQ3vq1uCvmv6rR6Bbql6tYjA92sDMwKRP+g4gGs ytqiU3kVz/p8zM+oM2MlLMDTZHfT39cE7XRAyv5I= Received: from DFLE108.ent.ti.com (dfle108.ent.ti.com [10.64.6.29]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 0ABDOKIc031284 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 11 Nov 2020 07:24:20 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Wed, 11 Nov 2020 07:24:20 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Wed, 11 Nov 2020 07:24:20 -0600 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 0ABDOHkQ033420; Wed, 11 Nov 2020 07:24:18 -0600 From: Grygorii Strashko Subject: Re: [PATCH V4 net-bugfixs] net/ethernet: Update ret when ptp_clock is ERROR To: Richard Cochran , Wang Qing CC: "David S. Miller" , Jakub Kicinski , Samuel Zou , Kurt Kanzenbach , Ivan Khoronzhuk , , References: <1605086686-5140-1-git-send-email-wangqing@vivo.com> <20201111123224.GB29159@hoboy.vegasvil.org> Message-ID: Date: Wed, 11 Nov 2020 15:24:33 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20201111123224.GB29159@hoboy.vegasvil.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org hi Jakub, On 11/11/2020 14:32, Richard Cochran wrote: > On Wed, Nov 11, 2020 at 05:24:41PM +0800, Wang Qing wrote: >> We always have to update the value of ret, otherwise the error value >> may be the previous one. And ptp_clock_register() never return NULL >> when PTP_1588_CLOCK enable. > > NAK. > > Your code must handle the possibility that ptp_clock_register() can > return NULL. Why? > > 1. Because that follows the documented API. > > 2. Because people will copy/paste this driver. > > 3. Because the Kconfig for your driver can change without warning. Following Richard's comments v1 of the patch has to be applied [1]. I've also added my Reviewed-by there. [1] https://lore.kernel.org/patchwork/patch/1334067/ -- Best regards, grygorii