amd64 - mpt(4) should use {,u}int32_t for S32/U32
authorYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Mon, 5 Oct 2009 01:04:20 +0000 (10:04 +0900)
committerYONETANI Tomokazu <y0netan1@dragonflybsd.org>
Mon, 5 Oct 2009 01:04:20 +0000 (10:04 +0900)
or else it uses {,un}signed long type which is of 64bits on 64-bit platforms.

sys/dev/disk/mpt/mpilib/mpi_type.h
sys/dev/disk/mpt/mpt.c
sys/dev/disk/mpt/mpt_debug.c

index 25c3a6a..69271d6 100644 (file)
@@ -77,7 +77,7 @@ typedef unsigned char   U8;
 typedef signed   short  S16;
 typedef unsigned short  U16;
 
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__DragonFly__)
 
 typedef int32_t  S32;
 typedef uint32_t U32;
index adf171b..c9faea7 100644 (file)
@@ -336,7 +336,7 @@ mpt_stdready(struct mpt_softc *mpt)
 int
 mpt_stdevent(struct mpt_softc *mpt, request_t *req, MSG_EVENT_NOTIFY_REPLY *msg)
 {
-       mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_stdevent: 0x%lx\n",
+       mpt_lprt(mpt, MPT_PRT_DEBUG, "mpt_stdevent: 0x%x\n",
                 msg->Event & 0xFF);
        /* Event was not for us. */
        return (0);
index cead147..e585e3c 100644 (file)
@@ -448,31 +448,31 @@ mpt_print_event_notice(MSG_EVENT_NOTIFY_REPLY *msg)
        case MPI_EVENT_IOC_BUS_RESET:
        case MPI_EVENT_EXT_BUS_RESET:
        case MPI_EVENT_RESCAN:
-               kprintf("\tPort:           %lu\n",
+               kprintf("\tPort:           %u\n",
                        (msg->Data[0] >> 8) & 0xff);
                break;
 
        case MPI_EVENT_LINK_STATUS_CHANGE:
-               kprintf("\tLinkState:    %lu\n",
+               kprintf("\tLinkState:    %u\n",
                        msg->Data[0] & 0xff);
-               kprintf("\tPort:         %lu\n",
+               kprintf("\tPort:         %u\n",
                        (msg->Data[1] >> 8) & 0xff);
                break;
 
        case MPI_EVENT_LOOP_STATE_CHANGE:
-               kprintf("\tType:         %lu\n",
+               kprintf("\tType:         %u\n",
                        (msg->Data[0] >> 16) & 0xff);
-               kprintf("\tChar3:      0x%02lx\n",
+               kprintf("\tChar3:      0x%02x\n",
                        (msg->Data[0] >> 8) & 0xff);
-               kprintf("\tChar4:      0x%02lx\n",
+               kprintf("\tChar4:      0x%02x\n",
                        (msg->Data[0]     ) & 0xff);
-               kprintf("\tPort:         %lu\n",
+               kprintf("\tPort:         %u\n",
                        (msg->Data[1] >> 8) & 0xff);
                break;
 
        case MPI_EVENT_LOGOUT:
-               kprintf("\tN_PortId:   0x%04lx\n", msg->Data[0]);
-               kprintf("\tPort:         %lu\n",
+               kprintf("\tN_PortId:   0x%04x\n", msg->Data[0]);
+               kprintf("\tPort:         %u\n",
                        (msg->Data[1] >> 8) & 0xff);
                break;
        }