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-next>] [day] [month] [year] [list]
Date:	Fri, 26 Jul 2013 14:04:55 +0200
From:	Michael Brunner <mibru@....de>
To:	linux-kernel@...r.kernel.org
Cc:	Kevin Strasser <kevin.strasser@...ux.intel.com>,
	Kevin Strasser <strassek@...r.orst.edu>,
	Darren Hart <dvhart@...ux.intel.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	Guenter Roeck <linux@...ck-us.net>,
	Michael Brunner <Michael.Brunner@...tron.com>,
	Chris Healy <chealy@...co-us.com>,
	Dirk Hohndel <Dirk.Hohndel@...el.com>,
	Wolfram Sang <wsa@...-dreams.de>, linux-i2c@...r.kernel.org
Subject: [PATCH] i2c: Fix Kontron PLD prescaler calculation

Add some necessary braces that have been removed during driver cleanup.
This fixes the I2C prescaler calculation.

Signed-off-by: Michael Brunner <michael.brunner@...tron.com>
---
 drivers/i2c/busses/i2c-kempld.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/busses/i2c-kempld.c b/drivers/i2c/busses/i2c-kempld.c
index ccec916..af8f65f 100644
--- a/drivers/i2c/busses/i2c-kempld.c
+++ b/drivers/i2c/busses/i2c-kempld.c
@@ -246,9 +246,9 @@ static void kempld_i2c_device_init(struct kempld_i2c_data *i2c)
 		bus_frequency = KEMPLD_I2C_FREQ_MAX;
 
 	if (pld->info.spec_major == 1)
-		prescale = pld->pld_clock / bus_frequency * 5 - 1000;
+		prescale = pld->pld_clock / (bus_frequency * 5) - 1000;
 	else
-		prescale = pld->pld_clock / bus_frequency * 4 - 3000;
+		prescale = pld->pld_clock / (bus_frequency * 4) - 3000;
 
 	if (prescale < 0)
 		prescale = 0;
--
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