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


Groups > linux.kernel > #1592556 > unrolled thread

[PATCH] staging: speakup: Add __printf format/arg verification, fix fallout

Started byJoe Perches <joe@perches.com>
First post2017-03-04 17:20 +0100
Last post2017-03-04 17:20 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] staging: speakup: Add __printf format/arg verification, fix fallout Joe Perches <joe@perches.com> - 2017-03-04 17:20 +0100

#1592556 — [PATCH] staging: speakup: Add __printf format/arg verification, fix fallout

FromJoe Perches <joe@perches.com>
Date2017-03-04 17:20 +0100
Subject[PATCH] staging: speakup: Add __printf format/arg verification, fix fallout
Message-ID<thkzv-3gl-3@gated-at.bofh.it>
Using __printf allows the compiler to verify formats and arguments.
Use it and fix the single misuse found.

Signed-off-by: Joe Perches <joe@perches.com>
---
 drivers/staging/speakup/main.c     | 2 +-
 drivers/staging/speakup/spk_priv.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/main.c b/drivers/staging/speakup/main.c
index c2f70ef5b9b3..5c174c98f108 100644
--- a/drivers/staging/speakup/main.c
+++ b/drivers/staging/speakup/main.c
@@ -775,7 +775,7 @@ static void say_line(struct vc_data *vc)
 		cp = buf;
 		while (*cp == SPACE)
 			cp++;
-		synth_printf("%d, ", (cp - buf) + 1);
+		synth_printf("%zd, ", (cp - buf) + 1);
 	}
 	spk_punc_mask = spk_punc_masks[spk_reading_punc];
 	spkup_write(buf, i);
diff --git a/drivers/staging/speakup/spk_priv.h b/drivers/staging/speakup/spk_priv.h
index d5aa41d82122..c78c2b6a2fc9 100644
--- a/drivers/staging/speakup/spk_priv.h
+++ b/drivers/staging/speakup/spk_priv.h
@@ -63,6 +63,7 @@ void spk_do_catch_up(struct spk_synth *synth);
 void spk_synth_flush(struct spk_synth *synth);
 int spk_synth_is_alive_nop(struct spk_synth *synth);
 int spk_synth_is_alive_restart(struct spk_synth *synth);
+__printf(1, 2)
 void synth_printf(const char *buf, ...);
 int synth_request_region(unsigned long start, unsigned long n);
 int synth_release_region(unsigned long start, unsigned long n);
-- 
2.10.0.rc2.1.g053435c

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web