From e5218d798ded7444a08c4b745d47c6d7cd22a530 Mon Sep 17 00:00:00 2001 From: Levente Kurusa Date: Sat, 5 Apr 2014 13:57:22 +0200 Subject: [PATCH] qr: print_oops: introduce new kernel parameter Introduce 'qr_oops' core_param so that we can disable the QR printing if needed. Signed-off-by: Levente Kurusa --- kernel/print_oops.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/kernel/print_oops.c b/kernel/print_oops.c index f8909ba..00388f1 100644 --- a/kernel/print_oops.c +++ b/kernel/print_oops.c @@ -1,5 +1,8 @@ /* * + * Copyright (C) 2014 Teodora Baluta + * Copyright (C) 2014 Levente Kurusa + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or @@ -19,17 +22,19 @@ #include #include +#define COMPR_LEVEL 6 +#define QQQ_WHITE 0x0F +#define QQQ_BLACK 0x00 + +static int qr_oops = 1; +core_param(qr_oops, qr_oops, int, 0644); + static char qr_buffer[QR_BUFSIZE]; static int buf_pos; -#define COMPR_LEVEL 6 - static DEFINE_MUTEX(compr_mutex); static struct z_stream_s stream; -#define QQQ_WHITE 0x0F -#define QQQ_BLACK 0x00 - void qr_append(char *text) { while (*text != '\0') { @@ -111,14 +116,15 @@ void print_qr_err(void) struct fb_info *info; struct fb_fillrect rect; struct QRcode *qr; - int i, j; int w; int is_black; - char compr_qr_buffer[buf_pos]; + + if (!qr_oops) + return; + compr_len = qr_compress(qr_buffer, compr_qr_buffer, buf_pos, buf_pos); - if (compr_len < 0) return; -- 1.8.3.1