public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Chase Southwood <chase.southwood@yahoo.com>
Cc: gregkh@linuxfoundation.org, devel@driverdev.osuosl.org,
	abbotti@mev.co.uk, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] staging: comedi: s626: use comedi_timeout() on remaining loops
Date: Thu, 3 Apr 2014 11:38:04 +0300	[thread overview]
Message-ID: <20140403083804.GB6991@mwanda> (raw)
In-Reply-To: <1395805438-12259-1-git-send-email-chase.southwood@yahoo.com>

On Tue, Mar 25, 2014 at 10:43:58PM -0500, Chase Southwood wrote:
> There were just a handful of more while loops in this file that needed
> timeouts, and this patch takes care of them.  One new callback is
> introduced, and all of the proper comedi_timeout() calls are then used.
> 
> Signed-off-by: Chase Southwood <chase.southwood@yahoo.com>
> ---
> 2: s626_i2c_handshake_eoc() can be used in s626_initialize() as noted by
> Ian.  So, s626_initialize_eoc() has been removed, and its uses swapped
> for s626_i2c_handshake_eoc().
> 
>  drivers/staging/comedi/drivers/s626.c | 34 ++++++++++++++++++++++++++--------
>  1 file changed, 26 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/s626.c b/drivers/staging/comedi/drivers/s626.c
> index 95fadf3..865cf93 100644
> --- a/drivers/staging/comedi/drivers/s626.c
> +++ b/drivers/staging/comedi/drivers/s626.c
> @@ -295,10 +295,24 @@ static void s626_debi_replace(struct comedi_device *dev, unsigned int addr,
>  
>  /* **************  EEPROM ACCESS FUNCTIONS  ************** */
>  
> +static int s626_i2c_handshake_eoc(struct comedi_device *dev,
> +				 struct comedi_subdevice *s,
> +				 struct comedi_insn *insn,
> +				 unsigned long context)
> +{
> +	unsigned int status;

This should probably be bool.

> +
> +	status = s626_mc_test(dev, S626_MC2_UPLD_IIC, S626_P_MC2);
> +	if (status)
> +		return 0;
> +	return -EBUSY;
> +}
> +
>  static uint32_t s626_i2c_handshake(struct comedi_device *dev, uint32_t val)
>  {
>  	struct s626_private *devpriv = dev->private;
>  	unsigned int ctrl;
> +	uint32_t ret;

This should be int.  I get really suspicious when people start using
uint32_t types.  Why does it have to be 32 bits?  Unsigned is wrong as
well.

regards,
dan carpenter


  parent reply	other threads:[~2014-04-03  8:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25  5:09 [PATCH] staging: comedi: s626: use comedi_timeout() on remaining loops Chase Southwood
2014-03-25 12:11 ` Ian Abbott
2014-03-26  1:54   ` Chase Southwood
2014-03-26  3:43 ` [PATCH v2] " Chase Southwood
2014-03-26 10:01   ` Ian Abbott
2014-04-03  8:38   ` Dan Carpenter [this message]
2014-04-03 22:05     ` Chase Southwood
2014-04-03 23:43 ` [PATCH v3] " Chase Southwood
2014-04-04 10:03   ` Ian Abbott

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=20140403083804.GB6991@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=abbotti@mev.co.uk \
    --cc=chase.southwood@yahoo.com \
    --cc=devel@driverdev.osuosl.org \
    --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