linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] can: janz-ican3: fix type missmatch in assignment
@ 2015-02-01  8:34 Nicholas Mc Guire
  2015-02-02  9:25 ` Marc Kleine-Budde
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2015-02-01  8:34 UTC (permalink / raw)
  To: Wolfgang Grandegger
  Cc: Marc Kleine-Budde, linux-can, netdev, linux-kernel, Nicholas Mc Guire

From: Nicholas Mc Guire <der.herr@hofr.at>

return type of wait_for_completion_timeout is unsigned long not int, this
patch removes the type missmatch by moving the call into the condition.

Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>
---

The return type of wait_for_completion_timeout is unsigned long not
int. This patch resolves the type missmatch by moving the call to 
wait_for_completion_timeout into the condition. 

Patch was compile tested only for x86_64_defconfig + CONFIG_CAN=m
CONFIG_COMPILE_TEST=y, CONFIG_MFD_CS5535=m, CONFIG_OLPC=y
CONFIG_MFD_JANZ_CMODIO=m, CONFIG_CAN_JANZ_ICAN3=m

Patch is against 3.19.0-rc6 -next-20150130

 drivers/net/can/janz-ican3.c |    6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 0eb4d18..4dd183a 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1679,8 +1679,7 @@ static int ican3_get_berr_counter(const struct net_device *ndev,
 	if (ret)
 		return ret;
 
-	ret = wait_for_completion_timeout(&mod->buserror_comp, HZ);
-	if (ret == 0) {
+	if (!wait_for_completion_timeout(&mod->buserror_comp, HZ)) {
 		netdev_info(mod->ndev, "%s timed out\n", __func__);
 		return -ETIMEDOUT;
 	}
@@ -1705,8 +1704,7 @@ static ssize_t ican3_sysfs_show_term(struct device *dev,
 	if (ret)
 		return ret;
 
-	ret = wait_for_completion_timeout(&mod->termination_comp, HZ);
-	if (ret == 0) {
+	if (!wait_for_completion_timeout(&mod->termination_comp, HZ)) {
 		netdev_info(mod->ndev, "%s timed out\n", __func__);
 		return -ETIMEDOUT;
 	}
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] can: janz-ican3: fix type missmatch in assignment
  2015-02-01  8:34 [PATCH] can: janz-ican3: fix type missmatch in assignment Nicholas Mc Guire
@ 2015-02-02  9:25 ` Marc Kleine-Budde
  0 siblings, 0 replies; 2+ messages in thread
From: Marc Kleine-Budde @ 2015-02-02  9:25 UTC (permalink / raw)
  To: Nicholas Mc Guire, Wolfgang Grandegger
  Cc: linux-can, netdev, linux-kernel, Nicholas Mc Guire

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]

On 02/01/2015 09:34 AM, Nicholas Mc Guire wrote:
> From: Nicholas Mc Guire <der.herr@hofr.at>
> 
> return type of wait_for_completion_timeout is unsigned long not int, this
> patch removes the type missmatch by moving the call into the condition.
> 
> Signed-off-by: Nicholas Mc Guire <der.herr@hofr.at>

Thanks, applied to can-next.

Marc

-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-02-02  9:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-01  8:34 [PATCH] can: janz-ican3: fix type missmatch in assignment Nicholas Mc Guire
2015-02-02  9:25 ` Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).