[haiku-commits] Re: haiku: hrev48919 - src/add-ons/kernel/busses/scsi/ahci

  • From: John Scipione <jscipione@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 19 Mar 2015 16:19:30 -0400

On Mar 19, 2015, at 12:56 PM, jerome.duval@xxxxxxxxx wrote:
> 
> ----------------------------------------------------------------------------
> 
> diff --git a/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp 
> b/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp
> index e94b576..b86e756 100644
> --- a/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp
> +++ b/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp
> @@ -210,11 +210,12 @@ AHCIController::Init()
>               TRACE("cap2: BIOS/OS Handoff: %s\n",
>                       (fRegs->cap2 & CAP2_BOH) ? "yes" : "no");
>       }
> -     TRACE("ghc: AHCI Enable: %s\n",                                         
> (fRegs->ghc & GHC_AE) ? "yes" : "no");
> -     TRACE("Ports Implemented Mask: %#08" B_PRIx32 "\n",     
> fPortImplementedMask);
> -     TRACE("Number of Available Ports: %d\n",                        
> count_bits_set(fPortImplementedMask));
> -     TRACE("AHCI Version %" B_PRIu32 ".%" B_PRIu32 "\n",     fRegs->vs >> 
> 16, fRegs->vs & 0xff);
> -     TRACE("Interrupt %u\n",                                                 
>         fIRQ);
> +     TRACE("ghc: AHCI Enable: %s\n", (fRegs->ghc & GHC_AE) ? "yes" : "no");
> +     TRACE("Ports Implemented Mask: %#08" B_PRIx32 " Number of Available 
> Ports:"
> +             " %d\n", fPortImplementedMask, 
> count_bits_set(fPortImplementedMask));
> +     TRACE("AHCI Version %02x%02x.%02x.%02x Interrupt %u\n", fRegs->vs >> 24,
> +             (fRegs->vs >> 16) & 0xff, (fRegs->vs >> 8) & 0xff, fRegs->vs & 
> 0xff,
> +             fIRQ);
> 
>       // setup interrupt handler
>       if (install_io_interrupt_handler(fIRQ, Interrupt, this, 0) < B_OK) {

This commit is producing warnings that is holding up the build. To fix I 
replaced the x and u with B_PRIx32 and B_PRIu8 respectively.

Patch to fix below:


From 5aa323da54e0fbb0174ababd67a3b31cee263c8a Mon Sep 17 00:00:00 2001
From: John Scipione <jscipione@xxxxxxxxx>
Date: Thu, 19 Mar 2015 16:01:25 -0400
Subject: [PATCH] Build fix (for me at least)

Warnings were causing my build to fail based on mix-matched format string
and argument types. Fix was to use B_PRI* defines in the format string.
---
 src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp 
b/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp
index b86e756..0461a5f 100644
--- a/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp
+++ b/src/add-ons/kernel/busses/scsi/ahci/ahci_controller.cpp
@@ -213,7 +213,8 @@ AHCIController::Init()
        TRACE("ghc: AHCI Enable: %s\n", (fRegs->ghc & GHC_AE) ? "yes" : "no");
        TRACE("Ports Implemented Mask: %#08" B_PRIx32 " Number of Available 
Ports:"
                " %d\n", fPortImplementedMask, 
count_bits_set(fPortImplementedMask));
-       TRACE("AHCI Version %02x%02x.%02x.%02x Interrupt %u\n", fRegs->vs >> 24,
+       TRACE("AHCI Version %02" B_PRIx32 "%02" B_PRIx32 ".%02" B_PRIx32 ".%02"
+               B_PRIx32 " Interrupt %" B_PRIu8 "\n", fRegs->vs >> 24,
                (fRegs->vs >> 16) & 0xff, (fRegs->vs >> 8) & 0xff, fRegs->vs & 
0xff,
                fIRQ);
 
-- 
1.9.5 (Apple Git-50.3)



Other related posts: