Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1577538 > unrolled thread

Re: [PATCH] Staging: comedi: drivers: comedi_test: Set max input value for auto config

Started byIan Abbott <abbotti@mev.co.uk>
First post2017-02-09 13:40 +0100
Last post2017-02-11 10:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] Staging: comedi: drivers: comedi_test: Set max input  value for auto config Ian Abbott <abbotti@mev.co.uk> - 2017-02-09 13:40 +0100
    Re: [PATCH] Staging: comedi: drivers: comedi_test: Set max input  value for auto config Cheah Kok Cheong <thrust73@gmail.com> - 2017-02-11 10:30 +0100

#1577538 — Re: [PATCH] Staging: comedi: drivers: comedi_test: Set max input value for auto config

FromIan Abbott <abbotti@mev.co.uk>
Date2017-02-09 13:40 +0100
SubjectRe: [PATCH] Staging: comedi: drivers: comedi_test: Set max input value for auto config
Message-ID<t8Wb0-6a9-27@gated-at.bofh.it>
On 27/01/17 15:55, Cheah Kok Cheong wrote:
> Currently user can input any value for amplitude and period.
> This patch set a sane max value for auto-configuration mode.
>
> For manual configuration mode, it is assumed this is taken care of
> by the COMEDI userspace tool since there's no limit set here from
> day one in the staging tree. If otherwise then maybe this can be
> looked at separately.
>
> Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>

I don't think there is any need to limit these unless it results in 
arithmetic overflow, since they only affect the fake sample data values 
produced by the driver, not system performance.

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-

[toc] | [next] | [standalone]


#1578964

FromCheah Kok Cheong <thrust73@gmail.com>
Date2017-02-11 10:30 +0100
Message-ID<t9Cad-7mN-5@gated-at.bofh.it>
In reply to#1577538
On Thu, Feb 09, 2017 at 12:28:42PM +0000, Ian Abbott wrote:
> On 27/01/17 15:55, Cheah Kok Cheong wrote:
> >Currently user can input any value for amplitude and period.
> >This patch set a sane max value for auto-configuration mode.
> >
> >For manual configuration mode, it is assumed this is taken care of
> >by the COMEDI userspace tool since there's no limit set here from
> >day one in the staging tree. If otherwise then maybe this can be
> >looked at separately.
> >
> >Signed-off-by: Cheah Kok Cheong <thrust73@gmail.com>
> 
> I don't think there is any need to limit these unless it results in
> arithmetic overflow, since they only affect the fake sample data values
> produced by the driver, not system performance.

You are right there's no real danger here. Before submitting, I have
tested with positive values larger than "int" and smaller than "uint".
Anything larger than "uint" will result in loading failure.

I was motivated by the "user experience". Extreme values will not
display properly on Xoscope therefore I "googled" for a typical
oscilloscope input range for this patch.

Most probably I'm off the target here as I have only tried one
application. Maybe other supported application will handle this
better and offer a better user experience.

Again there's no real danger here, this patch is optional.

Thks.
Brgds,
CheahKC

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web