Re: [RESEND PATCH v4] mmc: fix async request mechanism for sequential read scenarios

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Tue, Dec 18 2012, Konstantin Dorfman wrote:
>>>> @@ -1374,6 +1367,8 @@ static int mmc_blk_issue_rw_rq(struct mmc_queue *mq, struct request *rqc)
>>>>   		mmc_queue_bounce_post(mq_rq);
>>>>
>>>>   		switch (status) {
>>>> +		case MMC_BLK_NEW_REQUEST:
>>>> +			BUG(); /* should never get here */
>> Is there any case to reach here?
>> I didn't find it.
>> 
> Correct. But since there is no "default:" in this switch, compiler
> demands all values of the 'status' variable present. So, we need this
> BUG() here or we need to introduce "default:".

Please avoid using BUG() entirely (both here and elsewhere).  It crashes
the entire MMC stack, which means it crashes the machine entirely if
you're booted from eMMC/SD.  There is almost always something better
that can be done than crashing the machine.

default: and pr_err() sound fine here.

Thanks,

- Chris.
-- 
Chris Ball   <cjb@xxxxxxxxxx>   <http://printf.net/>
One Laptop Per Child
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux