Skip to content

Commit 164ab90

Browse files
Srinivas Neelimarckleinebudde
authored andcommitted
can: xilinx_can: Fix incorrect variable and initialize with a default value
Some variables with incorrect type were passed to "of_property_read_u32" API, "of_property_read_u32" API was expecting an "u32 *" but the formal parameter that was passed was of type "int *". Fixed the issue by changing the variable types from "int" to "u32" and initialized with a default value. Fixed sparse warning. Addresses-Coverity: "incompatible_param" Addresses-Coverity: "UNINIT(Using uninitialized value)" Signed-off-by: Srinivas Neeli <[email protected]> Signed-off-by: Michal Simek <[email protected]> Link: https://lore.kernel.org/r/0651544d22f3c25893ca9d445b14823f0dfddfc8.1600073396.git.michal.simek@xilinx.com Signed-off-by: Marc Kleine-Budde <[email protected]>
1 parent a61035c commit 164ab90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/net/can/xilinx_can.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ static int xcan_probe(struct platform_device *pdev)
16711671
void __iomem *addr;
16721672
int ret;
16731673
int rx_max, tx_max;
1674-
int hw_tx_max, hw_rx_max;
1674+
u32 hw_tx_max = 0, hw_rx_max = 0;
16751675
const char *hw_tx_max_property;
16761676

16771677
/* Get the virtual base address for the device */
@@ -1724,7 +1724,7 @@ static int xcan_probe(struct platform_device *pdev)
17241724
*/
17251725
if (!(devtype->flags & XCAN_FLAG_TX_MAILBOXES) &&
17261726
(devtype->flags & XCAN_FLAG_TXFEMP))
1727-
tx_max = min(hw_tx_max, 2);
1727+
tx_max = min(hw_tx_max, 2U);
17281728
else
17291729
tx_max = 1;
17301730

0 commit comments

Comments
 (0)