.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | |
---|
2 | 3 | /* |
---|
3 | 4 | * MTD driver for the 28F160F3 Flash Memory (non-CFI) on LART. |
---|
.. | .. |
---|
5 | 6 | * Author: Abraham vd Merwe <abraham@2d3d.co.za> |
---|
6 | 7 | * |
---|
7 | 8 | * Copyright (c) 2001, 2d3D, Inc. |
---|
8 | | - * |
---|
9 | | - * This code is free software; you can redistribute it and/or modify |
---|
10 | | - * it under the terms of the GNU General Public License version 2 as |
---|
11 | | - * published by the Free Software Foundation. |
---|
12 | 9 | * |
---|
13 | 10 | * References: |
---|
14 | 11 | * |
---|
.. | .. |
---|
439 | 436 | { |
---|
440 | 437 | int gap = BUSWIDTH - (from & (BUSWIDTH - 1)); |
---|
441 | 438 | |
---|
442 | | - while (len && gap--) *buf++ = read8 (from++), len--; |
---|
| 439 | + while (len && gap--) { |
---|
| 440 | + *buf++ = read8 (from++); |
---|
| 441 | + len--; |
---|
| 442 | + } |
---|
443 | 443 | } |
---|
444 | 444 | |
---|
445 | 445 | /* now we read dwords until we reach a non-dword boundary */ |
---|
.. | .. |
---|
521 | 521 | i = n = 0; |
---|
522 | 522 | |
---|
523 | 523 | while (gap--) tmp[i++] = 0xFF; |
---|
524 | | - while (len && i < BUSWIDTH) tmp[i++] = buf[n++], len--; |
---|
| 524 | + while (len && i < BUSWIDTH) { |
---|
| 525 | + tmp[i++] = buf[n++]; |
---|
| 526 | + len--; |
---|
| 527 | + } |
---|
525 | 528 | while (i < BUSWIDTH) tmp[i++] = 0xFF; |
---|
526 | 529 | |
---|
527 | 530 | if (!write_dword (aligned,*((__u32 *) tmp))) return (-EIO); |
---|