mirror of
https://github.com/u-boot/u-boot.git
synced 2025-01-26 20:53:23 +08:00
cmd: fix clone coverity scan
This patch fixes coverity scan MISSING_BREAK issues, and also an error on block size check. Signed-off-by: John Chau <john@harmon.hk>
This commit is contained in:
parent
10e4d64e34
commit
4a1f0b80ad
@ -38,7 +38,7 @@ static int do_clone(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv
|
||||
srcbz = srcdesc->blksz;
|
||||
destbz = destdesc->blksz;
|
||||
|
||||
if ((srcbz * (buffersize / srcbz) != buffersize) &&
|
||||
if ((srcbz * (buffersize / srcbz) != buffersize) ||
|
||||
(destbz * (buffersize / destbz) != buffersize)) {
|
||||
printf("failed: cannot match device block sizes\n");
|
||||
return 1;
|
||||
@ -55,10 +55,12 @@ static int do_clone(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv
|
||||
switch (unit[0]) {
|
||||
case 'g':
|
||||
case 'G':
|
||||
requested *= 1024;
|
||||
requested *= 1024 * 1024 * 1024;
|
||||
break;
|
||||
case 'm':
|
||||
case 'M':
|
||||
requested *= 1024;
|
||||
requested *= 1024 * 1024;
|
||||
break;
|
||||
case 'k':
|
||||
case 'K':
|
||||
requested *= 1024;
|
||||
|
Loading…
Reference in New Issue
Block a user