From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752592AbbC1VSq (ORCPT ); Sat, 28 Mar 2015 17:18:46 -0400 Received: from smtprelay0066.hostedemail.com ([216.40.44.66]:53552 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752073AbbC1VSo (ORCPT ); Sat, 28 Mar 2015 17:18:44 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:966:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:1801:2196:2198:2199:2200:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3870:3871:3872:3874:4321:4385:4605:5007:6261:6742:7514:7903:10004:10400:10848:11026:11232:11233:11473:11658:11914:12043:12296:12517:12519:12740:13161:13229:14096:14097:21080,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0 X-HE-Tag: list66_4bc8b8d319f3b X-Filterd-Recvd-Size: 4055 Message-ID: <1427577518.2715.8.camel@perches.com> Subject: Re: [PATCH] staging: speakup: Fix warning of line over 80 characters. From: Joe Perches To: Richard Weinberger Cc: Shirish Gajera , w.d.hubbs@gmail.com, chris@the-brannons.com, kirk@reisers.ca, samuel.thibault@ens-lyon.org, Greg KH , Domagoj =?UTF-8?Q?Tr=C5=A1an?= , mahfouz.saif.elyazal@gmail.com, Ben Hutchings , roxanagabriela10@gmail.com, Robin Schroer , dilekuzulmez@gmail.com, DaeSeok Youn , =?UTF-8?Q?Ay=C5=9Fe?= Melike =?UTF-8?Q?Yurto=C4=9Flu?= , Rusty Russell , tapaswenipathak@gmail.com, vthakkar1994@gmail.com, speakup@linux-speakup.org, "devel@driverdev.osuosl.org" , LKML Date: Sat, 28 Mar 2015 14:18:38 -0700 In-Reply-To: References: <20150328202139.GA12695@shirish-ThinkPad-Edge-E430> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.12.10-0ubuntu1~14.10.1 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 On Sat, 2015-03-28 at 21:40 +0100, Richard Weinberger wrote: > On Sat, Mar 28, 2015 at 9:21 PM, Shirish Gajera wrote: > > This patch fixes the checkpatch.pl warning: [] > > diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c [] > > @@ -423,7 +423,8 @@ static void announce_edge(struct vc_data *vc, int msg_id) > > if (spk_bleeps & 1) > > bleep(spk_y); > > if ((spk_bleeps & 2) && (msg_id < edge_quiet)) > > - synth_printf("%s\n", spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1)); > > + synth_printf("%s\n", > > + spk_msg_get(MSG_EDGE_MSGS_START + msg_id - 1)); > > Instead of blindly adding newlines to silence checkpatch.pl, what > about reworking the code? > printf("%s\n", ..) cries for a puts(). There is no synth_puts > > @@ -1131,7 +1132,8 @@ static void spkup_write(const char *in_buf, int count) > > if (in_count > 2 && rep_count > 2) { > > if (last_type & CH_RPT) { > > synth_printf(" "); > > - synth_printf(spk_msg_get(MSG_REPEAT_DESC2), ++rep_count); > > + synth_printf(spk_msg_get(MSG_REPEAT_DESC2), > > + ++rep_count); > > synth_printf(" "); > > This printf stuff looks odd. synth_printf() seems to take a format > string, in this case the format string > is returned by spk_msg_get(), smells like a format string bug. Nope, but it would be nicer to avoid these spk_msg_get functions for the indices that are used with printf style formatting. > > } > > rep_count = 0; > > @@ -1847,7 +1849,8 @@ static void speakup_win_set(struct vc_data *vc) > > win_right = spk_x; > > } > > snprintf(info, sizeof(info), spk_msg_get(MSG_WINDOW_BOUNDARY), > > - (win_start) ? spk_msg_get(MSG_END) : spk_msg_get(MSG_START), > > + (win_start) ? > > + spk_msg_get(MSG_END) : spk_msg_get(MSG_START), > > (int)spk_y + 1, (int)spk_x + 1); > > Same here. Also please resolve the ?: mess. I don't think there's a ?: mess, but the code looks wrong. win_start ? MSG_END : MSG_START sure looks backwards.