Re: [PATCH] mmc: mmc_add_card(): fix missing break in switch statement

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

 



On Tue, May 03, 2011 at 05:00:03PM +0530, Prashanth Bhat wrote:
> To be more specific, I would think that the code change required in
> include/linux/mmc/card.h is:
> 
> #define mmc_card_mmc(c)         ((c)->type == MMC_TYPE_MMC)
> - #define mmc_card_sd(c)          ((c)->type == MMC_TYPE_SD)
> - #define mmc_card_sdio(c)        ((c)->type == MMC_TYPE_SDIO)
> 
> + #define mmc_card_sd(c)          ((c)->type == MMC_TYPE_SD ||
> (c)->type == MMC_TYPE_SD_COMBO)
> + #define mmc_card_sdio(c)        ((c)->type == MMC_TYPE_SDIO ||
> (c)->type == MMC_TYPE_SD_COMBO)

You can actually use (c->type & MMC_TYPE_SD) and (c->type & MMC_TYPE_SDIO).
Unless there will be more types of SD cards (unlikely) this way
will generate less code on average.

Best Regards,
Michał Mirosław
--
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