Patch "of: unittest: fix warning on PowerPC frame size warning" has been added to the 5.16-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

    of: unittest: fix warning on PowerPC frame size warning

to the 5.16-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:
     of-unittest-fix-warning-on-powerpc-frame-size-warnin.patch
and it can be found in the queue-5.16 subdirectory.

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



commit acaeeb65ed3dc3937977326e76ff0eab4d7874af
Author: Jim Quinlan <jim2101024@xxxxxxxxx>
Date:   Fri Dec 10 13:46:35 2021 -0500

    of: unittest: fix warning on PowerPC frame size warning
    
    [ Upstream commit a8d61a9112ad0c9216ab45d050991e07bc4f3408 ]
    
    The struct device variable "dev_bogus" was triggering this warning
    on a PowerPC build:
    
        drivers/of/unittest.c: In function 'of_unittest_dma_ranges_one.constprop':
        [...] >> The frame size of 1424 bytes is larger than 1024 bytes
                 [-Wframe-larger-than=]
    
    This variable is now dynamically allocated.
    
    Fixes: e0d072782c734 ("dma-mapping: introduce DMA range map, supplanting dma_pfn_offset")
    Reported-by: kernel test robot <lkp@xxxxxxxxx>
    Signed-off-by: Jim Quinlan <jim2101024@xxxxxxxxx>
    Reviewed-by: Christoph Hellwig <hch@xxxxxx>
    Reviewed-by: Frank Rowand <frank.rowand@xxxxxxxx>
    Reviewed-by: Florian Fainelli <f.fainelli@xxxxxxxxx>
    Signed-off-by: Rob Herring <robh@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20211210184636.7273-2-jim2101024@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 481ba8682ebf4..02c5cd06ad19c 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -911,11 +911,18 @@ static void __init of_unittest_dma_ranges_one(const char *path,
 	if (!rc) {
 		phys_addr_t	paddr;
 		dma_addr_t	dma_addr;
-		struct device	dev_bogus;
+		struct device	*dev_bogus;
 
-		dev_bogus.dma_range_map = map;
-		paddr = dma_to_phys(&dev_bogus, expect_dma_addr);
-		dma_addr = phys_to_dma(&dev_bogus, expect_paddr);
+		dev_bogus = kzalloc(sizeof(struct device), GFP_KERNEL);
+		if (!dev_bogus) {
+			unittest(0, "kzalloc() failed\n");
+			kfree(map);
+			return;
+		}
+
+		dev_bogus->dma_range_map = map;
+		paddr = dma_to_phys(dev_bogus, expect_dma_addr);
+		dma_addr = phys_to_dma(dev_bogus, expect_paddr);
 
 		unittest(paddr == expect_paddr,
 			 "of_dma_get_range: wrong phys addr %pap (expecting %llx) on node %pOF\n",
@@ -925,6 +932,7 @@ static void __init of_unittest_dma_ranges_one(const char *path,
 			 &dma_addr, expect_dma_addr, np);
 
 		kfree(map);
+		kfree(dev_bogus);
 	}
 	of_node_put(np);
 #endif



[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