Author: smh
Date: Mon Jan 18 12:02:05 2016
New Revision: 294265
URL: https://svnweb.freebsd.org/changeset/base/294265

Log:
  Fix EFI_DEBUG option
  
  Fix broken DPRINTF and wire up EFI_DEBUG so -DEFI_DEBUG to make works.
  
  MFC after:    2 weeks
  X-MFC-With:   r293268
  Sponsored by: Multiplay

Modified:
  head/sys/boot/efi/boot1/Makefile
  head/sys/boot/efi/boot1/boot_module.h
  head/sys/boot/efi/boot1/zfs_module.c

Modified: head/sys/boot/efi/boot1/Makefile
==============================================================================
--- head/sys/boot/efi/boot1/Makefile    Mon Jan 18 11:51:41 2016        
(r294264)
+++ head/sys/boot/efi/boot1/Makefile    Mon Jan 18 12:02:05 2016        
(r294265)
@@ -33,6 +33,9 @@ CFLAGS+=      -I${.CURDIR}/../include/${MACHI
 CFLAGS+=       -I${.CURDIR}/../../../contrib/dev/acpica/include
 CFLAGS+=       -I${.CURDIR}/../../..
 CFLAGS+=       -DEFI_UFS_BOOT
+.ifdef(EFI_DEBUG)
+CFLAGS+=       -DEFI_DEBUG
+.endif
 
 .if ${MK_ZFS} != "no"
 CFLAGS+=       -I${.CURDIR}/../../zfs/

Modified: head/sys/boot/efi/boot1/boot_module.h
==============================================================================
--- head/sys/boot/efi/boot1/boot_module.h       Mon Jan 18 11:51:41 2016        
(r294264)
+++ head/sys/boot/efi/boot1/boot_module.h       Mon Jan 18 12:02:05 2016        
(r294265)
@@ -36,12 +36,9 @@
 #include <eficonsctl.h>
 
 #ifdef EFI_DEBUG
-#define DPRINTF(fmt, args...) \
-        do { \
-                printf(fmt, ##args) \
-        } while (0)
+#define DPRINTF(fmt, ...) printf(fmt, __VA_ARGS__)
 #else
-#define DPRINTF(fmt, args...) {}
+#define DPRINTF(fmt, ...) {}
 #endif
 
 /* EFI device info */

Modified: head/sys/boot/efi/boot1/zfs_module.c
==============================================================================
--- head/sys/boot/efi/boot1/zfs_module.c        Mon Jan 18 11:51:41 2016        
(r294264)
+++ head/sys/boot/efi/boot1/zfs_module.c        Mon Jan 18 12:02:05 2016        
(r294265)
@@ -53,9 +53,9 @@ vdev_read(vdev_t *vdev, void *priv, off_
        status = devinfo->dev->ReadBlocks(devinfo->dev,
            devinfo->dev->Media->MediaId, lba, bytes, buf);
        if (status != EFI_SUCCESS) {
-               DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %lu, size: %d,"
+               DPRINTF("vdev_read: failed dev: %p, id: %u, lba: %zu, size: 
%zu,"
                     " status: %lu\n", devinfo->dev,
-                    devinfo->dev->Media->MediaId, lba, size,
+                    devinfo->dev->Media->MediaId, lba, bytes,
                     EFI_ERROR_CODE(status));
                return (-1);
        }
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to