Commit faffe14f016db10f33836b018c4b304d939cf586
Committed by
Wolfgang Denk
1 parent
a6a04967bc
Exists in
master
and in
54 other branches
cmd_i2c.c: reduced subaddress length to 3 bytes
according to some of the comments the subaddress length is 1 or 2, but we are being prepared for the case it becomes 3. However the code also accepted 4. This repairs this by changing the constand 4 to 3. Signed-off-by: Frans Meulenbroeks <fransmeulenbroeks@gmail.com>
Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff
common/cmd_i2c.c
... | ... | @@ -193,7 +193,7 @@ |
193 | 193 | for (j = 0; j < 8; j++) { |
194 | 194 | if (argv[2][j] == '.') { |
195 | 195 | alen = argv[2][j+1] - '0'; |
196 | - if (alen > 4) { | |
196 | + if (alen > 3) { | |
197 | 197 | cmd_usage(cmdtp); |
198 | 198 | return 1; |
199 | 199 | } |
... | ... | @@ -287,7 +287,7 @@ |
287 | 287 | for (j = 0; j < 8; j++) { |
288 | 288 | if (argv[2][j] == '.') { |
289 | 289 | alen = argv[2][j+1] - '0'; |
290 | - if (alen > 4) { | |
290 | + if (alen > 3) { | |
291 | 291 | cmd_usage(cmdtp); |
292 | 292 | return 1; |
293 | 293 | } |
... | ... | @@ -361,7 +361,7 @@ |
361 | 361 | for (j = 0; j < 8; j++) { |
362 | 362 | if (argv[2][j] == '.') { |
363 | 363 | alen = argv[2][j+1] - '0'; |
364 | - if (alen > 4) { | |
364 | + if (alen > 3) { | |
365 | 365 | cmd_usage(cmdtp); |
366 | 366 | return 1; |
367 | 367 | } |
... | ... | @@ -451,7 +451,7 @@ |
451 | 451 | for (j = 0; j < 8; j++) { |
452 | 452 | if (argv[2][j] == '.') { |
453 | 453 | alen = argv[2][j+1] - '0'; |
454 | - if (alen > 4) { | |
454 | + if (alen > 3) { | |
455 | 455 | cmd_usage(cmdtp); |
456 | 456 | return 1; |
457 | 457 | } |
... | ... | @@ -607,7 +607,7 @@ |
607 | 607 | for (j = 0; j < 8; j++) { |
608 | 608 | if (argv[2][j] == '.') { |
609 | 609 | alen = argv[2][j+1] - '0'; |
610 | - if (alen > 4) { | |
610 | + if (alen > 3) { | |
611 | 611 | cmd_usage(cmdtp); |
612 | 612 | return 1; |
613 | 613 | } |