the-darkvoid / BrcmPatchRAM

Broadcom PatchRAM driver for OS X

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code review: fall through in interruptReadHandler intentional?

RehabMan opened this issue · comments

This code:

void BrcmPatchRAM::interruptReadHandler(void* parameter, IOReturn status, UInt32 bufferSizeRemaining)
{
...
    switch (status)
    {
        case kIOReturnOverrun:
            DebugLog("[%04x:%04x]: read - kIOReturnOverrun\n", mVendorId, mProductId);
            mInterruptPipe->ClearStall();
        case kIOReturnSuccess:

Is the fall through on the kIOReturnOverrun case intentional?

To make it obvious, I always add a comment to make it clear...

void BrcmPatchRAM::interruptReadHandler(void* parameter, IOReturn status, UInt32 bufferSizeRemaining)
{
...
    switch (status)
    {
        case kIOReturnOverrun:
            DebugLog("[%04x:%04x]: read - kIOReturnOverrun\n", mVendorId, mProductId);
            mInterruptPipe->ClearStall();
            // fall through...
        case kIOReturnSuccess:

No I cannot remember it being intentional.

Code has not been used in a while though as continuous read is the active branch.
As suggested I will merge continuous read over master and close the continuous read branch.