From owner-svn-src-all@freebsd.org Sat Apr 9 20:36:08 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F33F8B09680; Sat, 9 Apr 2016 20:36:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CA55B1396; Sat, 9 Apr 2016 20:36:08 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u39Ka7ir002362; Sat, 9 Apr 2016 20:36:07 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u39Ka7xL002357; Sat, 9 Apr 2016 20:36:07 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201604092036.u39Ka7xL002357@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Sat, 9 Apr 2016 20:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r297764 - in head: lib/libusb lib/libusbhid sys/dev/usb sys/dev/usb/net X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Apr 2016 20:36:09 -0000 Author: pfg Date: Sat Apr 9 20:36:07 2016 New Revision: 297764 URL: https://svnweb.freebsd.org/changeset/base/297764 Log: USB: replace 0 with NULL for pointers. Found with devel/coccinelle. Reviewed by: hselasky Modified: head/lib/libusb/libusb20.c head/lib/libusbhid/descr.c head/lib/libusbhid/usage.c head/sys/dev/usb/net/if_urndis.c head/sys/dev/usb/usb_transfer.c Modified: head/lib/libusb/libusb20.c ============================================================================== --- head/lib/libusb/libusb20.c Sat Apr 9 20:30:50 2016 (r297763) +++ head/lib/libusb/libusb20.c Sat Apr 9 20:36:07 2016 (r297764) @@ -139,8 +139,8 @@ libusb20_tr_close(struct libusb20_transf free(xfer->ppBuffer); } /* reset variable fields in case the transfer is opened again */ - xfer->priv_sc0 = 0; - xfer->priv_sc1 = 0; + xfer->priv_sc0 = NULL; + xfer->priv_sc1 = NULL; xfer->is_opened = 0; xfer->is_pending = 0; xfer->is_cancel = 0; Modified: head/lib/libusbhid/descr.c ============================================================================== --- head/lib/libusbhid/descr.c Sat Apr 9 20:30:50 2016 (r297763) +++ head/lib/libusbhid/descr.c Sat Apr 9 20:36:07 2016 (r297764) @@ -159,7 +159,7 @@ hid_use_report_desc(unsigned char *data, report_desc_t r; r = malloc(sizeof(*r) + size); - if (r == 0) { + if (r == NULL) { errno = ENOMEM; return (NULL); } Modified: head/lib/libusbhid/usage.c ============================================================================== --- head/lib/libusbhid/usage.c Sat Apr 9 20:30:50 2016 (r297763) +++ head/lib/libusbhid/usage.c Sat Apr 9 20:36:07 2016 (r297764) @@ -77,9 +77,9 @@ hid_init(const char *hidname) char line[100], name[100], *p, *n; int no; int lineno; - struct usage_page *curpage = 0; + struct usage_page *curpage = NULL; - if (hidname == 0) + if (hidname == NULL) hidname = _PATH_HIDTABLE; f = fopen(hidname, "r"); @@ -124,7 +124,7 @@ hid_init(const char *hidname) curpage->pagesize++; } else { if (npages >= npagesmax) { - if (pages == 0) { + if (pages == NULL) { npagesmax = 5; pages = malloc(npagesmax * sizeof (struct usage_page)); Modified: head/sys/dev/usb/net/if_urndis.c ============================================================================== --- head/sys/dev/usb/net/if_urndis.c Sat Apr 9 20:30:50 2016 (r297763) +++ head/sys/dev/usb/net/if_urndis.c Sat Apr 9 20:36:07 2016 (r297764) @@ -235,7 +235,7 @@ urndis_attach(device_t dev) cmd = usbd_find_descriptor(uaa->device, NULL, uaa->info.bIfaceIndex, UDESC_CS_INTERFACE, 0xFF, UDESCSUB_CDC_CM, 0xFF); - if (cmd != 0) { + if (cmd != NULL) { DPRINTF("Call Mode Descriptor found, dataif=%d\n", cmd->bDataInterface); iface_index[0] = cmd->bDataInterface; } Modified: head/sys/dev/usb/usb_transfer.c ============================================================================== --- head/sys/dev/usb/usb_transfer.c Sat Apr 9 20:30:50 2016 (r297763) +++ head/sys/dev/usb/usb_transfer.c Sat Apr 9 20:36:07 2016 (r297764) @@ -925,7 +925,7 @@ usbd_transfer_setup(struct usb_device *u DPRINTFN(6, "setup array has zero length!\n"); return (USB_ERR_INVAL); } - if (ifaces == 0) { + if (ifaces == NULL) { DPRINTFN(6, "ifaces array is NULL!\n"); return (USB_ERR_INVAL); }