Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp635636pxb; Wed, 18 Nov 2020 13:08:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJw45is4HtKx/p0TrvTMVyGrQ17j4R1zI5FY+hQuptQI/8rHs6x91yKsZwnDbKPxMyp8ElBU X-Received: by 2002:a05:6402:6c9:: with SMTP id n9mr9013560edy.67.1605733712536; Wed, 18 Nov 2020 13:08:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605733712; cv=none; d=google.com; s=arc-20160816; b=dZj7TsnosNbM7H005qE3tl7xqge+nsIKlX8/nRSsyz5Cut8AZB6U5tHNCR9gce6yhd qYHqGNYeqcnprnwQo7bbHZgzklawGchzJ4hJmi7o5XLeUYPpGubP3R5cv51idDPrbshD fmbktBvYlz4MYHGeZVl2cz/6VVjp2MEoutZABdincFjaqfSgHnQ3i7wL2DYl2CoKa1pF xIROaN9d+8zTUW1liBB0S/w2PK7VkAx2Ycvlw2brWtQ8J6guPNJsnsbExmCUdHLTLite AUvhfQGCKYRdiR0/LAFcZa3tE7nwybS9eAT8oo6IzrChsXIInv8C8TRkpa0JimfBm0B7 mEbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=Ym1KHv2i3G3twAO6KuRQg9qxL3DOHfQwDeHpIZrGfQA=; b=pfg14SQPBi9lMBgqbzHn5SX1U0feUm8JECtmhx5fKGbTkO9TFHY524AOuZ9xtm13J3 Kx0J/Tu/+DHb7wZ/x0bzW02RWqZjL5o1ExTHojRQhbYf3h1zQg3ADgViy46qpOSuCarH SoRP0bgvrqXSxsXBrCortvyMtvMesIy2jwUosQCBPWuFGbX6N3rFHrJzOgmgnOuE+2Sp y+po92Gnq6Yiw7dS/mCzJtSCDlhdXbeX4ShujmsvFlXGOGXY92fvoXEE25A4dEtedCIx kdVWCTHyAuMyODWWOjjC/A1diWGiWm/sjxGryTauqkTYw3gKrPac1Gc9ybaKiHOMAuZG XUsw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o8si1945416edh.211.2020.11.18.13.08.07; Wed, 18 Nov 2020 13:08:32 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726820AbgKRVEA (ORCPT + 99 others); Wed, 18 Nov 2020 16:04:00 -0500 Received: from mga11.intel.com ([192.55.52.93]:6174 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726268AbgKRVEA (ORCPT ); Wed, 18 Nov 2020 16:04:00 -0500 IronPort-SDR: fyi/16dQM6yUcL6g0IraIosGok/vAxYm0qtgAW0DzslYESv5Ncximqo95f477SpzlZKZj28jea 9MBrdVqLq2KA== X-IronPort-AV: E=McAfee;i="6000,8403,9809"; a="167676673" X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="167676673" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 13:03:59 -0800 IronPort-SDR: YgJlDS1vGrzQgUrbmr30qNtGrh2aic+9Cz3O/q5JFbpDqs6OQb4tly74Q5eOND4dwPEKYpEC8x KbF/NmXfl22A== X-IronPort-AV: E=Sophos;i="5.77,488,1596524400"; d="scan'208";a="534483998" Received: from jekeller-mobl1.amr.corp.intel.com (HELO [10.212.69.244]) ([10.212.69.244]) by fmsmga005-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2020 13:03:59 -0800 Subject: Re: [PATCH net-next v2 3/3] ptp: ptp_ines: use new PTP_MSGTYPE_* define(s) To: Christian Eggers , Richard Cochran , Andrew Lunn , Heiner Kallweit , Jakub Kicinski Cc: Vladimir Oltean , Russell King , "David S . Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Kurt Kanzenbach References: <20201118162203.24293-1-ceggers@arri.de> <20201118162203.24293-4-ceggers@arri.de> From: Jacob Keller Organization: Intel Corporation Message-ID: <5809d8e0-4848-004c-1551-691cd8bfbd67@intel.com> Date: Wed, 18 Nov 2020 13:03:56 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: <20201118162203.24293-4-ceggers@arri.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/18/2020 8:22 AM, Christian Eggers wrote: > Remove driver internal defines for this. > > Signed-off-by: Christian Eggers > Cc: Richard Cochran > Cc: Kurt Kanzenbach > --- > drivers/ptp/ptp_ines.c | 19 +++++++------------ > 1 file changed, 7 insertions(+), 12 deletions(-) > > diff --git a/drivers/ptp/ptp_ines.c b/drivers/ptp/ptp_ines.c > index 4700ffbdfced..6c7c2843ba0b 100644 > --- a/drivers/ptp/ptp_ines.c > +++ b/drivers/ptp/ptp_ines.c > @@ -108,11 +108,6 @@ MODULE_LICENSE("GPL"); > #define MESSAGE_TYPE_P_DELAY_RESP 3 > #define MESSAGE_TYPE_DELAY_REQ 4 > > -#define SYNC 0x0 > -#define DELAY_REQ 0x1 > -#define PDELAY_REQ 0x2 > -#define PDELAY_RESP 0x3 > - > static LIST_HEAD(ines_clocks); > static DEFINE_MUTEX(ines_clocks_lock); > > @@ -683,9 +678,9 @@ static bool is_sync_pdelay_resp(struct sk_buff *skb, int type) > > msgtype = ptp_get_msgtype(hdr, type); > > - switch ((msgtype & 0xf)) { > - case SYNC: > - case PDELAY_RESP: > + switch (msgtype) { > + case PTP_MSGTYPE_SYNC: > + case PTP_MSGTYPE_PDELAY_RESP: This has a functional change of no longer discarding the higher bits of msgtype. While this may be correct, I think it should at least be called out as to why in the commit message. > return true; > default: > return false; > @@ -696,13 +691,13 @@ static u8 tag_to_msgtype(u8 tag) > { > switch (tag) { > case MESSAGE_TYPE_SYNC: > - return SYNC; > + return PTP_MSGTYPE_SYNC; > case MESSAGE_TYPE_P_DELAY_REQ: > - return PDELAY_REQ; > + return PTP_MSGTYPE_PDELAY_REQ; > case MESSAGE_TYPE_P_DELAY_RESP: > - return PDELAY_RESP; > + return PTP_MSGTYPE_PDELAY_RESP; > case MESSAGE_TYPE_DELAY_REQ: > - return DELAY_REQ; > + return PTP_MSGTYPE_DELAY_REQ; > } > return 0xf; > } >