Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751938AbdFSFdl (ORCPT ); Mon, 19 Jun 2017 01:33:41 -0400 Received: from smtprelay0024.hostedemail.com ([216.40.44.24]:33072 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750851AbdFSFdj (ORCPT ); Mon, 19 Jun 2017 01:33:39 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::,RULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1540:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3352:3622:3865:3866:3867:3868:3871:3872:3873:4321:4605:5007:7904:8531:10004:10400:10848:11026:11232:11658:11914:12043:12740:12760:12895:13069:13311:13357:13439:14659:14721:21080:21094:21433:21451:21627:30029:30054:30069:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: cloud99_3cc17f11de32b X-Filterd-Recvd-Size: 1946 Message-ID: <1497850415.8495.39.camel@perches.com> Subject: Re: [patch v2 2/3] staging: speakup: check and convert dev name or ser to dev_t From: Joe Perches To: Greg Kroah-Hartman , Okash Khawaja Cc: Jiri Slaby , Samuel Thibault , linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, Kirk Reiser , speakup@linux-speakup.org, Chris Brannon Date: Sun, 18 Jun 2017 22:33:35 -0700 In-Reply-To: <20170619011533.GA11287@kroah.com> References: <20170618085825.601359240@gmail.com> <20170618093536.021961426@gmail.com> <20170619011533.GA11287@kroah.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 860 Lines: 25 On Mon, 2017-06-19 at 09:15 +0800, Greg Kroah-Hartman wrote: > On Sun, Jun 18, 2017 at 09:58:27AM +0100, Okash Khawaja wrote: > > This patch adds functionality to validate and convert either a device > > name or 'ser' member of synth into dev_t. [] > > --- a/drivers/staging/speakup/spk_ttyio.c [] > > +int ser_to_dev(int ser, dev_t *dev_no) > > +{ > > + if (ser < 0 || ser > (255 - 64)) { > > + pr_err("speakup: Invalid ser param. \ > > + Must be between 0 and 191 inclusive.\n"); > > As Andy pointed out, never do this for a C string, it's not doing what > you think it is :) Well, some guy. > Worse case, do this like the following: > pr_err("speakup: Invalid ser param." > "Must be between 0 and 191 inclusive.\n"); Nope, now there's no space between param and Must. Using string concatenation on multiple lines is error prone.