linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tools: iio: iio_generic_buffer: allow infinite looping
@ 2018-06-07  8:31 Dan Carpenter
  2018-06-07 16:31 ` Martin Kelly
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2018-06-07  8:31 UTC (permalink / raw)
  To: Jonathan Cameron, Martin Kelly
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors

I think the num_loops variable was intended to be signed so that we
could set it to -1 and it would loop forever.  Right now it just loops
for a very long time.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c
index 3040830d7797..84545666a09c 100644
--- a/tools/iio/iio_generic_buffer.c
+++ b/tools/iio/iio_generic_buffer.c
@@ -330,7 +330,7 @@ static const struct option longopts[] = {
 
 int main(int argc, char **argv)
 {
-	unsigned long long num_loops = 2;
+	long long num_loops = 2;
 	unsigned long timedelay = 1000000;
 	unsigned long buf_len = 128;
 

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

* Re: [PATCH] tools: iio: iio_generic_buffer: allow infinite looping
  2018-06-07  8:31 [PATCH] tools: iio: iio_generic_buffer: allow infinite looping Dan Carpenter
@ 2018-06-07 16:31 ` Martin Kelly
  2018-06-10 13:44   ` Jonathan Cameron
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Kelly @ 2018-06-07 16:31 UTC (permalink / raw)
  To: Dan Carpenter, Jonathan Cameron
  Cc: Hartmut Knaack, Lars-Peter Clausen, Peter Meerwald-Stadler,
	linux-iio, kernel-janitors

On 06/07/2018 01:31 AM, Dan Carpenter wrote:
> I think the num_loops variable was intended to be signed so that we
> could set it to -1 and it would loop forever.  Right now it just loops
> for a very long time.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c
> index 3040830d7797..84545666a09c 100644
> --- a/tools/iio/iio_generic_buffer.c
> +++ b/tools/iio/iio_generic_buffer.c
> @@ -330,7 +330,7 @@ static const struct option longopts[] = {
>   
>   int main(int argc, char **argv)
>   {
> -	unsigned long long num_loops = 2;
> +	long long num_loops = 2;
>   	unsigned long timedelay = 1000000;
>   	unsigned long buf_len = 128;
>   

Good catch, thanks.

Reviewed-by: Martin Kelly <mkelly@xevo.com>

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

* Re: [PATCH] tools: iio: iio_generic_buffer: allow infinite looping
  2018-06-07 16:31 ` Martin Kelly
@ 2018-06-10 13:44   ` Jonathan Cameron
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Cameron @ 2018-06-10 13:44 UTC (permalink / raw)
  To: Martin Kelly
  Cc: Dan Carpenter, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, linux-iio, kernel-janitors

On Thu, 7 Jun 2018 09:31:06 -0700
Martin Kelly <mkelly@xevo.com> wrote:

> On 06/07/2018 01:31 AM, Dan Carpenter wrote:
> > I think the num_loops variable was intended to be signed so that we
> > could set it to -1 and it would loop forever.  Right now it just loops
> > for a very long time.
> > 
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c
> > index 3040830d7797..84545666a09c 100644
> > --- a/tools/iio/iio_generic_buffer.c
> > +++ b/tools/iio/iio_generic_buffer.c
> > @@ -330,7 +330,7 @@ static const struct option longopts[] = {
> >   
> >   int main(int argc, char **argv)
> >   {
> > -	unsigned long long num_loops = 2;
> > +	long long num_loops = 2;
> >   	unsigned long timedelay = 1000000;
> >   	unsigned long buf_len = 128;
> >     
> 
> Good catch, thanks.
> 
> Reviewed-by: Martin Kelly <mkelly@xevo.com>
Applied.  I'm not going to rush this one as that is a very
long time so we are unlikely to get lots of problems with it ;)
Will wait for the next cycle.

Thanks,

Jonathan

> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

end of thread, other threads:[~2018-06-10 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-07  8:31 [PATCH] tools: iio: iio_generic_buffer: allow infinite looping Dan Carpenter
2018-06-07 16:31 ` Martin Kelly
2018-06-10 13:44   ` Jonathan Cameron

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).