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]
Message-ID: <20200904162943.GT1891694@smile.fi.intel.com>
Date:   Fri, 4 Sep 2020 19:29:43 +0300
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Bartosz Golaszewski <brgl@...ev.pl>
Cc:     Linus Walleij <linus.walleij@...aro.org>,
        Jonathan Corbet <corbet@....net>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Kent Gibson <warthog618@...il.com>, linux-gpio@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-acpi@...r.kernel.org,
        Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: Re: [PATCH 08/23] gpio: mockup: use pr_fmt()

On Fri, Sep 04, 2020 at 05:45:32PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bgolaszewski@...libre.com>
> 
> We don't need a custom logging helper. Let's use the standard pr_fmt()
> macro which allows us to use all pr_*() routines with custom format.
> 
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
> ---
>  drivers/gpio/gpio-mockup.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-mockup.c b/drivers/gpio/gpio-mockup.c
> index 349782cdb4d7..73cd51459c2a 100644
> --- a/drivers/gpio/gpio-mockup.c
> +++ b/drivers/gpio/gpio-mockup.c
> @@ -21,6 +21,9 @@
>  
>  #include "gpiolib.h"

> +#undef pr_fmt
> +#define pr_fmt(fmt)		GPIO_MOCKUP_NAME ": " fmt
> +

Just put definition to be first line of code before other inclusions and drop
unnecessary #undef.

>  #define GPIO_MOCKUP_NAME	"gpio-mockup"
>  #define GPIO_MOCKUP_MAX_GC	10
>  /*
> @@ -31,8 +34,6 @@
>  /* Maximum of three properties + the sentinel. */
>  #define GPIO_MOCKUP_MAX_PROP	4
>  
> -#define gpio_mockup_err(...)	pr_err(GPIO_MOCKUP_NAME ": " __VA_ARGS__)
> -
>  /*
>   * struct gpio_pin_status - structure describing a GPIO status
>   * @dir:       Configures direction of gpio as "in" or "out"
> @@ -549,7 +550,7 @@ static int __init gpio_mockup_init(void)
>  
>  	err = platform_driver_register(&gpio_mockup_driver);
>  	if (err) {
> -		gpio_mockup_err("error registering platform driver\n");
> +		pr_err("error registering platform driver\n");
>  		return err;
>  	}
>  
> @@ -577,7 +578,7 @@ static int __init gpio_mockup_init(void)
>  
>  		pdev = platform_device_register_full(&pdevinfo);
>  		if (IS_ERR(pdev)) {
> -			gpio_mockup_err("error registering device");
> +			pr_err("error registering device");
>  			platform_driver_unregister(&gpio_mockup_driver);
>  			gpio_mockup_unregister_pdevs();
>  			return PTR_ERR(pdev);
> -- 
> 2.26.1
> 

-- 
With Best Regards,
Andy Shevchenko


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ