diff options
author | Priyanka Singh <priyanka.singh@nxp.com> | 2021-08-19 09:09:03 +0300 |
---|---|---|
committer | Priyanka Jain <priyanka.jain@nxp.com> | 2021-11-09 12:13:24 +0300 |
commit | 71b255b6575b8e859ffddc880cce3c7606c7abca (patch) | |
tree | 7031c38be516301edd6d27dd981401e352ac5027 /drivers/ddr | |
parent | f5a37b02b0830f984518f2348ad6f3784516f130 (diff) | |
download | u-boot-71b255b6575b8e859ffddc880cce3c7606c7abca.tar.xz |
drivers: ddr: main.c: Fix Bad Shift operator issue
Fix Bad Shift operator issue in step_to_string function
by adding an if check
Signed-off-by: Priyanka Singh <priyanka.singh@nxp.com>
Reviewed-by: Priyanka Jain <priyanka.jain@nxp.com>
Diffstat (limited to 'drivers/ddr')
-rw-r--r-- | drivers/ddr/fsl/main.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/ddr/fsl/main.c b/drivers/ddr/fsl/main.c index 8e147160b9..f389e5ef95 100644 --- a/drivers/ddr/fsl/main.c +++ b/drivers/ddr/fsl/main.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0 /* * Copyright 2008-2014 Freescale Semiconductor, Inc. + * Copyright 2021 NXP */ /* @@ -297,9 +298,13 @@ const char * step_to_string(unsigned int step) { unsigned int s = __ilog2(step); - if ((1 << s) != step) - return step_string_tbl[7]; - + if (s <= 31) { + if ((1 << s) != step) + return step_string_tbl[7]; + } else { + if ((1 << (s - 32)) != step) + return step_string_tbl[7]; + } if (s >= ARRAY_SIZE(step_string_tbl)) { printf("Error for the step in %s\n", __func__); s = 0; |