From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753513AbdBKJ3V (ORCPT ); Sat, 11 Feb 2017 04:29:21 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36039 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751009AbdBKJ3T (ORCPT ); Sat, 11 Feb 2017 04:29:19 -0500 Date: Sat, 11 Feb 2017 09:29:10 +0800 From: Cheah Kok Cheong To: Ian Abbott Cc: hsweeten@visionengravers.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Staging: comedi: drivers: comedi_test: Set max input value for auto config Message-ID: <20170211012910.GA2811@linux-Precision-WorkStation-T5500> References: <1485365489-3577-1-git-send-email-thrust73@gmail.com> <1485532554-2520-1-git-send-email-thrust73@gmail.com> <271653cb-b0d9-dcb9-0bfb-e6282221cf02@mev.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <271653cb-b0d9-dcb9-0bfb-e6282221cf02@mev.co.uk> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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