Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers/sdcard_spi: fix uint64_t cast location [backport 2018.07] #9747

Merged
merged 1 commit into from
Aug 9, 2018

Conversation

cladmi
Copy link
Contributor

@cladmi cladmi commented Aug 9, 2018

Backport of #9746

Contribution description

When compiling tests/drivers_sdcard_spi with avr-gcc: avr-gcc (GCC) 6.4.0
it detected this error

RIOT/drivers/sdcard_spi/sdcard_spi.c:1012:72:
error: result of '512 << 10' requires 21 bits to represent, but 'int' only has 16 bits [-Werror=shift-overflow=]
return (card->csd.v2.C_SIZE + 1) * (uint64_t)(SD_HC_BLOCK_SIZE << 10);

Issues/PRs references

RIOT-OS/Release-Specs#69 (comment)

When compiling `tests/drivers_sdcard_spi` with `avr-gcc: avr-gcc (GCC) 6.4.0`
it detected this error

    RIOT/drivers/sdcard_spi/sdcard_spi.c:1012:72:
    error: result of '512 << 10' requires 21 bits to represent, but 'int' only has 16 bits [-Werror=shift-overflow=]
    return (card->csd.v2.C_SIZE + 1) * (uint64_t)(SD_HC_BLOCK_SIZE << 10);

(cherry picked from commit 939ca4e)
@cladmi cladmi added Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Aug 9, 2018
@cladmi cladmi added this to the Release 2018.07 milestone Aug 9, 2018
@cladmi
Copy link
Contributor Author

cladmi commented Aug 9, 2018

@maribu Could you also verify the backport ? just to be sure

Copy link
Contributor

@MichelRottleuthner MichelRottleuthner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

untested ACK

@cladmi cladmi merged commit 4b7ddba into RIOT-OS:2018.07-branch Aug 9, 2018
@maribu
Copy link
Member

maribu commented Aug 9, 2018

Seems to work :-)

Building application "tests_driver_sdcard_spi" for "arduino-mega2560" with MCU "atmega2560".

"make" -C /home/maribu/Repos/software/RIOT/boards/arduino-mega2560
"make" -C /home/maribu/Repos/software/RIOT/boards/common/arduino-atmega
"make" -C /home/maribu/Repos/software/RIOT/boards/common/atmega
"make" -C /home/maribu/Repos/software/RIOT/core
"make" -C /home/maribu/Repos/software/RIOT/cpu/atmega2560
"make" -C /home/maribu/Repos/software/RIOT/cpu/atmega_common
"make" -C /home/maribu/Repos/software/RIOT/cpu/atmega_common/periph
"make" -C /home/maribu/Repos/software/RIOT/drivers
"make" -C /home/maribu/Repos/software/RIOT/drivers/periph_common
"make" -C /home/maribu/Repos/software/RIOT/drivers/sdcard_spi
"make" -C /home/maribu/Repos/software/RIOT/sys
"make" -C /home/maribu/Repos/software/RIOT/sys/auto_init
"make" -C /home/maribu/Repos/software/RIOT/sys/auto_init/storage
"make" -C /home/maribu/Repos/software/RIOT/sys/checksum
"make" -C /home/maribu/Repos/software/RIOT/sys/div
"make" -C /home/maribu/Repos/software/RIOT/sys/fmt
"make" -C /home/maribu/Repos/software/RIOT/sys/isrpipe
"make" -C /home/maribu/Repos/software/RIOT/sys/shell
"make" -C /home/maribu/Repos/software/RIOT/sys/tsrb
"make" -C /home/maribu/Repos/software/RIOT/sys/uart_stdio
"make" -C /home/maribu/Repos/software/RIOT/sys/xtimer
   text	   data	    bss	    dec	    hex	filename
  24200	   3074	   2860	  30134	   75b6	/home/maribu/Repos/software/RIOT/tests/driver_sdcard_spi/bin/arduino-mega2560/tests_driver_sdcard_spi.elf

@cladmi cladmi deleted the 2018.07/pr/driver/sdcard_spi branch August 9, 2018 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: release backport Integration Process: The PR is a release backport of a change previously provided to master Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants