bin/71615: [usb] [patch] cleanup of the usr.sbin/usbd code

Craig Rodrigues rodrigc at crodrigues.org
Fri Nov 5 09:50:28 PST 2004


The following reply was made to PR bin/71615; it has been noted by GNATS.

From: Craig Rodrigues <rodrigc at crodrigues.org>
To: freebsd-gnats-submit at FreeBSD.org
Cc: dan at obluda.cz
Subject: Re: bin/71615: [usb] [patch] cleanup of the usr.sbin/usbd code
Date: Fri, 5 Nov 2004 12:49:55 -0500

 Hi,
 
 This patch works with intmax_t, so should make
 64-bit and 32-bit platforms happy. :)
 
 
 
 
 --- usbd.c.orig	Fri Nov  5 12:12:00 2004
 +++ usbd.c	Fri Nov  5 12:44:59 2004
 @@ -54,6 +54,7 @@
  #include <ctype.h>
  #include <signal.h>
  #include <paths.h>
 +#include <stdint.h>
  #include <sys/param.h>
  #include <sys/types.h>
  #include <sys/errno.h>
 @@ -583,8 +584,8 @@
  	    event->ue_type == USB_EVENT_DEVICE_DETACH) {
  		devinfo = &event->u.ue_device;
  
 -		printf(" at %ld.%09ld, %s, %s:\n",
 -			timespec->tv_sec, timespec->tv_nsec,
 +		printf(" at %jd.%09ld, %s, %s:\n",
 +			(intmax_t)timespec->tv_sec, timespec->tv_nsec,
  			devinfo->udi_product, devinfo->udi_vendor);
  
  		printf("  vndr=0x%04x prdct=0x%04x rlse=0x%04x "
 @@ -607,12 +608,12 @@
  		}
  	} else if (event->ue_type == USB_EVENT_CTRLR_ATTACH ||
  	    event->ue_type == USB_EVENT_CTRLR_DETACH) {
 -		printf(" bus=%d", &event->u.ue_ctrlr.ue_bus);
 +		printf(" bus=%d", event->u.ue_ctrlr.ue_bus);
  	} else if (event->ue_type == USB_EVENT_DRIVER_ATTACH ||
  	    event->ue_type == USB_EVENT_DRIVER_DETACH) {
  		printf(" cookie=%u devname=%s",
 -		    &event->u.ue_driver.ue_cookie.cookie,
 -		    &event->u.ue_driver.ue_devname);
 +		    event->u.ue_driver.ue_cookie.cookie,
 +		    event->u.ue_driver.ue_devname);
  	}
  	printf("\n");
  }
 
 
 
 
 
 -- 
 Craig Rodrigues        
 http://crodrigues.org
 rodrigc at crodrigues.org


More information about the freebsd-usb mailing list