From: Hans Verkuil Date: Thu, 1 Dec 2005 08:51:58 +0000 (-0800) Subject: [PATCH] V4L/dvb: fix kernel message (print of %s from random pointer) X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ab60e303cd3e73a68d5e397be50a1cb35452513c;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git [PATCH] V4L/dvb: fix kernel message (print of %s from random pointer) Fix kernel message ( basically printk("%s", random_pointer) ). Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 0235cef07b3..e717e30d818 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -771,17 +771,19 @@ static v4l2_std_id saa7115_get_v4lstd(struct i2c_client *client) static void saa7115_log_status(struct i2c_client *client) { - static const char * const audclk_freq_strs[] = { - "44.1 kHz", - "48 kHz", - "32 kHz" - }; struct saa7115_state *state = i2c_get_clientdata(client); + char *audfreq = "undefined"; int reg1e, reg1f; int signalOk; int vcr; - saa7115_info("Audio frequency: %s\n", audclk_freq_strs[state->audclk_freq]); + switch (state->audclk_freq) { + case V4L2_AUDCLK_32_KHZ: audfreq = "32 kHz"; break; + case V4L2_AUDCLK_441_KHZ: audfreq = "44.1 kHz"; break; + case V4L2_AUDCLK_48_KHZ: audfreq = "48 kHz"; break; + } + + saa7115_info("Audio frequency: %s\n", audfreq); if (client->name[6] == '4') { /* status for the saa7114 */ reg1f = saa7115_read(client, 0x1f);