lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <548F52B8.7030606@caviumnetworks.com>
Date:	Mon, 15 Dec 2014 13:29:28 -0800
From:	David Daney <ddaney@...iumnetworks.com>
To:	Aaro Koskinen <aaro.koskinen@....fi>
CC:	Aleksey Makarov <feumilieu@...il.com>, <linux-mips@...ux-mips.org>,
	<linux-kernel@...r.kernel.org>,
	David Daney <david.daney@...ium.com>,
	Aleksey Makarov <aleksey.makarov@...iga.com>,
	Ralf Baechle <ralf@...ux-mips.org>
Subject: Re: [PATCH 14/14] MIPS: OCTEON: Handle OCTEON III in csrc-octeon.

On 12/15/2014 01:24 PM, Aaro Koskinen wrote:
> 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.
>

No, If you look at the rest of the file, you will find that there are 
checks in the form:

   if (f != 0) ...

There is a reason that we leave f with its default value of zero in some 
of the cases.

David Daney

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ