cpu/nrf52: Uncrustified and fixed static-check issues

--- cpu/nrf52/periph/usbdev.c
+++ cpu/nrf52/periph/usbdev.c
@@ -112,6 +112,8 @@
     *(volatile uint32_t *)0x4006EC00 = 0x00009375;

     /* Enable peripheral a second time */
+    /* cppcheck-suppress redundantAssignment
+     * (reason: re-enabled as per nordic instructions for this errata) */
     usbdev->device->ENABLE = USBD_ENABLE_ENABLE_Msk;
 }

@@ -129,7 +131,8 @@

 static void _ep_set_address(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_OUT) {
         usbdev->device->EPOUT[ep->num].PTR = (uint32_t)ep->buf;
     }
@@ -140,8 +143,9 @@

 static void _copy_setup(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
-    usb_setup_t *setup = (usb_setup_t*)ep->buf;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+    usb_setup_t *setup = (usb_setup_t *)ep->buf;
+
     setup->type = usbdev->device->BMREQUESTTYPE;
     setup->request = usbdev->device->BREQUEST;
     setup->value = usbdev->device->WVALUEL | usbdev->device->WVALUEH << 8;
@@ -158,7 +162,8 @@
 static int _ep_set_size(usbdev_ep_t *ep)
 {
     /* TODO: validate size */
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_OUT) {
         usbdev->device->EPOUT[ep->num].MAXCNT = (uint32_t)ep->len;
     }
@@ -168,7 +173,8 @@
 static void _ep_enable(usbdev_ep_t *ep)
 {
     DEBUG("Enabling endpoint %u dir %s\n", ep->num, ep->dir == USB_EP_DIR_OUT ? "OUT" : "IN");
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_OUT) {
         usbdev->device->EPOUTEN |= 1 << ep->num;
     }
@@ -181,7 +187,8 @@
 {
     /* TODO: validate size */
     DEBUG("disabling endpoint %u dir %s\n", ep->num, ep->dir == USB_EP_DIR_OUT ? "OUT" : "IN");
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_OUT) {
         usbdev->device->EPOUTEN &= ~(1 << ep->num);
     }
@@ -193,17 +200,19 @@
 static void _ep_set_stall(usbdev_ep_t *ep, usbopt_enable_t enable)
 {
     /* TODO: validate size */
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
     uint32_t val = (ep->num & USBD_EPSTALL_EP_Msk) |
-                    (ep->dir == USB_EP_DIR_IN ? USBD_EPSTALL_IO_Msk : 0) |
-                    (enable ? USBD_EPSTALL_STALL_Msk : 0);
+                   (ep->dir == USB_EP_DIR_IN ? USBD_EPSTALL_IO_Msk : 0) |
+                   (enable ? USBD_EPSTALL_STALL_Msk : 0);
+
     usbdev->device->EPSTALL = val;
 }

 static usbopt_enable_t _ep_get_stall(usbdev_ep_t *ep)
 {
     /* TODO: validate size */
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_OUT) {
         return usbdev->device->HALTED.EPOUT[ep->num] ? USBOPT_ENABLE
                                                      : USBOPT_DISABLE;
@@ -217,7 +226,8 @@
 static size_t _ep_get_available(usbdev_ep_t *ep)
 {
     /* TODO: validate size */
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_OUT) {
         return usbdev->device->SIZE.EPOUT[ep->num];
     }
@@ -228,7 +238,8 @@

 static void _ep_dma_out(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     assert(ep->dir == USB_EP_DIR_OUT);
     _enable_errata_199();
     usbdev->device->TASKS_STARTEPOUT[ep->num] = 1;
@@ -241,7 +252,8 @@

 static void _ep_dma_in(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     assert(ep->dir == USB_EP_DIR_IN);
     _enable_errata_199();
     usbdev->device->TASKS_STARTEPIN[ep->num] = 1;
@@ -270,9 +282,10 @@
 {
     DEBUG("nrfusb: initializing\n");
     /* Engineering revision version A is affected by errata 94, crash *
-     * instead of pretending to have functional USB                   */
+    * instead of pretending to have functional USB                   */
     assert(NRF_FICR->INFO.VARIANT != 0x41414141);
-    nrfusb_t *usbdev = (nrfusb_t*)dev;
+    nrfusb_t *usbdev = (nrfusb_t *)dev;
+
     poweron(usbdev);
     usbdev->used = 0;
     usbdev->sstate = NRFUSB_SETUP_READY;
@@ -289,51 +302,57 @@
     (void)usbdev;
     (void)max_len;
     int res = -ENOTSUP;
+
     switch (opt) {
-        case USBOPT_MAX_VERSION:
-            assert(max_len == sizeof(usb_version_t));
-            *(usb_version_t *)value = USB_VERSION_20;
-            res = sizeof(usb_version_t);
-            break;
-        case USBOPT_MAX_SPEED:
-            assert(max_len == sizeof(usb_speed_t));
-            *(usb_speed_t *)value = USB_SPEED_FULL;
-            res = sizeof(usb_speed_t);
-            break;
-        default:
-            DEBUG("unhandled get call: 0x%x\n", opt);
-            break;
+    case USBOPT_MAX_VERSION:
+        assert(max_len == sizeof(usb_version_t));
+        *(usb_version_t *)value = USB_VERSION_20;
+        res = sizeof(usb_version_t);
+        break;
+    case USBOPT_MAX_SPEED:
+        assert(max_len == sizeof(usb_speed_t));
+        *(usb_speed_t *)value = USB_SPEED_FULL;
+        res = sizeof(usb_speed_t);
+        break;
+    default:
+        DEBUG("unhandled get call: 0x%x\n", opt);
+        break;
     }
     return res;
 }

 static int _set(usbdev_t *dev, usbopt_t opt,
-               const void *value, size_t value_len)
-{
-    nrfusb_t *usbdev = (nrfusb_t*)dev;
+                const void *value, size_t value_len)
+{
+    nrfusb_t *usbdev = (nrfusb_t *)dev;
+
     (void)value_len;
     int res = -ENOTSUP;
+
     switch (opt) {
-        case USBOPT_ATTACH:
-            assert(value_len == sizeof(usbopt_enable_t));
-            if (*((usbopt_enable_t *)value)) {
-                usb_attach(usbdev);
-            }
-            else {
-                usb_detach(usbdev);
-            }
-            res = sizeof(usbopt_enable_t);
-            break;
-        default:
-            DEBUG("Unhandled set call: 0x%x\n", opt);
-            break;
+    case USBOPT_ATTACH:
+        assert(value_len == sizeof(usbopt_enable_t));
+        if (*((usbopt_enable_t *)value)) {
+            usb_attach(usbdev);
+        }
+        else {
+            usb_detach(usbdev);
+        }
+        res = sizeof(usbopt_enable_t);
+        break;
+    default:
+        DEBUG("Unhandled set call: 0x%x\n", opt);
+        break;
     }
     return res;
 }

-static usbdev_ep_t *_new_ep(usbdev_t *dev, usb_ep_type_t type, usb_ep_dir_t dir, size_t buf_len)
-{
-    nrfusb_t *usbdev = (nrfusb_t*)dev;
+static usbdev_ep_t *_new_ep(usbdev_t *dev,
+                            usb_ep_type_t type,
+                            usb_ep_dir_t dir,
+                            size_t buf_len)
+{
+    nrfusb_t *usbdev = (nrfusb_t *)dev;
     /* The IP supports all types for all endpoints */
     usbdev_ep_t *res = NULL;

@@ -355,7 +374,9 @@
     if (res) {
         res->dev = dev;
         res->dir = dir;
-        DEBUG("nrfusb: Allocated new ep (%d %s)\n", res->num, res->dir == USB_EP_DIR_OUT ? "OUT" : "IN");
+        DEBUG("nrfusb: Allocated new ep (%d %s)\n",
+              res->num,
+              res->dir == USB_EP_DIR_OUT ? "OUT" : "IN");
         if (usbdev->used + buf_len < NRF_USB_BUF_SPACE) {
             res->buf = usbdev->buffer + usbdev->used;
             res->len = buf_len;
@@ -376,7 +397,8 @@

 static void _ep_enable_irq(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_IN) {
         if (ep->num == 0) {
             usbdev->device->INTENSET = USBD_INTENSET_EP0DATADONE_Msk;
@@ -391,7 +413,8 @@

 static void _ep_disable_irq(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_IN) {
         if (ep->num == 0) {
             usbdev->device->INTENCLR = USBD_INTENCLR_EP0DATADONE_Msk;
@@ -406,7 +429,8 @@

 static void _ep_init(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     _ep_set_size(ep);
     _ep_set_address(ep);
     if (ep->num == 0) {
@@ -423,67 +447,70 @@
 }

 static int _ep_get(usbdev_ep_t *ep, usbopt_ep_t opt,
-                  void *value, size_t max_len)
+                   void *value, size_t max_len)
 {
     (void)max_len;
     int res = -ENOTSUP;
+
     switch (opt) {
-        case USBOPT_EP_STALL:
-            assert(max_len == sizeof(usbopt_enable_t));
-            *(usbopt_enable_t *)value = _ep_get_stall(ep);
-            res = sizeof(usbopt_enable_t);
-            break;
-        case USBOPT_EP_AVAILABLE:
-            assert(max_len == sizeof(size_t));
-            *(size_t *)value = _ep_get_available(ep);
-            res = sizeof(size_t);
-            break;
-        default:
-            DEBUG("Unhandled get call: 0x%x\n", opt);
-            break;
+    case USBOPT_EP_STALL:
+        assert(max_len == sizeof(usbopt_enable_t));
+        *(usbopt_enable_t *)value = _ep_get_stall(ep);
+        res = sizeof(usbopt_enable_t);
+        break;
+    case USBOPT_EP_AVAILABLE:
+        assert(max_len == sizeof(size_t));
+        *(size_t *)value = _ep_get_available(ep);
+        res = sizeof(size_t);
+        break;
+    default:
+        DEBUG("Unhandled get call: 0x%x\n", opt);
+        break;
     }
     return res;
 }

 static int _ep_set(usbdev_ep_t *ep, usbopt_ep_t opt,
-                  const void *value, size_t value_len)
+                   const void *value, size_t value_len)
 {
     (void)value_len;
     int res = -ENOTSUP;
+
     switch (opt) {
-        case USBOPT_EP_ENABLE:
-            assert(value_len == sizeof(usbopt_enable_t));
-            if (*((usbopt_enable_t *)value)) {
-                _ep_enable(ep);
-                _ep_init(ep);
-            }
-            else {
-                _ep_disable(ep);
-            }
+    case USBOPT_EP_ENABLE:
+        assert(value_len == sizeof(usbopt_enable_t));
+        if (*((usbopt_enable_t *)value)) {
+            _ep_enable(ep);
+            _ep_init(ep);
+        }
+        else {
+            _ep_disable(ep);
+        }
+        res = sizeof(usbopt_enable_t);
+        break;
+    case USBOPT_EP_STALL:
+        assert(value_len == sizeof(usbopt_enable_t));
+        _ep_set_stall(ep, *(usbopt_enable_t *)value);
+        res = sizeof(usbopt_enable_t);
+        break;
+    case USBOPT_EP_READY:
+        assert(value_len == sizeof(usbopt_enable_t));
+        if (*((usbopt_enable_t *)value)) {
+            _ep_ready(ep, 0);
             res = sizeof(usbopt_enable_t);
-            break;
-        case USBOPT_EP_STALL:
-            assert(value_len == sizeof(usbopt_enable_t));
-            _ep_set_stall(ep, *(usbopt_enable_t *)value);
-            res = sizeof(usbopt_enable_t);
-            break;
-        case USBOPT_EP_READY:
-            assert(value_len == sizeof(usbopt_enable_t));
-            if (*((usbopt_enable_t *)value)) {
-                _ep_ready(ep, 0);
-                res = sizeof(usbopt_enable_t);
-            }
-            break;
-        default:
-            DEBUG("Unhandled set call: 0x%x\n", opt);
-            break;
+        }
+        break;
+    default:
+        DEBUG("Unhandled set call: 0x%x\n", opt);
+        break;
     }
     return res;
 }

 static int _ep0_ready(usbdev_ep_t *ep, size_t len)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->dir == USB_EP_DIR_IN) {
         if (len == 0 && usbdev->sstate == NRFUSB_SETUP_WRITE) {
             usbdev->device->TASKS_EP0STATUS = 1;
@@ -512,7 +539,8 @@

 static int _ep_ready(usbdev_ep_t *ep, size_t len)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
+
     if (ep->num == 0) {
         /* Endpoint 0 requires special handling as per datasheet sec 6.35.9 */
         return _ep0_ready(ep, len);
@@ -531,7 +559,8 @@

 static void _esr(usbdev_t *dev)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)dev;
+    nrfusb_t *usbdev = (nrfusb_t *)dev;
+
     if (usbdev->device->EVENTS_USBRESET) {
         DEBUG("nrfusb: reset condition\n");
         usbdev->device->EVENTS_USBRESET = 0;
@@ -556,8 +585,9 @@

 static signed _ep0_esr(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
     signed event = -1;
+
     if (ep->dir == USB_EP_DIR_OUT) {
         if (usbdev->sstate == NRFUSB_SETUP_ACKOUT) {
             usbdev->sstate = NRFUSB_SETUP_READY;
@@ -593,8 +623,9 @@

 static void _ep_esr(usbdev_ep_t *ep)
 {
-    nrfusb_t *usbdev = (nrfusb_t*)ep->dev;
+    nrfusb_t *usbdev = (nrfusb_t *)ep->dev;
     signed event = -1;
+
     if (ep->num == 0) {
         event = _ep0_esr(ep);
     }
@@ -628,14 +659,15 @@
 {
     /* Only one usb peripheral possible at the moment */
     nrfusb_t *usbdev = &_usbdevs[0];
+
     /* Generic USB peripheral events */
     if (usbdev->device->EVENTS_USBRESET &&
-            (usbdev->device->INTEN & USBD_INTEN_USBRESET_Msk)) {
+        (usbdev->device->INTEN & USBD_INTEN_USBRESET_Msk)) {
         usbdev->device->INTENCLR = USBD_INTENCLR_USBRESET_Msk;
         usbdev->usbdev.cb(&usbdev->usbdev, USBDEV_EVENT_ESR);
     }
     else if (usbdev->device->EVENTS_USBEVENT &&
-            (usbdev->device->INTEN & USBD_INTEN_USBEVENT_Msk)) {
+             (usbdev->device->INTEN & USBD_INTEN_USBEVENT_Msk)) {
         usbdev->device->INTENCLR = USBD_INTENCLR_USBEVENT_Msk;
         usbdev->usbdev.cb(&usbdev->usbdev, USBDEV_EVENT_ESR);
     }
@@ -643,12 +675,12 @@
         /* Endpoint specific isr handling*/
         /* Endpoint 0 SETUP data received requests */
         if (usbdev->device->EVENTS_EP0SETUP &&
-                (usbdev->device->INTEN & USBD_INTEN_EP0SETUP_Msk)) {
+            (usbdev->device->INTEN & USBD_INTEN_EP0SETUP_Msk)) {
             usbdev->usbdev.epcb(_get_ep_out(usbdev, 0), USBDEV_EVENT_ESR);
             _ep_disable_irq(_get_ep_out(usbdev, 0));
         }
         if (usbdev->device->EVENTS_EP0DATADONE &&
-                (usbdev->device->INTEN & USBD_INTEN_EP0DATADONE_Msk)) {
+            (usbdev->device->INTEN & USBD_INTEN_EP0DATADONE_Msk)) {
             if (usbdev->sstate == NRFUSB_SETUP_READ) {
                 usbdev->usbdev.epcb(_get_ep_in(usbdev, 0), USBDEV_EVENT_ESR);
                 _ep_disable_irq(_get_ep_in(usbdev, 0));
@@ -668,14 +700,14 @@
                     if (ep->type != USB_EP_TYPE_NONE) {
                         /* OUT type endpoint */
                         usbdev->usbdev.epcb(ep,
-                                USBDEV_EVENT_ESR);
+                                            USBDEV_EVENT_ESR);
                     }
                 }
                 else {
                     usbdev_ep_t *ep = _get_ep_in(usbdev, epnum);
                     if (ep->type != USB_EP_TYPE_NONE) {
                         usbdev->usbdev.epcb(ep,
-                                USBDEV_EVENT_ESR);
+                                            USBDEV_EVENT_ESR);
                     }
                 }
                 epdatastatus &= ~(1 << epnum);


USB: Fix USB3.0 Port Speed Downgrade after port reset

Without this fix, a USB 3.0 port is downgraded to full speed after a port
reset of a configured device.  The USB 3.0 terminations will be disabled
permanently, and USB 3.0 devices will always enumerate as full speed
devices, until the host controller is unplugged (if it is an ExpressCard)
or the computer is rebooted.

Fajun Chen traced this traced the speed downgrade issue to the port reset
and the interpretation of port status in USB hub driver code.  The hub
code was not testing for the port being a SuperSpeed port, and it fell
through to the else case of Full Speed.

The following patch adds SuperSpeed mapping from the port status, and
fixes the speed downgrade issue.

Reported-by: Fajun Chen <b1869163cc4b58f15c6d470c8240d39f28c88dc9@seagate.com>
Signed-off-by: Sarah Sharp <d4c4fc5069677be84f589aa6e14eedffef9ba12f@linux.intel.com>
Cc: stable <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/core/hub.c
+++ drivers/usb/core/hub.c
@@ -1982,6 +1982,8 @@
 		    (portstatus & USB_PORT_STAT_ENABLE)) {
 			if (hub_is_wusb(hub))
 				udev->speed = USB_SPEED_WIRELESS;
+			else if (portstatus & USB_PORT_STAT_SUPER_SPEED)
+				udev->speed = USB_SPEED_SUPER;
 			else if (portstatus & USB_PORT_STAT_HIGH_SPEED)
 				udev->speed = USB_SPEED_HIGH;
 			else if (portstatus & USB_PORT_STAT_LOW_SPEED)


drivers: gpu: Mark functions as static in mgag200_ttm.c

Mark functions mgag200_ttm_global_release(),
mgag200_ttm_bo_is_mgag200_bo() and mgag200_ttm_tt_create() as static in
drm/mgag200/mgag200_ttm.c because they are not used outside this file.

This eliminates the following warning in drm/mgag200/mgag200_ttm.c:
drivers/gpu/drm/mgag200/mgag200_ttm.c:84:1: warning: no previous prototype for ‘mgag200_ttm_global_release’ [-Wmissing-prototypes]
drivers/gpu/drm/mgag200/mgag200_ttm.c:105:6: warning: no previous prototype for ‘mgag200_ttm_bo_is_mgag200_bo’ [-Wmissing-prototypes]
drivers/gpu/drm/mgag200/mgag200_ttm.c:211:16: warning: no previous prototype for ‘mgag200_ttm_tt_create’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <62a2cbd3422b0d621dafb7ceeff40187aeaed4ed@gmail.com>
Reviewed-by: Josh Triplett <c028c213ed5efcf30c3f4fc7361dbde0c893c5b7@joshtriplett.org>
Signed-off-by: Dave Airlie <f2295d84e358395675bc8031be58672073ae065e@redhat.com>

--- drivers/gpu/drm/mgag200/mgag200_ttm.c
+++ drivers/gpu/drm/mgag200/mgag200_ttm.c
@@ -80,7 +80,7 @@
 	return 0;
 }

-void
+static void
 mgag200_ttm_global_release(struct mga_device *ast)
 {
 	if (ast->ttm.mem_global_ref.release == NULL)
@@ -102,7 +102,7 @@
 	kfree(bo);
 }

-bool mgag200_ttm_bo_is_mgag200_bo(struct ttm_buffer_object *bo)
+static bool mgag200_ttm_bo_is_mgag200_bo(struct ttm_buffer_object *bo)
 {
 	if (bo->destroy == &mgag200_bo_ttm_destroy)
 		return true;
@@ -208,7 +208,7 @@
 };

-struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev,
+static struct ttm_tt *mgag200_ttm_tt_create(struct ttm_bo_device *bdev,
 				 unsigned long size, uint32_t page_flags,
 				 struct page *dummy_read_page)
 {


[GISel]: Missed checking if it's okay to create a G_CONSTANT of DstTy in the legalizationCombiner

git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@316694 91177308-0d34-0410-b5e6-96231b3b80d8
(cherry picked from commit 6b9f2f63454239c89cde6ff4ded6bc576434b83c)

--- include/llvm/CodeGen/GlobalISel/LegalizerCombiner.h
+++ include/llvm/CodeGen/GlobalISel/LegalizerCombiner.h
@@ -88,7 +88,8 @@
       unsigned DstReg = MI.getOperand(0).getReg();
       LLT DstTy = MRI.getType(DstReg);
       if (isInstUnsupported(TargetOpcode::G_SHL, DstTy) ||
-          isInstUnsupported(TargetOpcode::G_ASHR, DstTy))
+          isInstUnsupported(TargetOpcode::G_ASHR, DstTy) ||
+          isInstUnsupported(TargetOpcode::G_CONSTANT, DstTy))
         return false;
       DEBUG(dbgs() << ".. Combine MI: " << MI;);
       Builder.setInstr(MI);


removed: superfluous casts to bool

removed: superfluous casts to bool

--- include/BALL/MATHS/box3.h
+++ include/BALL/MATHS/box3.h
@@ -1,4 +1,4 @@
-// $Id: box3.h,v 1.5 2000/01/16 17:28:40 oliver Exp $
+// $Id: box3.h,v 1.6 2000/02/16 17:06:11 oliver Exp $

 #ifndef BALL_MATHS_BOX3_H
 #define BALL_MATHS_BOX3_H
@@ -324,21 +324,21 @@
 	BALL_INLINE
 	bool TBox3<T>::operator == (const TBox3<T>& box) const
 	{
-		return (bool)(a == box.a && b == box.b);
+		return (a == box.a && b == box.b);
 	}

 	template <class T>
 	BALL_INLINE
 	bool TBox3<T>::operator != (const TBox3<T> &box) const
 	{
-		return (bool)!(*this == box);
+		return !(*this == box);
 	}

 	template <class T>
 	BALL_INLINE
 	bool TBox3<T>::isValid() const
 	{
-		return (bool)(a.isValid() && b.isValid());
+		return (a.isValid() && b.isValid());
 	}

 	template <class T>


Added code to Windows version of launcher to provide better diagnosis of why exceptions are raised.

--- src/CLSmith/cl_launcher.c
+++ src/CLSmith/cl_launcher.c
@@ -15,9 +15,22 @@
 #ifdef _MSC_VER
 #include <windows.h>
 #include <rtcapi.h>
+
+bool build_in_progress = false;
+bool execution_in_progress = false;
+
 int exception_handler(LPEXCEPTION_POINTERS p)
 {
-    printf("Exception detected during test execution!");
+    printf("Exception detected during test execution!\n");
+    if(build_in_progress) {
+        printf("Exception occurred during build\n");
+    }
+    if(execution_in_progress) {
+        printf("Exception occurred during kernel execution\n");
+    }
+    if(!build_in_progress && !execution_in_progress) {
+        printf("Unknown source of exception\n");
+    }
     exit(1);
 }
 int runtime_check_handler(int errorType, const char *filename, int linenumber, const char *moduleName, const char *format, ...)
@@ -474,8 +487,14 @@
     sprintf(options, "%s -D NO_GROUP_DIVERGENCE", options);
   if (disable_fake)
     sprintf(options, "%s -D NO_FAKE_DIVERGENCE", options);
-
+
+#ifdef _MSC_VER
+  build_in_progress = true;
+#endif
   err = clBuildProgram(program, 0, NULL, options, NULL, NULL);
+#ifdef _MSC_VER
+  build_in_progress = false;
+#endif
   if (cl_error_check(err, "Error building program")) {
     if (debug_build) {
       size_t err_size;
@@ -650,6 +669,9 @@

   // Create command to launch the kernel.
+#ifdef _MSC_VER
+  execution_in_progress = true;
+#endif
   err = clEnqueueNDRangeKernel(
       com_queue, kernel, work_dim, NULL, global_size, local_size, 0, NULL, NULL);
   if (cl_error_check(err, "Error enqueueing kernel"))
@@ -659,6 +681,9 @@
   err = clFinish(com_queue);
   if (cl_error_check(err, "Error sending finish command"))
     return 1;
+#ifdef _MSC_VER
+  execution_in_progress = false;
+#endif

   // Read back the reults of each thread.
   RES_TYPE * c = (RES_TYPE*)malloc(sizeof(RES_TYPE)*total_threads);


Create default case's basic block

Create default case's basic block

--- src/cc1/ops/stmt_switch.c
+++ src/cc1/ops/stmt_switch.c
@@ -262,6 +262,8 @@
 	out_val_release(octx, cmp_with);

 	pdefault = s->bits.switch_.default_case;
+	if(pdefault)
+		pdefault->bits.case_blk = out_blk_new(octx, "default");

 	/* no matches - branch to default/end */
 	out_ctrl_transfer(octx,


gcc 4.7: added virtual destructor

gcc 4.7: added virtual destructor

--- types/value_description.h
+++ types/value_description.h
@@ -68,6 +68,8 @@
           jsConvertersInitialized(false)
     {
     }
+
+    virtual ~ValueDescription() {};

     ValueKind kind;
     const std::type_info * const type;


fix typo in fluidsynth_process.c

fix typo in fluidsynth_process.c

--- doc/fluidsynth_process.c
+++ doc/fluidsynth_process.c
@@ -22,8 +22,8 @@
         float *dry[1*2], *fx[1*2];

         // first make sure to zero out the sample buffers
-        memset(left, 0, sizeof(left1));
-        memset(right, 0, sizeof(right1));
+        memset(left, 0, sizeof(left));
+        memset(right, 0, sizeof(right));

         // setup channel mapping for a single stereo channel to which to render all dry audio to
         dry[0] = left;
@@ -72,7 +72,7 @@
         float *dry[n_aud_chan * 2], *fx[n_fx_chan * 2];

         // setup buffers to mix dry stereo audio to
-        // buffers are alternating left and right for each audio channel, i.e.:
+        // buffers are alternating left and right for each n_aud_chan, i.e.:
         // dry[0] = first audio channel left
         // dry[1] = first audio channel right
         // dry[2] = second audio channel left


no more hang...

SVN revision: 18630

--- src/bin/e_ipc_handlers.h
+++ src/bin/e_ipc_handlers.h
@@ -727,10 +727,10 @@

 #define SEND_STRING(__str, __op, HDL) \
-case HDL: { void *data; int bytes; \
+case HDL: { void *data; int bytes = 0; \
    data = e_ipc_codec_str_enc(__str, &bytes); \
+   ecore_ipc_client_send(e->client, E_IPC_DOMAIN_REPLY, __op, 0, 0, 0, data, bytes); \
    if (data) { \
-      ecore_ipc_client_send(e->client, E_IPC_DOMAIN_REPLY, __op, 0, 0, 0, data, bytes); \
       free(data); \
    } \
 } \


* buckets/dechunk_buckets.c:    (serf_bucket_type_dechunk): Use wrapper functions for read_iovec and   read_for_sendfile.

--- buckets/dechunk_buckets.c
+++ buckets/dechunk_buckets.c
@@ -172,16 +172,14 @@

 /* ### need to implement */
 #define serf_dechunk_readline NULL
-#define serf_dechunk_read_iovec NULL
-#define serf_dechunk_read_for_sendfile NULL
 #define serf_dechunk_peek NULL

 SERF_DECLARE_DATA const serf_bucket_type_t serf_bucket_type_dechunk = {
     "DECHUNK",
     serf_dechunk_read,
     serf_dechunk_readline,
-    serf_dechunk_read_iovec,
-    serf_dechunk_read_for_sendfile,
+    serf_default_read_iovec,
+    serf_default_read_for_sendfile,
     serf_default_read_bucket,
     serf_dechunk_peek,
     serf_dechunk_destroy_and_data,


cosmetic

cosmetic

--- Library/Sources/Stroika/Foundation/Containers/Sequence.h
+++ Library/Sources/Stroika/Foundation/Containers/Sequence.h
@@ -558,7 +558,7 @@
      *  or
      *      \code
      *          Sequence<int> a, b;
-     *          if (Sequence<int>::EqualsComparer{eletComparer} (a, b)) {
+     *          if (Sequence<int>::EqualsComparer{eltComparer} (a, b)) {
      *          }
      *      \endcode
      *


drivers: timer: set rate and counter before enabling timer

--- drivers/timer.c
+++ drivers/timer.c
@@ -171,6 +171,8 @@

 	tim_ops.request_irq(timer, &timer_isr, timer);

+	timer_set_rate(timer, 1000000);
+	timer_set_counter(timer, timer->counter);
 	timer_enable(timer);

 	mutex_unlock(&timer_mutex);


Update JTAG Pin Mux Comments

Update JTAG Pin Mux Comments

* Removes LPSR_09 which isn't a JTAG pin.
* Updates comment to remind user that if LPSR13-15 are used they must
  also be properly muxed.

Change-Id: I0d2454c9be779c401ea5175484009351724342ab
GitOrigin-RevId: 1b9dc23a1d42d6192e96e0b724a9eef9b7356fed

--- third_party/modified/nxp/rt1176-sdk/pin_mux.c
+++ third_party/modified/nxp/rt1176-sdk/pin_mux.c
@@ -523,13 +523,8 @@

 #endif

-    // Start JTAG pins
-    // To enable JTAG debugging, comment-out the following 4 lines
+    // GPIO Mode for J9/J10 Header
     IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_09_GPIO_MUX6_IO09, 0U);
-    IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_10_GPIO_MUX6_IO10, 0U);
-    IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_11_GPIO_MUX6_IO11, 0U);
-    IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_12_GPIO_MUX6_IO12, 0U);
-    // End JTAG pins
     IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_06_GPIO_MUX6_IO06, 0U);
     IOMUXC_SetPinMux(IOMUXC_GPIO_AD_32_GPIO_MUX3_IO31, 0U);
     IOMUXC_SetPinMux(IOMUXC_GPIO_AD_33_GPIO_MUX4_IO00, 0U);
@@ -541,6 +536,16 @@
     IOMUXC_SetPinMux(IOMUXC_GPIO_AD_00_GPIO_MUX2_IO31, 0U);
     IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_07_GPIO_MUX6_IO07, 0U);

+    // Start JTAG pins
+    // These pins are set to GPIO for the J10 header.
+    // To enable JTAG debugging, comment-out the following 3 lines.
+    // If LPSR_13, LPSR_14, and LPSR_15 are muxed elsewhere, they
+    // must also be left as default or expliclty set to JTAG_MUX.
+    IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_10_GPIO_MUX6_IO10, 0U);
+    IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_11_GPIO_MUX6_IO11, 0U);
+    IOMUXC_SetPinMux(IOMUXC_GPIO_LPSR_12_GPIO_MUX6_IO12, 0U);
+    // End JTAG pins
+

 #if defined(CORAL_MICRO_ARDUINO) && (CORAL_MICRO_ARDUINO == 1)
     InitArduinoPins();


[1] Fixed bug logging wrong address.

[1] Fixed bug logging wrong address.

--- Hazer/bin/rtktool.c
+++ Hazer/bin/rtktool.c
@@ -307,11 +307,11 @@
 			 */

 			if ((total = diminuto_ipc6_datagram_receive_generic(sock, &buffer, sizeof(buffer), &(this->address), &(this->port), 0)) < sizeof(buffer.header)) {
-				DIMINUTO_LOG_ERROR("Datagram Length [%zd] [%s]:%d", total, diminuto_ipc6_address2string(this->address, ipv6, sizeof(ipv6)), this->port);
+				DIMINUTO_LOG_ERROR("Datagram Length [%s]:%d [%zd]", diminuto_ipc6_address2string(this->address, ipv6, sizeof(ipv6)), this->port, total);
 				continue;
 			}

-			DIMINUTO_LOG_DEBUG("Datagram Received [%s]:%d [%zd]", diminuto_ipc6_address2string(thee->address, ipv6, sizeof(ipv6)), thee->port, total);
+			DIMINUTO_LOG_DEBUG("Datagram Received [%s]:%d [%zd]", diminuto_ipc6_address2string(this->address, ipv6, sizeof(ipv6)), this->port, total);

             if (verbose) {
 				fprintf(stderr, "Datagram [%s]:%d [%zd]\n", diminuto_ipc6_address2string(this->address, ipv6, sizeof(ipv6)), this->port, total);
@@ -451,7 +451,7 @@
 					thee = (client_t *)diminuto_tree_data(node);
 					if (thee->classification == ROVER) {
 						result = diminuto_ipc6_datagram_send(sock, &buffer, total, thee->address, thee->port);
-						DIMINUTO_LOG_DEBUG("Datagram Sent [%s]:%d %zd", diminuto_ipc6_address2string(thee->address, ipv6, sizeof(ipv6)), thee->port, result);
+						DIMINUTO_LOG_DEBUG("Datagram Sent [%s]:%d [%zd]", diminuto_ipc6_address2string(thee->address, ipv6, sizeof(ipv6)), thee->port, result);
 					}
 					if (node == last) { break; }
 					node = diminuto_tree_next(node);


USB: log an error message when USB enumeration fails

This patch (as1077) logs an error message whenever the kernel is
unable to enumerate a new USB device.

Signed-off-by: Alan Stern <75ea6bb7bfc1186f92d26164de5f9268c9a45b59@rowland.harvard.edu>
Cc: stable <4fbacc2fa0ffdbb11bf1ad6925b886ebd08dd15f@kernel.org>
Signed-off-by: Greg Kroah-Hartman <4645f7897fd33786a2ee1264d590b3c400559d85@suse.de>

--- drivers/usb/core/hub.c
+++ drivers/usb/core/hub.c
@@ -2708,6 +2708,7 @@
 		if ((status == -ENOTCONN) || (status == -ENOTSUPP))
 			break;
 	}
+	dev_err(hub_dev, "unable to enumerate USB device on port %d\n", port1);

 done:
 	hub_port_disable(hub, port1, 1);


drivers: gpu: Mark functions as static in vmwgfx_fence.c

Mark functions as static because they are not used outside the file
drm/vmwgfx/vmwgfx_fence.c.

This eliminates the following warnings in drm/vmwgfx/vmwgfx_fence.c:
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c:274:6: warning: no previous prototype for ‘vmw_fences_perform_actions’ [-Wmissing-prototypes]
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c:900:6: warning: no previous prototype for ‘vmw_fence_obj_add_action’ [-Wmissing-prototypes]
drivers/gpu/drm/vmwgfx/vmwgfx_fence.c:996:5: warning: no previous prototype for ‘vmw_event_fence_action_create’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <62a2cbd3422b0d621dafb7ceeff40187aeaed4ed@gmail.com>
Reviewed-by: Josh Triplett <c028c213ed5efcf30c3f4fc7361dbde0c893c5b7@joshtriplett.org>
Reviewed-by: Jakob Bornecrantz <6c68cabc7124e43c9b4d50f86510600f69e74c99@vmware.com>

--- drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
+++ drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
@@ -271,7 +271,7 @@
 	spin_unlock_irq(&fman->lock);
 }

-void vmw_fences_perform_actions(struct vmw_fence_manager *fman,
+static void vmw_fences_perform_actions(struct vmw_fence_manager *fman,
 				struct list_head *list)
 {
 	struct vmw_fence_action *action, *next_action;
@@ -897,7 +897,7 @@
  * Note that the action callbacks may be executed before this function
  * returns.
  */
-void vmw_fence_obj_add_action(struct vmw_fence_obj *fence,
+static void vmw_fence_obj_add_action(struct vmw_fence_obj *fence,
 			      struct vmw_fence_action *action)
 {
 	struct vmw_fence_manager *fman = fence->fman;
@@ -993,7 +993,7 @@
 	struct drm_vmw_event_fence event;
 };

-int vmw_event_fence_action_create(struct drm_file *file_priv,
+static int vmw_event_fence_action_create(struct drm_file *file_priv,
 				  struct vmw_fence_obj *fence,
 				  uint32_t flags,
 				  uint64_t user_data,


[Compliant] visualization in DifferenceFromTargetMapping

Former-commit-id: 348ab5214b2439ff76919471872b1576a3b8960a

--- applications/plugins/Compliant/mapping/DifferenceFromTargetMapping.h
+++ applications/plugins/Compliant/mapping/DifferenceFromTargetMapping.h
@@ -4,10 +4,11 @@
 #include <Compliant/config.h>

 #include "AssembledMapping.h"
+#include <sofa/core/visual/VisualParams.h>

 namespace sofa
 {
-
+
 namespace component
 {

@@ -27,9 +28,9 @@
 template <class TIn, class TOut >
 class SOFA_Compliant_API DifferenceFromTargetMapping : public AssembledMapping<TIn, TOut>
 {
-  public:
+public:
     SOFA_CLASS(SOFA_TEMPLATE2(DifferenceFromTargetMapping,TIn,TOut), SOFA_TEMPLATE2(AssembledMapping,TIn,TOut));
-
+
     typedef DifferenceFromTargetMapping Self;

     typedef typename TIn::Coord InCoord;
@@ -41,12 +42,16 @@
     Data< targets_type > targets;

     Data< bool > inverted;
-
-
+    Data< SReal > d_showObjectScale; ///< drawing size
+    Data< defaulttype::Vec4f > d_color; ///< drawing color
+
+
     DifferenceFromTargetMapping()
         : indices( initData(&indices, "indices", "indices of the parent points") )
         , targets( initData(&targets, "targets", "target positions which who computes deltas") )
         , inverted( initData(&inverted, false, "inverted", "target-p (rather than p-target)") )
+        , d_showObjectScale(initData(&d_showObjectScale, SReal(0), "showObjectScale", "Scale for object display"))
+        , d_color(initData(&d_color, defaulttype::Vec4f(1,1,0,1), "showColor", "Color for object display"))
     {

         // backward compatibility with OffsetMapping, a previous identical mapping
@@ -123,7 +128,7 @@
                     out[j] = in[k] - t[std::min(t.size()-1,j)];
                 }
         }
-	}
+    }

     virtual void assemble( const typename Self::in_pos_type& in )
     {
@@ -156,9 +161,47 @@
                 }
             }
         }
-	}
-
-
+    }
+
+
+    void draw(const core::visual::VisualParams* vparams)
+    {
+        if( !vparams->displayFlags().getShowMechanicalMappings() ) return;
+
+        typename core::behavior::MechanicalState<TIn>::ReadVecCoord pos = this->getFromModel()->readPositions();
+        const targets_type& t = targets.getValue();
+        const helper::vector<unsigned>& ind = indices.getValue();
+
+        helper::vector< sofa::defaulttype::Vector3 > points;
+        if( ind.empty() )
+        {
+            points.resize(2*pos.size());
+            for( size_t j = 0 ; j < pos.size() ; ++j )
+            {
+                points[2*j] = t[std::min(t.size()-1,j)];
+                points[2*j+1] = pos[j];
+            }
+        }
+        else
+        {
+            points.resize(2*ind.size());
+            for( size_t j = 0 ; j < ind.size() ; ++j )
+            {
+                const unsigned k = ind[j];
+                points[2*j] = t[std::min(t.size()-1,j)];
+                points[2*j+1] = pos[k];
+            }
+        }
+
+        SReal scale = d_showObjectScale.getValue();
+        if( scale == 0 )
+            vparams->drawTool()->drawLines ( points, 1, d_color.getValue() );
+        else
+            for (unsigned int i=0; i<points.size()/2; ++i)
+                vparams->drawTool()->drawCylinder( points[2*i+1], points[2*i], scale, d_color.getValue() );
+    }
+
+
 };


Simplify some template code; was triggering an ICE in GCC

--- include/FEC/ReedSolomon.h
+++ include/FEC/ReedSolomon.h
@@ -38,14 +38,14 @@
     Code to carry out compile-time multiplication of Galois field polynomials
     represented using integer sequences.
     */
-    template <typename GF, typename GF::gf_t... P1, typename GF::gf_t... P2>
+    template <typename GF, std::size_t Len1, std::size_t Len2>
     static constexpr typename GF::gf_t poly_multiply_impl(std::size_t idx,
-            std::integer_sequence<typename GF::gf_t, P1...>, std::integer_sequence<typename GF::gf_t, P2...>) {
+            Thiemar::Detail::ConstantArray<typename GF::gf_t, Len1> poly1,
+            Thiemar::Detail::ConstantArray<typename GF::gf_t, Len2> poly2) {
         typename GF::gf_t temp = 0u;
         for (std::size_t i = 0u; i <= idx; i++) {
-            if ((idx - i) < sizeof...(P1) && i < sizeof...(P2)) {
-                temp ^= GF::multiply(Thiemar::Detail::ConstantArray<typename GF::gf_t, sizeof...(P1)>{ P1... }[idx - i],
-                    Thiemar::Detail::ConstantArray<typename GF::gf_t, sizeof...(P2)>{ P2... }[i]);
+            if ((idx - i) < Len1 && i < Len2) {
+                temp ^= GF::multiply(poly1[idx - i], poly2[i]);
             }
         }

@@ -58,7 +58,8 @@
     struct poly_multiply<GF, std::integer_sequence<typename GF::gf_t, P1...>, std::integer_sequence<typename GF::gf_t, P2...>,
             std::index_sequence<Is...>> {
         using integer_sequence = std::integer_sequence<typename GF::gf_t, poly_multiply_impl<GF>(Is,
-            std::integer_sequence<typename GF::gf_t, P1...>{}, std::integer_sequence<typename GF::gf_t, P2...>{})...>;
+            Thiemar::Detail::ConstantArray<typename GF::gf_t, sizeof...(P1)>{ P1... },
+            Thiemar::Detail::ConstantArray<typename GF::gf_t, sizeof...(P2)>{ P2... })...>;
     };

     /*


fixes issue 336
during leak scan a chunk cannot anchor itself

SVN-Revision: 223

--- drmemory/leak.c
+++ drmemory/leak.c
@@ -592,10 +592,15 @@
     bool reachable = false;
     rb_node_t *node = NULL;
     if (chunk_end != NULL) {
-        flags = malloc_get_client_flags(pointer);
-        LOG(3, "\t"PFX" points to chunk "PFX"-"PFX"\n", ptr_addr, pointer, chunk_end);
-        chunk_start = pointer;
-        reachable = true;
+        if (ptr_addr >= pointer && ptr_addr < chunk_end) {
+            LOG(3, "\t("PFX" points to start of its own chunk "PFX"-"PFX")\n",
+                ptr_addr, pointer, chunk_end);
+        } else {
+            flags = malloc_get_client_flags(pointer);
+            LOG(3, "\t"PFX" points to chunk "PFX"-"PFX"\n", ptr_addr, pointer, chunk_end);
+            chunk_start = pointer;
+            reachable = true;
+        }
     } else {
         size_t chunk_size;
         node = rb_in_node(data->alloc_tree, pointer);
@@ -603,26 +608,31 @@
             rb_node_fields(node, &chunk_start, &chunk_size, NULL);
             chunk_end = chunk_start + chunk_size;
             ASSERT(is_in_heap_region(pointer), "heap data struct inconsistency");
-            /* PR 476482: we have a separate category of "possible leaks" that
-             * are not reached by chunk-head pointers but are reached by
-             * mid-chunk pointers.
-             */
-            LOG(3, "\t("PFX" points to mid-chunk "PFX" in "PFX"-"PFX")\n",
-                ptr_addr, pointer, chunk_start, chunk_end);
-            flags = malloc_get_client_flags(chunk_start);
-            if (is_midchunk_pointer_legitimate(pointer, chunk_start, chunk_end)) {
-                /* We could split these out as "probably reachable" but that would
-                 * require a new chunk queue and flags and extra logic for
-                 * whether reached initially by which: not worth it since the
-                 * heuristics are unlikely to mask real leaks.
+            if (ptr_addr >= chunk_start && ptr_addr < chunk_end) {
+                LOG(3, "\t("PFX" points to middle "PFX" of its own chunk "PFX"-"PFX")\n",
+                    ptr_addr, pointer, chunk_start, chunk_end);
+            } else {
+                /* PR 476482: we have a separate category of "possible leaks" that
+                 * are not reached by chunk-head pointers but are reached by
+                 * mid-chunk pointers.
                  */
-                reachable = true;
-                LOG(3, "\t  mid-chunk "PFX" in "PFX"-"PFX" is reachable\n",
-                    pointer, chunk_start, chunk_end);
-            } else if (!TESTANY(MALLOC_MAYBE_REACHABLE | MALLOC_REACHABLE |
-                                /* indirect trumps maybe */
-                                MALLOC_INDIRECTLY_REACHABLE, flags)) {
-                add_maybe_reachable = true;
+                LOG(3, "\t("PFX" points to mid-chunk "PFX" in "PFX"-"PFX")\n",
+                    ptr_addr, pointer, chunk_start, chunk_end);
+                flags = malloc_get_client_flags(chunk_start);
+                if (is_midchunk_pointer_legitimate(pointer, chunk_start, chunk_end)) {
+                    /* We could split these out as "probably reachable" but that would
+                     * require a new chunk queue and flags and extra logic for
+                     * whether reached initially by which: not worth it since the
+                     * heuristics are unlikely to mask real leaks.
+                     */
+                    reachable = true;
+                    LOG(3, "\t  mid-chunk "PFX" in "PFX"-"PFX" is reachable\n",
+                        pointer, chunk_start, chunk_end);
+                } else if (!TESTANY(MALLOC_MAYBE_REACHABLE | MALLOC_REACHABLE |
+                                    /* indirect trumps maybe */
+                                    MALLOC_INDIRECTLY_REACHABLE, flags)) {
+                    add_maybe_reachable = true;
+                }
             }
         } else {
 #if 0


Remove erroneous @end

Remove erroneous @end

--- MagicalRecord/Core/MagicalRecordShorthandMethodAliases.h
+++ MagicalRecord/Core/MagicalRecordShorthandMethodAliases.h
@@ -22,9 +22,6 @@
 + (MR_nullable NSArray *) aggregateOperation:(MR_nonnull NSString *)collectionOperator onAttribute:(MR_nonnull NSString *)attributeName withPredicate:(MR_nullable NSPredicate *)predicate groupBy:(MR_nullable NSString*)groupingKeyPath;
 - (MR_nullable instancetype) objectWithMinValueFor:(MR_nonnull NSString *)property;
 - (MR_nullable instancetype) objectWithMinValueFor:(MR_nonnull NSString *)property inContext:(MR_nonnull NSManagedObjectContext *)context;
-
-@end
-

 @end

@@ -163,9 +160,6 @@
 @end

-@end
-
-
 @interface NSManagedObject (MagicalRecordDeprecatedShortHand)

 + (MR_nullable instancetype) createInContext:(MR_nonnull NSManagedObjectContext *)context MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("4.0", "MR_createEntityInContext:");