linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr()
@ 2021-06-16 18:17 Enrico Weigelt, metux IT consult
  2021-06-16 18:17 ` [PATCH 2/2] watchdog: iTCO_wdt: use dev_err() instead of pr_err() Enrico Weigelt, metux IT consult
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2021-06-16 18:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: wim, linux, linux-watchdog

Reduce a little bit of boilerplate by using pm_ptr().

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/watchdog/iTCO_wdt.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index bf31d7b67a69..6ba2b2f60737 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -636,16 +636,13 @@ static const struct dev_pm_ops iTCO_wdt_pm = {
 	.resume_noirq = iTCO_wdt_resume_noirq,
 };
 
-#define ITCO_WDT_PM_OPS	(&iTCO_wdt_pm)
-#else
-#define ITCO_WDT_PM_OPS	NULL
 #endif /* CONFIG_PM_SLEEP */
 
 static struct platform_driver iTCO_wdt_driver = {
 	.probe          = iTCO_wdt_probe,
 	.driver         = {
 		.name   = DRV_NAME,
-		.pm     = ITCO_WDT_PM_OPS,
+		.pm     = pm_ptr(&iTCO_wdt_pm),
 	},
 };
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 2/2] watchdog: iTCO_wdt: use dev_err() instead of pr_err()
  2021-06-16 18:17 [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr() Enrico Weigelt, metux IT consult
@ 2021-06-16 18:17 ` Enrico Weigelt, metux IT consult
  2021-06-17  2:02   ` Guenter Roeck
  2021-06-17  2:02 ` [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr() Guenter Roeck
  2021-06-19 22:27 ` kernel test robot
  2 siblings, 1 reply; 6+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2021-06-16 18:17 UTC (permalink / raw)
  To: linux-kernel; +Cc: wim, linux, linux-watchdog

Use dev_err() instead of pr_err(), so device name is also shown in the log.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
---
 drivers/watchdog/iTCO_wdt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
index 6ba2b2f60737..35ff8d3fd9fc 100644
--- a/drivers/watchdog/iTCO_wdt.c
+++ b/drivers/watchdog/iTCO_wdt.c
@@ -479,13 +479,13 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
 		if (!devm_request_region(dev, p->smi_res->start,
 					 resource_size(p->smi_res),
 					 pdev->name)) {
-			pr_err("I/O address 0x%04llx already in use, device disabled\n",
+			dev_err(dev, "I/O address 0x%04llx already in use, device disabled\n",
 			       (u64)SMI_EN(p));
 			return -EBUSY;
 		}
 	} else if (iTCO_vendorsupport ||
 		   turn_SMI_watchdog_clear_off >= p->iTCO_version) {
-		pr_err("SMI I/O resource is missing\n");
+		dev_err(dev, "SMI I/O resource is missing\n");
 		return -ENODEV;
 	}
 
-- 
2.20.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr()
  2021-06-16 18:17 [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr() Enrico Weigelt, metux IT consult
  2021-06-16 18:17 ` [PATCH 2/2] watchdog: iTCO_wdt: use dev_err() instead of pr_err() Enrico Weigelt, metux IT consult
@ 2021-06-17  2:02 ` Guenter Roeck
  2021-06-19 22:27 ` kernel test robot
  2 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2021-06-17  2:02 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult; +Cc: linux-kernel, wim, linux-watchdog

On Wed, Jun 16, 2021 at 08:17:07PM +0200, Enrico Weigelt, metux IT consult wrote:
> Reduce a little bit of boilerplate by using pm_ptr().
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/iTCO_wdt.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
> index bf31d7b67a69..6ba2b2f60737 100644
> --- a/drivers/watchdog/iTCO_wdt.c
> +++ b/drivers/watchdog/iTCO_wdt.c
> @@ -636,16 +636,13 @@ static const struct dev_pm_ops iTCO_wdt_pm = {
>  	.resume_noirq = iTCO_wdt_resume_noirq,
>  };
>  
> -#define ITCO_WDT_PM_OPS	(&iTCO_wdt_pm)
> -#else
> -#define ITCO_WDT_PM_OPS	NULL
>  #endif /* CONFIG_PM_SLEEP */
>  
>  static struct platform_driver iTCO_wdt_driver = {
>  	.probe          = iTCO_wdt_probe,
>  	.driver         = {
>  		.name   = DRV_NAME,
> -		.pm     = ITCO_WDT_PM_OPS,
> +		.pm     = pm_ptr(&iTCO_wdt_pm),
>  	},
>  };
>  
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 2/2] watchdog: iTCO_wdt: use dev_err() instead of pr_err()
  2021-06-16 18:17 ` [PATCH 2/2] watchdog: iTCO_wdt: use dev_err() instead of pr_err() Enrico Weigelt, metux IT consult
@ 2021-06-17  2:02   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2021-06-17  2:02 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult; +Cc: linux-kernel, wim, linux-watchdog

On Wed, Jun 16, 2021 at 08:17:08PM +0200, Enrico Weigelt, metux IT consult wrote:
> Use dev_err() instead of pr_err(), so device name is also shown in the log.
> 
> Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
>  drivers/watchdog/iTCO_wdt.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/watchdog/iTCO_wdt.c b/drivers/watchdog/iTCO_wdt.c
> index 6ba2b2f60737..35ff8d3fd9fc 100644
> --- a/drivers/watchdog/iTCO_wdt.c
> +++ b/drivers/watchdog/iTCO_wdt.c
> @@ -479,13 +479,13 @@ static int iTCO_wdt_probe(struct platform_device *pdev)
>  		if (!devm_request_region(dev, p->smi_res->start,
>  					 resource_size(p->smi_res),
>  					 pdev->name)) {
> -			pr_err("I/O address 0x%04llx already in use, device disabled\n",
> +			dev_err(dev, "I/O address 0x%04llx already in use, device disabled\n",
>  			       (u64)SMI_EN(p));
>  			return -EBUSY;
>  		}
>  	} else if (iTCO_vendorsupport ||
>  		   turn_SMI_watchdog_clear_off >= p->iTCO_version) {
> -		pr_err("SMI I/O resource is missing\n");
> +		dev_err(dev, "SMI I/O resource is missing\n");
>  		return -ENODEV;
>  	}
>  
> -- 
> 2.20.1
> 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr()
  2021-06-16 18:17 [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr() Enrico Weigelt, metux IT consult
  2021-06-16 18:17 ` [PATCH 2/2] watchdog: iTCO_wdt: use dev_err() instead of pr_err() Enrico Weigelt, metux IT consult
  2021-06-17  2:02 ` [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr() Guenter Roeck
@ 2021-06-19 22:27 ` kernel test robot
  2021-06-19 23:19   ` Guenter Roeck
  2 siblings, 1 reply; 6+ messages in thread
From: kernel test robot @ 2021-06-19 22:27 UTC (permalink / raw)
  To: Enrico Weigelt, metux IT consult, linux-kernel
  Cc: kbuild-all, wim, linux, linux-watchdog

[-- Attachment #1: Type: text/plain, Size: 2401 bytes --]

Hi "Enrico,

I love your patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on hwmon/hwmon-next linus/master v5.13-rc6 next-20210618]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Enrico-Weigelt-metux-IT-consult/watchdog-iTCO_wdt-use-pm_ptr/20210617-024441
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd860052c99b1e088352bdd4fb7aef46f8d2ef47
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/670a790c3acfccf4b5405459048ba2a05b912eef
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Enrico-Weigelt-metux-IT-consult/watchdog-iTCO_wdt-use-pm_ptr/20210617-024441
        git checkout 670a790c3acfccf4b5405459048ba2a05b912eef
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/device.h:25,
                    from include/linux/acpi.h:15,
                    from drivers/watchdog/iTCO_wdt.c:48:
>> drivers/watchdog/iTCO_wdt.c:645:21: error: 'iTCO_wdt_pm' undeclared here (not in a function); did you mean 'iTCO_wdt_ops'?
     645 |   .pm     = pm_ptr(&iTCO_wdt_pm),
         |                     ^~~~~~~~~~~
   include/linux/pm.h:377:23: note: in definition of macro 'pm_ptr'
     377 | #define pm_ptr(_ptr) (_ptr)
         |                       ^~~~


vim +645 drivers/watchdog/iTCO_wdt.c

   640	
   641	static struct platform_driver iTCO_wdt_driver = {
   642		.probe          = iTCO_wdt_probe,
   643		.driver         = {
   644			.name   = DRV_NAME,
 > 645			.pm     = pm_ptr(&iTCO_wdt_pm),
   646		},
   647	};
   648	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 62878 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr()
  2021-06-19 22:27 ` kernel test robot
@ 2021-06-19 23:19   ` Guenter Roeck
  0 siblings, 0 replies; 6+ messages in thread
From: Guenter Roeck @ 2021-06-19 23:19 UTC (permalink / raw)
  To: kernel test robot
  Cc: Enrico Weigelt, metux IT consult, linux-kernel, kbuild-all, wim,
	linux-watchdog

On Sun, Jun 20, 2021 at 06:27:52AM +0800, kernel test robot wrote:
> Hi "Enrico,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on linux/master]
> [also build test ERROR on hwmon/hwmon-next linus/master v5.13-rc6 next-20210618]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch]
> 
> url:    https://github.com/0day-ci/linux/commits/Enrico-Weigelt-metux-IT-consult/watchdog-iTCO_wdt-use-pm_ptr/20210617-024441
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git dd860052c99b1e088352bdd4fb7aef46f8d2ef47
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 9.3.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://github.com/0day-ci/linux/commit/670a790c3acfccf4b5405459048ba2a05b912eef
>         git remote add linux-review https://github.com/0day-ci/linux
>         git fetch --no-tags linux-review Enrico-Weigelt-metux-IT-consult/watchdog-iTCO_wdt-use-pm_ptr/20210617-024441
>         git checkout 670a790c3acfccf4b5405459048ba2a05b912eef
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=ia64 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    In file included from include/linux/device.h:25,
>                     from include/linux/acpi.h:15,
>                     from drivers/watchdog/iTCO_wdt.c:48:
> >> drivers/watchdog/iTCO_wdt.c:645:21: error: 'iTCO_wdt_pm' undeclared here (not in a function); did you mean 'iTCO_wdt_ops'?
>      645 |   .pm     = pm_ptr(&iTCO_wdt_pm),
>          |                     ^~~~~~~~~~~
>    include/linux/pm.h:377:23: note: in definition of macro 'pm_ptr'
>      377 | #define pm_ptr(_ptr) (_ptr)
>          |                       ^~~~
> 
> 
> vim +645 drivers/watchdog/iTCO_wdt.c
> 
>    640	
>    641	static struct platform_driver iTCO_wdt_driver = {
>    642		.probe          = iTCO_wdt_probe,
>    643		.driver         = {
>    644			.name   = DRV_NAME,
>  > 645			.pm     = pm_ptr(&iTCO_wdt_pm),

I'll drop this patch for now.

Guenter

>    646		},
>    647	};
>    648	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-19 23:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 18:17 [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr() Enrico Weigelt, metux IT consult
2021-06-16 18:17 ` [PATCH 2/2] watchdog: iTCO_wdt: use dev_err() instead of pr_err() Enrico Weigelt, metux IT consult
2021-06-17  2:02   ` Guenter Roeck
2021-06-17  2:02 ` [PATCH 1/2] watchdog: iTCO_wdt: use pm_ptr() Guenter Roeck
2021-06-19 22:27 ` kernel test robot
2021-06-19 23:19   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).