Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2964662ybv; Mon, 24 Feb 2020 15:24:18 -0800 (PST) X-Google-Smtp-Source: APXvYqxydZrM3Phyg9m0g2s+jPIm0bQ9/qhIwTCFUZd+XWYRiUktNivCjzpw+hzoNFGq0b6ZYp+8 X-Received: by 2002:a9d:7548:: with SMTP id b8mr43627566otl.74.1582586658136; Mon, 24 Feb 2020 15:24:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582586658; cv=none; d=google.com; s=arc-20160816; b=QIBf1YdHIhPpk8ApVP/PgFLC9R5/xFHhGin8+U1ewZHdVwRVgo5Q0vtkX69tTvdJkx FEG/a4pg+vVYcEa9lQBQj8qOPHwpZr2b1bZT5cYe2p3zmKIYnaBH6iEswp5tnE6PBQSZ E73vuOtkYXHir4dJ4/Ttvhv3efUMLzTNhRvNw+6utzcFo1Qz5hXBflXoPPFh1sQDOSdb G7rITR8JYiW6k0XhZxLgvaJIyyi3vuS1dnhIAt5RPL3yE80za1RNQEZ93Oziu/OUiVUw OvrGEcu+4ByG2G/vmGn3kd2uGfxRAGBruXpI56o/vcAHbtVnwL2cNOeZBhaJQsM3TA3N aLAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=4upP8N60rsy7Sn57wgwCqDDcGtl8CVQxDwEBi3N0FG4=; b=JfauQjFi08dWsH5zjueZSdPeHPRG+IAPP2yezzwEU86DL7uI/3AKU3NRf3UoZUYe2P 0v6nrHM8iCs/fSFjl6J6IbjpWAm2hpmyXk83yAYCDmM50eMLK3fDbE+B8IaxhKNUD7Xi eE4kKYF5UWbIc9RjMO2GH2BdFVuOGaRPEiixLGSA28eF5Tyz50upozxJX3LP3nwtDgbl BBT89JAVZC358z3U4P2w9tDzzlwXdnmpqsEZ/qNVaCqWWD6L5TmLzKRrYJLR07DHSyJk /Qy/xOSQOyyufpjR1kEQZPJ7eb6svNIK2ARkrrqLXJkHu6OfORrlV2huoo65hy4LsVjQ rjHA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x138si5737386oif.142.2020.02.24.15.24.06; Mon, 24 Feb 2020 15:24:18 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728396AbgBXXXy (ORCPT + 99 others); Mon, 24 Feb 2020 18:23:54 -0500 Received: from mga02.intel.com ([134.134.136.20]:62441 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727081AbgBXXXy (ORCPT ); Mon, 24 Feb 2020 18:23:54 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Feb 2020 15:23:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,481,1574150400"; d="scan'208";a="237481968" Received: from wtczc53028gn.jf.intel.com (HELO skl-build) ([10.54.87.17]) by orsmga003.jf.intel.com with ESMTP; 24 Feb 2020 15:23:53 -0800 Date: Mon, 24 Feb 2020 15:23:43 -0800 From: "Christopher S. Hall" To: Richard Cochran Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, tglx@linutronix.de, hpa@zytor.com, mingo@redhat.com, x86@kernel.org, jacob.e.keller@intel.com, davem@davemloft.net, sean.v.kelley@intel.com Subject: Re: [Intel PMC TGPIO Driver 1/5] drivers/ptp: Add Enhanced handling of reserve fields Message-ID: <20200224232343.GE1508@skl-build> References: <20191211214852.26317-1-christopher.s.hall@intel.com> <20191211214852.26317-2-christopher.s.hall@intel.com> <20200203012700.GA2354@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200203012700.GA2354@localhost> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Richard, Thanks for the detailed review. On Sun, Feb 02, 2020 at 05:27:00PM -0800, Richard Cochran wrote: > On Wed, Dec 11, 2019 at 01:48:48PM -0800, christopher.s.hall@intel.com wrote: > > diff --git a/drivers/ptp/ptp_chardev.c b/drivers/ptp/ptp_chardev.c > > index 9d72ab593f13..f9ad6df57fa5 100644 > > --- a/drivers/ptp/ptp_chardev.c > > +++ b/drivers/ptp/ptp_chardev.c > > @@ -12,6 +12,7 @@ > > #include > > > > #include > > +#include > > Please group these two includes with the others, above, in > alphabetical order. OK. Done. > > #include "ptp_private.h" > > > > @@ -106,6 +107,28 @@ int ptp_open(struct posix_clock *pc, fmode_t fmode) > > return 0; > > } > > > > +/* Returns -1 if any reserved fields are non-zero */ > > +static inline int _check_rsv_field(unsigned int *field, size_t size) > > How about _check_reserved_field() instead? No problem. Sounds good. > > +{ > > + unsigned int *iter; > > Ugh, 'ptr' please. > > > + int ret = 0; > > + > > + for (iter = field; iter < field+size && ret == 0; ++iter) > > + ret = *iter == 0 ? 0 : -1; > > Please use the "early out" pattern: > > for (ptr = field; ptr < field + size; ptr++) { > if (*ptr) { > return -1; > } > } > return 0; > > Note: field + size > Note: ptr++ OK for both of these. > > + > > + return ret; > > +} > > +#define check_rsv_field(field) _check_rsv_field(field, ARRAY_SIZE(field)) > > And check_reserved_field() here. No need to abbreviate. OK. Done. > Thanks, > Richard Thanks, Chris