Page MenuHomeFreeBSD

Fix compile errors in altera_sdcard_io.c after r357647
AbandonedPublic

Authored by dim on Feb 17 2020, 6:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Nov 8 2023, 12:34 PM
Unknown Object (File)
Nov 2 2023, 1:02 AM
Unknown Object (File)
Oct 7 2023, 11:30 AM
Unknown Object (File)
Oct 1 2023, 1:01 AM
Unknown Object (File)
Sep 22 2023, 8:42 PM
Unknown Object (File)
Sep 11 2023, 8:29 PM
Unknown Object (File)
Jun 3 2023, 8:12 AM
Unknown Object (File)
May 14 2023, 6:48 PM
Subscribers
None

Details

Summary

After rS357647, building universe results in compilation errors for
_.mips.BERI_DE4_SDROOT:

sys/dev/altera/sdcard/altera_sdcard_io.c: In function 'altera_sdcard_io_start_internal':
sys/dev/altera/sdcard/altera_sdcard_io.c:299:13: error: '*bp' is a pointer; did you mean to use '->'?
  switch (*bp->bio_cmd) {
             ^~
             ->
sys/dev/altera/sdcard/altera_sdcard_io.c:301:38: error: '*bp' is a pointer; did you mean to use '->'?
   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
                                      ^~
                                      ->
sys/dev/altera/sdcard/altera_sdcard_io.c:307:42: error: '*bp' is a pointer; did you mean to use '->'?
   altera_sdcard_write_rxtx_buffer(sc, *bp->bio_data,
                                          ^~
                                          ->
sys/dev/altera/sdcard/altera_sdcard_io.c:308:10: error: '*bp' is a pointer; did you mean to use '->'?
       *bp->bio_bcount);
          ^~
          ->
sys/dev/altera/sdcard/altera_sdcard_io.c:309:38: error: '*bp' is a pointer; did you mean to use '->'?
   altera_sdcard_write_cmd_arg(sc, *bp->bio_pblkno *
                                      ^~
                                      ->
sys/dev/altera/sdcard/altera_sdcard_io.c: In function 'altera_sdcard_io_start':
sys/dev/altera/sdcard/altera_sdcard_io.c:336:20: error: incompatible types when assigning to type 'struct bio *' from type 'struct bio'
  sc->as_currentbio = *bp;
                    ^

The first few are because -> has a higher precedence than *, so the
expressions should use (*bp)->foo instead. I also renamed the
variable to bpp to make it clearer that it is a pointer-to-pointer.

The last one is because sc->as_currentbio is already a struct bio *,
there is no need to dereference bp there.

Last but not least, I would really suggest rewriting the
altera_sdcard_io_start_internal() function to just return success or
failure, so the caller can decide to set bp to NULL.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29449
Build 27326: arc lint + arc unit