提交 828b23fc 编写于 作者: G Geert Uytterhoeven 提交者: Linus Torvalds

ps3av: eliminate unneeded temporary variables

ps3av: eliminate unneeded temporary variables
Signed-off-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: NAntonino Daplas <adaplas@gmail.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 179b025f
...@@ -512,7 +512,6 @@ static const u32 ps3av_ns_table[][5] = { ...@@ -512,7 +512,6 @@ static const u32 ps3av_ns_table[][5] = {
static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid)
{ {
u32 av_vid, ns_val; u32 av_vid, ns_val;
u8 *p = ns;
int d; int d;
d = ns_val = 0; d = ns_val = 0;
...@@ -551,24 +550,22 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) ...@@ -551,24 +550,22 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid)
else else
ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d]; ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d];
*p++ = ns_val & 0x000000FF; *ns++ = ns_val & 0x000000FF;
*p++ = (ns_val & 0x0000FF00) >> 8; *ns++ = (ns_val & 0x0000FF00) >> 8;
*p = (ns_val & 0x00FF0000) >> 16; *ns = (ns_val & 0x00FF0000) >> 16;
} }
#undef BASE #undef BASE
static u8 ps3av_cnv_enable(u32 source, const u8 *enable) static u8 ps3av_cnv_enable(u32 source, const u8 *enable)
{ {
const u8 *p;
u8 ret = 0; u8 ret = 0;
if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) {
ret = 0x03; ret = 0x03;
} else if (source == PS3AV_CMD_AUDIO_SOURCE_SERIAL) { } else if (source == PS3AV_CMD_AUDIO_SOURCE_SERIAL) {
p = enable; ret = ((enable[0] << 4) + (enable[1] << 5) + (enable[2] << 6) +
ret = ((p[0] << 4) + (p[1] << 5) + (p[2] << 6) + (p[3] << 7)) | (enable[3] << 7)) | 0x01;
0x01;
} else } else
printk(KERN_ERR "%s failed, source:%x\n", __func__, source); printk(KERN_ERR "%s failed, source:%x\n", __func__, source);
return ret; return ret;
...@@ -576,11 +573,9 @@ static u8 ps3av_cnv_enable(u32 source, const u8 *enable) ...@@ -576,11 +573,9 @@ static u8 ps3av_cnv_enable(u32 source, const u8 *enable)
static u8 ps3av_cnv_fifomap(const u8 *map) static u8 ps3av_cnv_fifomap(const u8 *map)
{ {
const u8 *p;
u8 ret = 0; u8 ret = 0;
p = map; ret = map[0] + (map[1] << 2) + (map[2] << 4) + (map[3] << 6);
ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6);
return ret; return ret;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册