mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tomas Winkler <tomas.winkler@intel.com>
To: gregkh@linuxfoundation.org
Cc: arnd@arndb.de, linux-kernel@vger.kernel.org,
	Frode Isaksen <fisaksex@intel.com>,
	Frode Isaksen <frodex.isaksen@intel.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Subject: [char-misc-next 3/4] mei: mei_cl_connect: don't multiply the timeout twice
Date: Sun, 23 Jun 2013 09:37:01 +0300	[thread overview]
Message-ID: <1371969422-16530-3-git-send-email-tomas.winkler@intel.com> (raw)
In-Reply-To: <1371969422-16530-1-git-send-email-tomas.winkler@intel.com>

From: Frode Isaksen <fisaksex@intel.com>

MEI_CL_CONNECT_TIMEOUT is the timeout in seconds to wait
for a response in mei_cl_connect.
The value was converted to jiffies using mei_secs_to_jiffies
helper function and assigned to a local variable
which is by mistake again multiplied by HZ

Signed-off-by: Frode Isaksen <frodex.isaksen@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/mei/client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index 11a465a..21d3f5a 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -485,7 +485,6 @@ int mei_cl_connect(struct mei_cl *cl, struct file *file)
 {
 	struct mei_device *dev;
 	struct mei_cl_cb *cb;
-	long timeout = mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT);
 	int rets;
 
 	if (WARN_ON(!cl || !cl->dev))
@@ -518,7 +517,7 @@ int mei_cl_connect(struct mei_cl *cl, struct file *file)
 	rets = wait_event_timeout(dev->wait_recvd_msg,
 				 (cl->state == MEI_FILE_CONNECTED ||
 				  cl->state == MEI_FILE_DISCONNECTED),
-				 timeout * HZ);
+				 mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT));
 	mutex_lock(&dev->device_lock);
 
 	if (cl->state != MEI_FILE_CONNECTED) {
-- 
1.8.1.2


  parent reply	other threads:[~2013-06-23  6:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23  6:36 [char-misc-next 1/4 RESEND] mei: move mei_cl_irq_write_complete to client.c Tomas Winkler
2013-06-23  6:37 ` [char-misc-next 2/4] mei: do not override a client writing state when buffering Tomas Winkler
2013-06-23  6:37 ` Tomas Winkler [this message]
2013-06-23  6:37 ` [char-misc-next 4/4] mei: check if the hardware start succeeded Tomas Winkler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1371969422-16530-3-git-send-email-tomas.winkler@intel.com \
    --to=tomas.winkler@intel.com \
    --cc=arnd@arndb.de \
    --cc=fisaksex@intel.com \
    --cc=frodex.isaksen@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®