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]
Date:	Thu, 06 Jun 2013 10:53:20 -0700
From:	Joe Perches <joe@...ches.com>
To:	Johannes Schilling <of82ecuq@....cs.fau.de>
Cc:	linux-kernel@...r.kernel.org, linux-kernel@...cs.fau.de,
	Al Cho <acho@...ell.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Amarjargal Gundjalam <amarjargal16@...il.com>,
	Kurt Kanzenbach <shifty91@...il.com>,
	devel@...verdev.osuosl.org,
	Laura Lawniczak <laura.lawniczak@...glemail.com>,
	Dan Carpenter <dan.carpenter@...cle.com>
Subject: Re: [PATCH 3/6] keucr: migrate printk to dev_dbg/info/warn/err

On Thu, 2013-06-06 at 18:10 +0200, Johannes Schilling wrote:
> From: Laura Lawniczak <laura.lawniczak@...glemail.com>
[]
> diff --git a/drivers/staging/keucr/init.c b/drivers/staging/keucr/init.c
[]
> @@ -19,13 +19,13 @@ int ENE_InitMedia(struct us_data *us)
[]
> -	printk(KERN_INFO "MiscReg03 = %x\n", MiscReg03);
> +	dev_info(&us->pusb_dev->dev, "MiscReg03 = %x\n", MiscReg03);

I suggest adding a few convenience macros to make
this a bit shorter and more likely to fit on a single
line without exceeding 80 cols.

Adding something like:

#define us_<level>(us, fmt, ...)				\
	dev_<level>(&us->pusb_dev->dev, fmt, ##__VA_ARGS__)

so these uses become

	us_info(us, "MiscReg03\n", MiscReg03);

which is shorter and more readable.

> diff --git a/drivers/staging/keucr/smilsub.c b/drivers/staging/keucr/smilsub.c
[]
> @@ -214,7 +214,7 @@ int Ssfdc_D_ReadSect(struct us_data *us, BYTE *buf, BYTE *redundant)
>  
>  	result = ENE_LoadBinCode(us, SM_RW_PATTERN);
>  	if (result != USB_STOR_XFER_GOOD) {
> -		printk("Load SM RW Code Fail !!\n");
> +		dev_err(&us->pusb_dev->dev, "Load SM RW Code Fail !!\n");

Also, there's no need to shout in the logs.
These are reported at KERN_ERR level, so using

	us_err(us, "loading SM RW code failed\n")

would be fine.


--
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