Changeset 2ea98108 in rtems for c/src/libchip/i2c/spi-memdrv.c


Ignore:
Timestamp:
Oct 22, 2009, 5:43:26 AM (10 years ago)
Author:
Ralf Corsepius <ralf.corsepius@…>
Branches:
4.10, 4.11, master
Children:
0818be5
Parents:
05c599d
Message:

Use hex-constants to avoid implicit int-casts.
Use rtems_off64_t offsets to avoid loosing precision.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/libchip/i2c/spi-memdrv.c

    r05c599d r2ea98108  
    127127  rtems_status_code          rc = RTEMS_SUCCESSFUL;
    128128  rtems_libio_rw_args_t *rwargs = arg;
    129   unsigned                  off = rwargs->offset;
     129  rtems_off64_t             off = rwargs->offset;
    130130  int                       cnt = rwargs->count;
    131131  unsigned char            *buf = (unsigned char *)rwargs->buffer;
     
    237237    if (rc == RTEMS_SUCCESSFUL) {
    238238      cmdbuf[0] = SPI_MEM_CMD_PP;
    239       if (mem_param_ptr->mem_size > 256*256) {
     239      if (mem_param_ptr->mem_size > 0x10000 /* 256*256 */) {
    240240        cmdbuf[1] = (off >> 16) & 0xff;
    241241        cmdbuf[2] = (off >>  8) & 0xff;
     
    313313  rtems_status_code rc = RTEMS_SUCCESSFUL;
    314314  rtems_libio_rw_args_t *rwargs = arg;
    315   unsigned                  off = rwargs->offset;
     315  rtems_off64_t             off = rwargs->offset;
    316316  int                       cnt = rwargs->count;
    317317  unsigned char            *buf = (unsigned char *)rwargs->buffer;
     
    390390    if (rc == RTEMS_SUCCESSFUL) {
    391391      cmdbuf[0] = SPI_MEM_CMD_READ;
    392       if (mem_param_ptr->mem_size > 256*256) {
     392      if (mem_param_ptr->mem_size > 0x10000 /* 256*256 */) {
    393393        cmdbuf[1] = (off >> 16) & 0xff;
    394394        cmdbuf[2] = (off >>  8) & 0xff;
Note: See TracChangeset for help on using the changeset viewer.