Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964828AbcK3KTQ (ORCPT ); Wed, 30 Nov 2016 05:19:16 -0500 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35657 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753106AbcK3KTJ (ORCPT ); Wed, 30 Nov 2016 05:19:09 -0500 Date: Wed, 30 Nov 2016 11:19:03 +0100 From: Richard Cochran To: Grygorii Strashko Cc: "David S. Miller" , netdev@vger.kernel.org, Mugunthan V N , Sekhar Nori , linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, Rob Herring , devicetree@vger.kernel.org, Murali Karicheri , Wingman Kwok Subject: Re: [PATCH 3/6] net: ethernet: ti: cpts: add support of cpts HW_TS_PUSH Message-ID: <20161130101903.GE28680@localhost.localdomain> References: <20161128230428.6872-1-grygorii.strashko@ti.com> <20161128230428.6872-4-grygorii.strashko@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161128230428.6872-4-grygorii.strashko@ti.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 49 On Mon, Nov 28, 2016 at 05:04:25PM -0600, Grygorii Strashko wrote: > +/* HW TS */ > +static int cpts_extts_enable(struct cpts *cpts, u32 index, int on) > +{ > + unsigned long flags; > + u32 v; > + > + if (index >= cpts->info.n_ext_ts) > + return -ENXIO; > + > + if (((cpts->hw_ts_enable & BIT(index)) >> index) == on) > + return 0; > + > + spin_lock_irqsave(&cpts->lock, flags); > + > + v = cpts_read32(cpts, control); > + if (on) { > + v |= BIT(8 + index); > + cpts->hw_ts_enable |= BIT(index); > + } else { > + v &= ~BIT(8 + index); > + cpts->hw_ts_enable &= ~BIT(index); > + } > + cpts_write32(cpts, v, control); > + > + spin_unlock_irqrestore(&cpts->lock, flags); > + > + if (cpts->hw_ts_enable) > + /* poll for events faster - evry 200 ms */ every > + cpts->ov_check_period = > + msecs_to_jiffies(CPTS_EVENT_HWSTAMP_TIMEOUT); Bad indentation. Use braces {} to contain the comment and assignment statement. > + else > + cpts->ov_check_period = cpts->ov_check_period_slow; > + > + mod_delayed_work(system_wq, &cpts->overflow_work, > + cpts->ov_check_period); > + > + return 0; > +} Thanks, Richard