Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp316356pxb; Wed, 11 Nov 2020 04:34:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJylVcjyhow1GPBda9ao5CppAeMPPBPuy5jAThrQ6JK34sJT0sgcyNPnXB9GW9XlCRE6dF/+ X-Received: by 2002:a17:906:f0d4:: with SMTP id dk20mr15287863ejb.180.1605098087271; Wed, 11 Nov 2020 04:34:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605098087; cv=none; d=google.com; s=arc-20160816; b=RXFQeftV+tttoMb+FlWMAp5xGl+nvPKLtWcfnHEeMJf/VTySqX/4jZWaTLCNLmFbDj omgYbXjiU9z1vDMLB5Ug8A+ZIp6UEpCZeEzXXRANlnWkTrefychGuHKi6BSAYKjO6M+U oyJIbuagyw34HCCZx2wd7WWH8yegK3MHaK8BbzJFC6JJemoTGjmO2zZ4XtJhTh2cV079 EjvsCi8QOfLzeI6dBoOSAgo3rGxWnrk9wFzoBPLw8iWFQaBuCL0+EnjVsCJT32cxVxZM VZ8YQkIcyM4l8KE0unuQiCt4GwCyhaAndChw3iW7DlJbV/fyhsShzZLPT0EjdwaDpyL4 lKcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=dTYvfnOluYKgTxdMcxZ/FPGnTnywlshfCqeGlC/4bIw=; b=wviHEa8NDlUXuvpN2DCvRg/DH7NFkwkYFCPLmmdQarKXtsfU3BmJSQbUaHdVNl0m0h uFto33R6GqKWilNY0O54YyyWp3s6y9KNmtKiBfht6VgiuGWrQyfFTizSXB0Txbud2qj6 xKw7TE1NOvPGAuipSU53VFfBbEDDR158I3bhoXknif5uFBnfVoALR7ApD21Np+FBljf5 aUyqmOpjZURrUzXx3+WRpmbSMkTurKkIPQW+/oENdnTEO/s4ZKy4IZ43RQgNiOWIy8O3 21R0jrSEsmqMRiJhVC686Fat92hI9kVGokjwhFZdkKujJjQCWX1ufQ+Y7oJOrGL7evXT 9CGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="KZeqETg/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qc4si1168925ejb.200.2020.11.11.04.34.23; Wed, 11 Nov 2020 04:34:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="KZeqETg/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726460AbgKKMcg (ORCPT + 99 others); Wed, 11 Nov 2020 07:32:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44436 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbgKKMca (ORCPT ); Wed, 11 Nov 2020 07:32:30 -0500 Received: from mail-pj1-x1042.google.com (mail-pj1-x1042.google.com [IPv6:2607:f8b0:4864:20::1042]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1A1AC0613D1; Wed, 11 Nov 2020 04:32:28 -0800 (PST) Received: by mail-pj1-x1042.google.com with SMTP id gv24so637983pjb.3; Wed, 11 Nov 2020 04:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=dTYvfnOluYKgTxdMcxZ/FPGnTnywlshfCqeGlC/4bIw=; b=KZeqETg/goR4DpzrRxll6dpNFeDbh3T5LuitxgAFLrZvLFFeP31gTZD8NEXIWIXHQR P3oRY0x9yxWloawl+5zQvfBF9b85fWqZW690DxP17o8EVj1IgcSPlfuashAT2CLAJVK5 jSwmQCTZkUfDE7NGE95Ew0eUzMF8J/oX6qp0xkaW7W0D9vsJaAbiqcwhKyibLpX4Tedt Fe3yZbDy6WmDGOe9SDZkL0UZv3jc9zBGdqC4kIRpRIV7XVFxUvFX/cwCFW0w1EsDu5Lf KzNpJV83sZ0QSd6/5n5L0aFNZbegxZX+41zaP9jtMKAu03qRQ/6fME1iaoSQ3GC6uonQ Vzwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=dTYvfnOluYKgTxdMcxZ/FPGnTnywlshfCqeGlC/4bIw=; b=t8hFEWNQS8ZR2qfTyB6JdPap+XGnFAptywjmfGm+Z8EfPRG3EZWbwFC9nSH3h4dAIS OQ1tqSq+CLxZijB8+xPXNEG64V7PzYhB0cmO8EGx5cYqj7qhxQlXrUEPDDuj/lc7BEYX 6CTgK2ZD+n+tdq3svl6q2f/NYUFDPZtPPXvnyaOpeiouTeHSo6b1MATw2DYzPERdU+cj x+IpzHbuXZBxpdTMLoQ5jSQHhH5ZyvKxSneSMMuDOdDqKEdph1QJpC41U1iQW4A+sA4U fTzFMpIO3Q14VJW+odYNq+bIIadtNGQoV9Ft4LyiIuxSKjCoNb3ZtrfBEjDktYy4vmFB 8Eyw== X-Gm-Message-State: AOAM533eOYEKb5GLNF1skDzTZtAKG6yqBaj5BFabcDogBcf/UkWNc1Fa tdlgVZCHk0dTg8rNrPNNTTxOBDTMrX8= X-Received: by 2002:a17:90b:90f:: with SMTP id bo15mr3453831pjb.80.1605097948596; Wed, 11 Nov 2020 04:32:28 -0800 (PST) Received: from hoboy.vegasvil.org (c-73-241-114-122.hsd1.ca.comcast.net. [73.241.114.122]) by smtp.gmail.com with ESMTPSA id r5sm1680554pgi.77.2020.11.11.04.32.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2020 04:32:27 -0800 (PST) Date: Wed, 11 Nov 2020 04:32:25 -0800 From: Richard Cochran To: Wang Qing Cc: "David S. Miller" , Jakub Kicinski , Grygorii Strashko , Samuel Zou , Kurt Kanzenbach , Murali Karicheri , Ivan Khoronzhuk , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH V4 net-bugfixs] net/ethernet: Update ret when ptp_clock is ERROR Message-ID: <20201111123224.GB29159@hoboy.vegasvil.org> References: <1605086686-5140-1-git-send-email-wangqing@vivo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1605086686-5140-1-git-send-email-wangqing@vivo.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks, Richard