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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141014143902.GA9768@arch.hh.imgtec.org>
Date:	Tue, 14 Oct 2014 11:39:02 -0300
From:	Ezequiel Garcia <ezequiel.garcia@...e-electrons.com>
To:	Tanya Brokhman <tlinder@...eaurora.org>
Cc:	dedekind1@...il.com, linux-mtd@...ts.infradead.org,
	linux-arm-msm@...r.kernel.org,
	David Woodhouse <dwmw2@...radead.org>,
	Brian Norris <computersforpeace@...il.com>,
	Richard Weinberger <richard@....at>,
	open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v4] mtd: ubi: Extend UBI layer debug/messaging
 capabilities

On 14 Oct 05:13 PM, Tanya Brokhman wrote:
> diff --git a/drivers/mtd/ubi/block.c b/drivers/mtd/ubi/block.c
> index 8876c7d..3532f8a 100644
> --- a/drivers/mtd/ubi/block.c
> +++ b/drivers/mtd/ubi/block.c
> @@ -111,12 +111,12 @@ static int __init ubiblock_set_param(const char *val,
>  
>  	len = strnlen(val, UBIBLOCK_PARAM_LEN);
>  	if (len == 0) {
> -		ubi_warn("block: empty 'block=' parameter - ignored\n");
> +		pr_warn("block: empty 'block=' parameter - ignored\n");

No, this is wrong. The message should say something like "UBI: block", or
otherwise the user will think this comes from the block subsystem.

Please use some pr_fmt for this. Something like this before the headers
should be enough:

#define pr_fmt(fmt) "UBI: block:" fmt

You can then use pr_{info,warn,err} without the prefix like this:

  pr_info("whatever");

Which prints "UBI: block: whatever".

See arch/arm/kernel/perf_event.c for an example of how this works.

Also:

>       if (len == UBIBLOCK_PARAM_LEN) {
> -             ubi_err("block: parameter \"%s\" is too long, max. is %d\n",
> +             pr_warn("block: parameter \"%s\" is too long, max. is %d\n",
>                       val, UBIBLOCK_PARAM_LEN);
>               return -EINVAL;
>       }

Please replace the level properly ubi_err -> pr_err, ubi_warn -> pr_warn, etc.
-- 
Ezequiel GarcĂ­a, Free Electrons
Embedded Linux, Kernel and Android Engineering
http://free-electrons.com
--
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