ddr: fsl: incorrect logical constraint in populate_memctl_options
PATCH 1/1 ddr: fsl: incorrect logical constraint in populate_memctl_options
(pdimm[0].data_width >= 32) || (pdimm[0].data_width <= 40) is always true.
We should use && here.
The problem was indicated by cppcheck.
--- drivers/ddr/fsl/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ddr/fsl/options.c +1 -1
@@ -916,7 +916,7 @@ unsigned int populate_memctl_options(const common_timing_params_t *common_dimm,if ((pdimm[0 ].data_width >=64 ) && \ (pdimm[0 ].data_width <=72 )) popts->data_bus_width =0 ; -else if ((pdimm[0 ].data_width >=32 ) || \ +else if ((pdimm[0 ].data_width >=32 ) && \ (pdimm[0 ].data_width <=40 )) popts->data_bus_width =1 ;else {
Signature · 1 line
2.11.0
PATCH 1/1 ddr: fsl: incorrect logical constraint in populate_memctl_options
Quoted 8 lines · Heinrich Schuchardt
(pdimm[0].data_width >= 32) || (pdimm[0].data_width <= 40) is always true.
We should use && here.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170415/6f5a60ce/attachment.sig>
PATCH 1/1 ddr: fsl: incorrect logical constraint in populate_memctl_options
In reply to Heinrich SchuchardtQuoted 18 lines · Heinrich Schuchardt
(pdimm[0].data_width >= 32) || (pdimm[0].data_width <= 40) is always true.
We should use && here.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>--- drivers/ddr/fsl/options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/ddr/fsl/options.c +0
-0
drivers/ddr/fsl/options.c unsigned int populate_memctl_options(const common_timing_params_t *common_dimm, · line 922
Quoted 8 lines
drivers/ddr/fsl/options.c +1
-1@@ -916,7 +916,7 @@ unsigned int populate_memctl_options(const common_timing_params_t *common_dimm,if ((pdimm[0 ].data_width >=64 ) && \ (pdimm[0 ].data_width <=72 )) popts->data_bus_width =0 ; -else if ((pdimm[0 ].data_width >=32 ) || \ +else if ((pdimm[0 ].data_width >=32 ) && \ (pdimm[0 ].data_width <=40 )) popts->data_bus_width =1 ;else {
Thanks for catching this.
Quoted 10 lines · xypron.glpk at gmx.de
(pdimm[0].data_width >= 32) || (pdimm[0].data_width <= 40) is always true.
We should use && here.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Tom Rini <[email protected]>Reviewed-by York Sun <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170419/729cd3a2/attachment.sig>