Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp13856313pxu; Mon, 4 Jan 2021 06:24:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxq0qdeUXsk+HRwFGSrDyoyeWZzCfPKSFXZxSYC/M0dA7qKc5g5kXjVcP3V0DHmeoMkwY9X X-Received: by 2002:a17:906:ae14:: with SMTP id le20mr68673513ejb.451.1609770272186; Mon, 04 Jan 2021 06:24:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609770272; cv=none; d=google.com; s=arc-20160816; b=t4LcV5PawEs85ts1b0LpHLaiw907YoJqo1TmM20o42O3WoVzPpvQZ4FeW8vM0DlMsq +5R0mpBsVKZtxIFX5ebJ1KIy76pP/Sp/SDU1AXut/h7aa7UsOl0Q3ZrfUnq6+BHM7bYZ uT/kdUJAS+G9zaZBk7k/tbRzYW8Wyu/34/4xpGs5kjj0lBAm0Wsz4/2cR7W5pEKJx/LW qr+KAgfpElaPh+Vghc0X6vkJ6ker3NfQGXlw7zC6UXvnFUkdOBUcwE9inZC0noEWR3Pq mzRQhc9dj2TCzbta1iInFvQojqU84KOAtBCAKuzUSQPEWYUfmxbOOkt0Cvknkj1sshBL M4Vw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=tgnQRJ6U7DDuRuCcWIJ9ljcKBZPad6QeFd5MTeyUFv4=; b=HNcU1EsNq24HOzxUurYJjq1SdHZ3oM9RlcXSyn7tdXvNUCWSM8jdP49ucpXalq79JB NISsE16y9ljVZG1FpHGYMqNF2Sa+xau8SxpqUWfN1qlFJTe7+n7DoU8kXaesNhwBQaVf 2I9zy3nntLaBUswd6Ih3AqukCVsN7eVQR+McG1Aa5MVLHw7/sUgfq6tmV7o2UWrAD/Gp 4D2muAc+cQtrZAzxMUb8xi+14rX8YINyh+OY0lmiKJIyHrU6c/aaZ4Bm8+k6+HHfedcB hiueZCSMtHdoac6uq+bw8hHwr2JArMJpstWObhA7tr6SCCJSaWiiUU2yddxjstHPemXq SuEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g1vQqJz4; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f15si31792487edq.340.2021.01.04.06.24.09; Mon, 04 Jan 2021 06:24: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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g1vQqJz4; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727306AbhADOVx (ORCPT + 99 others); Mon, 4 Jan 2021 09:21:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:45710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbhADOVx (ORCPT ); Mon, 4 Jan 2021 09:21:53 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 67E7921D93; Mon, 4 Jan 2021 14:21:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1609770073; bh=tgnQRJ6U7DDuRuCcWIJ9ljcKBZPad6QeFd5MTeyUFv4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=g1vQqJz4Cph+uXxCZ6BfMNn9AsBHzpWSHFepcf1aX4SPozzVl+HbcmhehCqBj8pbX WpzLcIbVbISKbkVzK0gC5osFLRB8LFQTt9OJ9lP3tTCjvb9Isk76/4VzAv5w1EujH4 Vj4H6A7YPToy3t3nwq+OqDPqzt8Yn6ZCbR2oqF0YHqZaMcDsnMy18gHaOlTUmwJsbK 2+r0YjKFfXJm6W3LVDJcl5L0xNYrgZteumuGYw0ZV6eyQmYYuUXRoT/t7/zUJpesOT MRCQgXwOFu9VeUNp6nrNw94NwUuxJKUEUsA+sbMIVrZQRRJ++zt2leQa+KX6aZyfi+ dYUADGE6WsWyg== Date: Mon, 4 Jan 2021 16:20:57 +0200 From: Leon Romanovsky To: Steen Hegelund Cc: Kishon Vijay Abraham I , Vinod Koul , linux-arm-kernel@lists.infradead.org, Alexandre Belloni , Lars Povlsen , Bjarni Jonasson , Microchip UNG Driver List , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Lunn Subject: Re: [PATCH v11 3/4] phy: Add Sparx5 ethernet serdes PHY driver Message-ID: <20210104142057.GL31158@unreal> References: <20210104082218.1389450-1-steen.hegelund@microchip.com> <20210104082218.1389450-4-steen.hegelund@microchip.com> <20210104121502.GK31158@unreal> <5e5332e026af5d3716cf9bb0aa404783b53f9e02.camel@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5e5332e026af5d3716cf9bb0aa404783b53f9e02.camel@microchip.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 04, 2021 at 02:16:38PM +0100, Steen Hegelund wrote: > Hi Leon, > > > On Mon, 2021-01-04 at 14:15 +0200, Leon Romanovsky wrote: > > > > <...> > > > > > +struct sparx5_sd10g28_args { > > > +???? bool???????????????? skip_cmu_cfg; /* Enable/disable CMU cfg > > > */ > > > +???? bool???????????????? no_pwrcycle;? /* Omit initial power- > > > cycle */ > > > +???? bool???????????????? txinvert;???? /* Enable inversion of > > > output data */ > > > +???? bool???????????????? rxinvert;???? /* Enable inversion of > > > input data */ > > > +???? bool???????????????? txmargin;???? /* Set output level to? > > > half/full */ > > > +???? u16????????????????? txswing;????? /* Set output level */ > > > +???? bool???????????????? mute;???????? /* Mute Output Buffer */ > > > +???? bool???????????????? is_6g; > > > +???? bool???????????????? reg_rst; > > > +}; > > > > All those bools in structs can be squeezed into one u8, just use > > bitfields, e.g. "u8 a:1;". > > Got you. > > > > > Also I strongly advise do not do vertical alignment, it will cause to > > too many churn later when this code will be updated. > > So just a single space between the type and the name and the comment is > preferable? Yes, use clang formatter over your code, it will change everything to be aligned to kernel coding style. https://linuxplumbersconf.org/event/7/contributions/803/ > > > > > > + > > > > <...> > > > > > +static inline void __iomem *sdx5_addr(void __iomem *base[], > > > +?????????????????????????????????? int id, int tinst, int tcnt, > > > +?????????????????????????????????? int gbase, int ginst, > > > +?????????????????????????????????? int gcnt, int gwidth, > > > +?????????????????????????????????? int raddr, int rinst, > > > +?????????????????????????????????? int rcnt, int rwidth) > > > +{ > > > +#if defined(CONFIG_DEBUG_KERNEL) > > > +???? WARN_ON((tinst) >= tcnt); > > > +???? WARN_ON((ginst) >= gcnt); > > > +???? WARN_ON((rinst) >= rcnt); > > > +#endif > > > > Please don't put "#if defined(CONFIG_DEBUG_KERNEL)", print WARN_ON(). > > OK, I will drop the #if and keep the WARN_ON... Thanks