* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
- * along with this program; if not, write to the *
- * Free Software Foundation, Inc., *
- * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
+ * along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
#ifdef HAVE_CONFIG_H
COMMAND_HANDLER(handle_nand_dump_command)
{
- int filesize;
+ size_t filesize;
struct nand_device *nand = NULL;
struct nand_fileio_state s;
int retval = CALL_COMMAND_HANDLER(nand_fileio_parse_args,
}
if (NULL != s.page)
- fileio_write(&s.fileio, s.page_size, s.page, &size_written);
+ fileio_write(s.fileio, s.page_size, s.page, &size_written);
if (NULL != s.oob)
- fileio_write(&s.fileio, s.oob_size, s.oob, &size_written);
+ fileio_write(s.fileio, s.oob_size, s.oob, &size_written);
s.size -= nand->page_size;
s.address += nand->page_size;
}
- retval = fileio_size(&s.fileio, &filesize);
+ retval = fileio_size(s.fileio, &filesize);
if (retval != ERROR_OK)
return retval;
if (nand_fileio_finish(&s) == ERROR_OK) {
- command_print(CMD_CTX, "dumped %ld bytes in %fs (%0.3f KiB/s)",
- (long)filesize, duration_elapsed(&s.bench),
+ command_print(CMD_CTX, "dumped %zu bytes in %fs (%0.3f KiB/s)",
+ filesize, duration_elapsed(&s.bench),
duration_kbps(&s.bench, filesize));
}
return ERROR_OK;
static int nand_list_walker(struct nand_flash_controller *c, void *x)
{
- struct command_context *cmd_ctx = (struct command_context *)x;
+ struct command_context *cmd_ctx = x;
command_print(cmd_ctx, " %s", c->name);
return ERROR_OK;
}
c->bus_width = 0;
c->address_cycles = 0;
c->page_size = 0;
- c->use_raw = 0;
+ c->use_raw = false;
c->next = NULL;
retval = CALL_COMMAND_HANDLER(controller->nand_device_command, c);