Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751325AbaLOVYd (ORCPT ); Mon, 15 Dec 2014 16:24:33 -0500 Received: from filtteri1.pp.htv.fi ([213.243.153.184]:47392 "EHLO filtteri1.pp.htv.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbaLOVYa (ORCPT ); Mon, 15 Dec 2014 16:24:30 -0500 Date: Mon, 15 Dec 2014 23:24:22 +0200 From: Aaro Koskinen To: Aleksey Makarov Cc: linux-mips@linux-mips.org, linux-kernel@vger.kernel.org, David Daney , Aleksey Makarov , Ralf Baechle Subject: Re: [PATCH 14/14] MIPS: OCTEON: Handle OCTEON III in csrc-octeon. Message-ID: <20141215212422.GD10323@fuloong-minipc.musicnaut.iki.fi> References: <1418666603-15159-1-git-send-email-aleksey.makarov@auriga.com> <1418666603-15159-15-git-send-email-aleksey.makarov@auriga.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1418666603-15159-15-git-send-email-aleksey.makarov@auriga.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 Hi, On Mon, Dec 15, 2014 at 09:03:20PM +0300, Aleksey Makarov wrote: > if (current_cpu_type() == CPU_CAVIUM_OCTEON2) { > union cvmx_mio_rst_boot rst_boot; > + > rst_boot.u64 = cvmx_read_csr(CVMX_MIO_RST_BOOT); > rdiv = rst_boot.s.c_mul; /* CPU clock */ > sdiv = rst_boot.s.pnr_mul; /* I/O clock */ > f = (0x8000000000000000ull / sdiv) * 2; > + } else if (current_cpu_type() == CPU_CAVIUM_OCTEON3) { > + union cvmx_rst_boot rst_boot; > + > + rst_boot.u64 = cvmx_read_csr(CVMX_RST_BOOT); > + rdiv = rst_boot.s.c_mul; /* CPU clock */ > + sdiv = rst_boot.s.pnr_mul; /* I/O clock */ > + f = (0x8000000000000000ull / sdiv) * 2; > } The f = ... part could be moved outside the if blocks to avoid copy paste. A. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/