Patch "rtc: sunplus: fix format string for printing resource" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    rtc: sunplus: fix format string for printing resource

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rtc-sunplus-fix-format-string-for-printing-resource.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3672f40dfe3581efc0bfcff13c8b114e0cdc1ca6
Author: Arnd Bergmann <arnd@xxxxxxxx>
Date:   Tue Jan 17 18:24:44 2023 +0100

    rtc: sunplus: fix format string for printing resource
    
    [ Upstream commit 08279468a294d8c996a657ecc9e51bd5c084c75d ]
    
    On 32-bit architectures with 64-bit resource_size_t, sp_rtc_probe()
    causes a compiler warning:
    
    drivers/rtc/rtc-sunplus.c: In function 'sp_rtc_probe':
    drivers/rtc/rtc-sunplus.c:243:33: error: format '%x' expects argument of type 'unsigned int', but argument 4 has type 'resource_size_t' {aka 'long long unsigned int'} [-Werror=format=]
      243 |         dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
          |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    The best way to print a resource is the special %pR format string,
    and similarly to print a pointer we can use %p and avoid the cast.
    
    Fixes: fad6cbe9b2b4 ("rtc: Add driver for RTC in Sunplus SP7021")
    Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>
    Link: https://lore.kernel.org/r/20230117172450.2938962-1-arnd@xxxxxxxxxx
    Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/rtc/rtc-sunplus.c b/drivers/rtc/rtc-sunplus.c
index e8e2ab1103fc..4b578e4d44f6 100644
--- a/drivers/rtc/rtc-sunplus.c
+++ b/drivers/rtc/rtc-sunplus.c
@@ -240,8 +240,8 @@ static int sp_rtc_probe(struct platform_device *plat_dev)
 	if (IS_ERR(sp_rtc->reg_base))
 		return dev_err_probe(&plat_dev->dev, PTR_ERR(sp_rtc->reg_base),
 					    "%s devm_ioremap_resource fail\n", RTC_REG_NAME);
-	dev_dbg(&plat_dev->dev, "res = 0x%x, reg_base = 0x%lx\n",
-		sp_rtc->res->start, (unsigned long)sp_rtc->reg_base);
+	dev_dbg(&plat_dev->dev, "res = %pR, reg_base = %p\n",
+		sp_rtc->res, sp_rtc->reg_base);
 
 	sp_rtc->irq = platform_get_irq(plat_dev, 0);
 	if (sp_rtc->irq < 0)



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux