No sense manually doing the alignment dance, there's a macro for that.
Once the optimal alignment stuff is added, this could
probably turn into something like this (in core.h):
static inline u32 mmc_align_data_size(struct mmc_card *card, u32 sz)
{
return ALIGN(sz, card->align_sz);
}
Signed-off-by: Andres Salomon <dilinger@debian.org>
---
drivers/mmc/core/core.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 3ee5b8c..e306061 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -315,9 +315,7 @@ unsigned int mmc_align_data_size(struct mmc_card *card, unsigned int sz)
* the core about its problems yet, so for now we just 32-bit
* align the size.
*/
- sz = ((sz + 3) / 4) * 4;
-
- return sz;
+ return ALIGN(sz, 4);
}
EXPORT_SYMBOL(mmc_align_data_size);
--
1.5.5.3
--
| H. Peter Anvin | Re: [rft] s2ram wakeup moves to .c, could fix few machines |
| Greg Kroah-Hartman | [PATCH 002/196] Chinese: rephrase English introduction in HOWTO |
| Ingo Molnar | [patch] PID namespace design bug, workaround |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
git: | |
| Eric Dumazet | Re: Multicast packet loss |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | [GIT]: Networking |
| Jarek Poplawski | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
