lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1427577518.2715.8.camel@perches.com>
Date:	Sat, 28 Mar 2015 14:18:38 -0700
From:	Joe Perches <joe@...ches.com>
To:	Richard Weinberger <richard.weinberger@...il.com>
Cc:	Shirish Gajera <gshirishfree@...il.com>, w.d.hubbs@...il.com,
	chris@...-brannons.com, kirk@...sers.ca,
	samuel.thibault@...-lyon.org, Greg KH <gregkh@...uxfoundation.org>,
	Domagoj Tršan <domagoj.trsan@...il.com>,
	mahfouz.saif.elyazal@...il.com,
	Ben Hutchings <ben@...adent.org.uk>,
	roxanagabriela10@...il.com,
	Robin Schroer <sulamiification@...il.com>,
	dilekuzulmez@...il.com, DaeSeok Youn <daeseok.youn@...il.com>,
	Ayşe Melike Yurtoğlu 
	<aysemelikeyurtoglu@...il.com>,
	Rusty Russell <rusty@...tcorp.com.au>,
	tapaswenipathak@...il.com, vthakkar1994@...il.com,
	speakup@...ux-speakup.org,
	"devel@...verdev.osuosl.org" <devel@...verdev.osuosl.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] staging: speakup: Fix warning of line over 80
 characters.

On Sat, 2015-03-28 at 21:40 +0100, Richard Weinberger wrote:
> On Sat, Mar 28, 2015 at 9:21 PM, Shirish Gajera <gshirishfree@...il.com> 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.


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ