Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2633633ybm; Thu, 23 May 2019 21:55:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqzktNAzm7+qK7+6aoe9JGVhNx8y9+MJ/oiNA/XpGHc7P1NlGvsDSxwmLtKlBMZEvzTS0UWc X-Received: by 2002:a63:d615:: with SMTP id q21mr100647824pgg.401.1558673756277; Thu, 23 May 2019 21:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558673756; cv=none; d=google.com; s=arc-20160816; b=ZwDZlPAenQFs+pwv46Lmi5PBXhkMRjmJ96YskK/QF1/fqsUfUJ56b96ylIiPrE2wGX VsBDON13qSjbpULtQ5qFaQbs35x0WtfZj0eyxBGiU3xY8hSSrEWyBA52rS3VsYqvG+uI 07p1rAoss+Fj1Klm6bQd72VBBfBw0mLzhEnPI6BIUyir8mLkfdHQnZI57IpNllpFnv1A hHdmuplJ1jgG/KWnx2NGTAqdqqYEcyxSCdkSa52onMuxQ2vtKYQ2fWVO2e8Rk5UILlcn TovcEkCkmNG8aBGm7YQUHOIago0LHvLpv8pV6nB8RfvxAGWmRpvUfV4xL0Q8n4ZUpGEC Sj1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=V20z0KsB9cueisqTKMsu9xWIxFvhrK8pRRyFM+6kcXg=; b=O0dOrkGYJqxh9yySo4WsJgngPBcqgWdF30GbqtvSeAszH41TMDO2w97zrvjCyyiIUh J4kHPDCPVLNLoqM5iOMBYi5JNKKzrt/q7UkyGSuect4Zn4feNLYC0R8PvhNRXD4oCrBi LOV+lUf4/DpYgwNc/pClX2Q3n8V64cTPMy4CgT3Fi/zvU+wQeO59zJUXAH5midkA4atL XaL3DE7nBqxF4IQPLIQgltNHZK2xUc5cd9ZWjOfw80jOdUwc41dRgsK5Tf8YxwZNTOP7 nwrU+G5aGwBUb5Ovp1GUA2Vun3HZLX4N0odE+3IwO24yNeoZswjcW9ZXAA5UoXI9Iq/q i9ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=KUQBIAgj; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w64si2773148pgd.363.2019.05.23.21.55.36; Thu, 23 May 2019 21:55:56 -0700 (PDT) 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; dkim=pass header.i=@sifive.com header.s=google header.b=KUQBIAgj; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731824AbfEXEwr (ORCPT + 99 others); Fri, 24 May 2019 00:52:47 -0400 Received: from mail-lj1-f195.google.com ([209.85.208.195]:45972 "EHLO mail-lj1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731773AbfEXEwq (ORCPT ); Fri, 24 May 2019 00:52:46 -0400 Received: by mail-lj1-f195.google.com with SMTP id r76so1988376lja.12 for ; Thu, 23 May 2019 21:52:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=V20z0KsB9cueisqTKMsu9xWIxFvhrK8pRRyFM+6kcXg=; b=KUQBIAgjJy54O12HR/RuHSSIcavrDhN4oFMJxSyw1H5om5949xmqcpUMUM0aXJU4EK xXbGmF35qNp/8LxI91Qi6twy/cbPli9PqZPhLNpqh6as/vgnhChBwNHqEGDRYpOcbYoK FvlTy715Wme6Rct1Jg947fwAsiaxvQ48DjpEmvR3hwtc5YFIjXe5ZdUv5E9VTq8RljSQ vWydQb9aZ3ZnUrGShFzntaJBuebxU1w37/f/1Zxz66M4E6Oo03cx7S+4naQAsfS+IXi0 fRydRh3q7XKlnkp3bbjOUT9qC5pftTrdTVDlNPOiLcoVw1KV8MVk1PRDyp8eskBxRdB/ 0+mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=V20z0KsB9cueisqTKMsu9xWIxFvhrK8pRRyFM+6kcXg=; b=aHpbiEmdZi+ikJXTpp18IfnYkT6bPwDz+Z+tLrPjixcbVEmA6Ci66A6kct5pCw+pfe IpF4EojG6UM/rCZZXBH0yBWF0e0Bzp7Sb6xHeQyCjuH5YDdyx4NwURLZIhToe6fquUZ7 qRrR5qgZbV9i1D7/oaXNeUCHEkloFu5OQEde5BUPDmKba4mzT2fCZQlED+Pg+LUDoPLh ZtaMTwUXVxRwX0nv8s/bSXS5p0n9Z/xDgyvaFmbjP9WkKDdKmaN1jA6lENx1bXeyJreV xxjpWnQQRpFoNbJHgs65yJygQaL2MutppjPc8U3eNgWcik2iyLdhK4Vbe4LWb+Kg/0tq mhGA== X-Gm-Message-State: APjAAAVoCpi25v3PVRsRdSfkECQ79A5yQT7uj3xDSwluWlDolzUqvfuN p8OcgUApQmIbiGhDsLVe4hO4H7I7UlYsHnLupb4rrg== X-Received: by 2002:a2e:9ad1:: with SMTP id p17mr16405025ljj.147.1558673563302; Thu, 23 May 2019 21:52:43 -0700 (PDT) MIME-Version: 1.0 References: <1558611952-13295-1-git-send-email-yash.shah@sifive.com> <1558611952-13295-3-git-send-email-yash.shah@sifive.com> <20190523145417.GD19369@lunn.ch> In-Reply-To: <20190523145417.GD19369@lunn.ch> From: Yash Shah Date: Fri, 24 May 2019 10:22:06 +0530 Message-ID: Subject: Re: [PATCH 2/2] net: macb: Add support for SiFive FU540-C000 To: Andrew Lunn Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, aou@eecs.berkeley.edu, netdev@vger.kernel.org, Palmer Dabbelt , linux-kernel@vger.kernel.org, nicolas.ferre@microchip.com, Sachin Ghadi , robh+dt@kernel.org, Paul Walmsley , ynezz@true.cz, linux-riscv@lists.infradead.org, davem@davemloft.net Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 23, 2019 at 8:24 PM Andrew Lunn wrote: > > > +static int fu540_macb_tx_set_rate(struct clk_hw *hw, unsigned long rate, > > + unsigned long parent_rate) > > +{ > > + rate = fu540_macb_tx_round_rate(hw, rate, &parent_rate); > > + iowrite32(rate != 125000000, mgmt->reg); > > That looks odd. Writing the result of a comparison to a register? The idea was to write "1" to the register if the value of rate is anything else than 125000000. To make it easier to read, I will change this to below: - iowrite32(rate != 125000000, mgmt->reg); + if (rate != 125000000) + iowrite32(1, mgmt->reg); + else + iowrite32(0, mgmt->reg); Hope that's fine. Thanks for your comment - Yash > > Andrew > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv