]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
ddr: altera: n5x: size_t cannot be less than 0
authorAndrew Goodbody <andrew.goodbody@linaro.org>
Thu, 24 Jul 2025 15:19:24 +0000 (16:19 +0100)
committerTien Fong Chee <tien.fong.chee@intel.com>
Wed, 30 Jul 2025 09:45:29 +0000 (17:45 +0800)
The function socfpga_get_handoff_size returns an int so make the struct
fields used to accept the return value also an int so that testing for
less than 0 is then valid.

This issue was found by Smatch.

Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
drivers/ddr/altera/sdram_n5x.c

index d1fc93b6bdd27c33c6c1b8b4b3a4b400e2ae3153..17ec6afa82b0cdfe4eb0f86958819bb74ee42b0a 100644 (file)
@@ -346,25 +346,25 @@ struct ddr_handoff {
        phys_addr_t cntlr_base;
        size_t cntlr_total_length;
        enum ddr_type cntlr_t;
-       size_t cntlr_handoff_length;
+       int cntlr_handoff_length;
 
        /* Second controller attributes*/
        phys_addr_t cntlr2_handoff_base;
        phys_addr_t cntlr2_base;
        size_t cntlr2_total_length;
        enum ddr_type cntlr2_t;
-       size_t cntlr2_handoff_length;
+       int cntlr2_handoff_length;
 
        /* PHY attributes */
        phys_addr_t phy_handoff_base;
        phys_addr_t phy_base;
        size_t phy_total_length;
-       size_t phy_handoff_length;
+       int phy_handoff_length;
 
        /* PHY engine attributes */
        phys_addr_t phy_engine_handoff_base;
        size_t phy_engine_total_length;
-       size_t phy_engine_handoff_length;
+       int phy_engine_handoff_length;
 
        /* Calibration attributes */
        phys_addr_t train_imem_base;