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
| ||
|
Date: Wed, 28 May 2014 12:27:13 -0700 From: Greg Kroah-Hartman <gregkh@...uxfoundation.org> To: Joe Perches <joe@...ches.com> Cc: Kukjin Kim <kgene.kim@...sung.com>, Jingoo Han <jg1.han@...sung.com>, Doug Anderson <dianders@...omium.org>, Jiri Slaby <jslaby@...e.cz>, linux-serial@...r.kernel.org, LKML <linux-kernel@...r.kernel.org> Subject: Re: [PATCH] serial: samsung: Neaten dbg uses On Tue, May 20, 2014 at 02:05:50PM -0700, Joe Perches wrote: > Add format and argument checking and fix misuses in the dbg macro. > > Add __printf > Use %pR for resource > Add #include guard to samsung.h > Move static functions from .h to .c > Use vscnprintf instead of length unguarded vsprintf > > Signed-off-by: Joe Perches <joe@...ches.com> > --- > > compiled (no warnings)/untested. > > drivers/tty/serial/samsung.c | 35 +++++++++++++++++++++++++++++------ > drivers/tty/serial/samsung.h | 23 +++-------------------- > 2 files changed, 32 insertions(+), 26 deletions(-) > > diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c > index 1f5505e..3293377 100644 > --- a/drivers/tty/serial/samsung.c > +++ b/drivers/tty/serial/samsung.c > @@ -53,6 +53,29 @@ > > #include "samsung.h" > > +#if defined(CONFIG_SERIAL_SAMSUNG_DEBUG) && \ > + defined(CONFIG_DEBUG_LL) && \ > + !defined(MODULE) > + > +extern void printascii(const char *); > + > +__printf(1, 2) > +static void dbg(const char *fmt, ...) > +{ > + va_list va; > + char buff[256]; > + > + va_start(va, fmt); > + vscnprintf(buff, sizeof(buf), fmt, va); > + va_end(va); > + > + printascii(buff); > +} > + > +#else > +#define dbg(fmt, ...) do { if (0) no_printk(fmt, ##__VA_ARGS__); } while (0) > +#endif Ick, what a mess. I'll take this, but I think I'll just convert this to dev_dbg() instead of dealing with a config option mess... thanks, greg k-h -- 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