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:	Tue, 14 May 2013 12:33:54 -0700
From:	Joe Perches <joe@...ches.com>
To:	johannes.thumshirn@....de
Cc:	wim@...ana.be, linux-watchdog@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] watchdog: New watchdog driver for MEN A21 watchdogs

On Tue, 2013-05-14 at 21:09 +0200, johannes.thumshirn@....de wrote:
> From: Johannes Thumshirn <johannes.thumshirn@....de>
> 
> This patch adds the driver for the watchdog devices found on MEN Mikro
> Elektronik A21 VMEbus CPU Carrier Boards. It has DT-support and uses the
> watchdog framework.

trivia:

> diff --git a/drivers/watchdog/mena21_wdt.c b/drivers/watchdog/mena21_wdt.c

add:

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

before any #include to prefix pr_<level> messages.

> +#include <linux/module.h>
[]
> +static int a21_wdt_probe(struct platform_device *pdev)
> +{
> +	struct a21_wdt_drv *drv;
> +	int ret;
> +
> +	dev_info(&pdev->dev, "MEN A21 watchdog timer driver enabled\n");
> +
> +	drv = devm_kzalloc(&pdev->dev, sizeof(struct a21_wdt_drv), GFP_KERNEL);
> +	if (!drv) {
> +		dev_err(&pdev->dev,
> +			"Unable to allocate memory for watchdog device\n");

OOM messages aren't particularly useful as all
failed memory allocations (without __GFP_NOWARN)
get a generic dump_stack().

> +	ret = watchdog_register_device(&a21_wdt);
> +	if (ret) {
> +		pr_err("Cannot register watchdog device\n");
> +		goto err_register_wd;
> +	}
> +
> +	ret = register_reboot_notifier(&a21_wdt_notifier);
> +	if (ret) {
> +		pr_err("Cannot register reboot notifier\n");
> +		goto err_register_notif;
> +	}
> +
> +	ret = a21_wdt_create_files(&a21_wdt);
> +	if (ret) {
> +		dev_err(&pdev->dev, "Cannot create sysfs entries\n");
> +		goto err_create_sysfs;
> +	}

Mixing pr_err and dev_err may not be that useful.

Why not all dev_err?  Then there'd be no pr_<level>
uses at all and you wouldn't need the pr_fmt either.


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