mmc: don't use weight32()
Using weight32() to determine if a value is a power of 2 is a rather heavi weight solution. The classic idiom is (x & (x - 1)) == 0, but the kernel already provide a is_power_of_2 function for it. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
这个提交包含在:
@@ -16,6 +16,7 @@
|
||||
#include <linux/mmc/host.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <linux/log2.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define DRIVER_NAME "tifm_sd"
|
||||
@@ -637,7 +638,7 @@ static void tifm_sd_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
if (mrq->data && (hweight32(mrq->data->blksz) > 1)) {
|
||||
if (mrq->data && !is_power_of_2(mrq->data->blksz)) {
|
||||
printk(KERN_ERR "%s: Unsupported block size (%d bytes)\n",
|
||||
sock->dev.bus_id, mrq->data->blksz);
|
||||
mrq->cmd->error = -EINVAL;
|
||||
|
在新工单中引用
屏蔽一个用户