aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ps3/ps3av_cmd.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>2007-10-16 04:29:40 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:20 -0400
commit828b23fc8794d1ac679e1695a9d9e0341e43752e (patch)
tree2d225f257e5983d8531580ee9097f6549da98664 /drivers/ps3/ps3av_cmd.c
parent179b025fea2fa65760f1dcdff3585465d2177159 (diff)
ps3av: eliminate unneeded temporary variables
ps3av: eliminate unneeded temporary variables Signed-off-by: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com> Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/ps3/ps3av_cmd.c')
-rw-r--r--drivers/ps3/ps3av_cmd.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c
index f72f5ddf18e4..83d7e8fdbfea 100644
--- a/drivers/ps3/ps3av_cmd.c
+++ b/drivers/ps3/ps3av_cmd.c
@@ -512,7 +512,6 @@ static const u32 ps3av_ns_table[][5] = {
512static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) 512static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid)
513{ 513{
514 u32 av_vid, ns_val; 514 u32 av_vid, ns_val;
515 u8 *p = ns;
516 int d; 515 int d;
517 516
518 d = ns_val = 0; 517 d = ns_val = 0;
@@ -551,24 +550,22 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid)
551 else 550 else
552 ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d]; 551 ns_val = ps3av_ns_table[PS3AV_CMD_AUDIO_FS_44K-BASE][d];
553 552
554 *p++ = ns_val & 0x000000FF; 553 *ns++ = ns_val & 0x000000FF;
555 *p++ = (ns_val & 0x0000FF00) >> 8; 554 *ns++ = (ns_val & 0x0000FF00) >> 8;
556 *p = (ns_val & 0x00FF0000) >> 16; 555 *ns = (ns_val & 0x00FF0000) >> 16;
557} 556}
558 557
559#undef BASE 558#undef BASE
560 559
561static u8 ps3av_cnv_enable(u32 source, const u8 *enable) 560static u8 ps3av_cnv_enable(u32 source, const u8 *enable)
562{ 561{
563 const u8 *p;
564 u8 ret = 0; 562 u8 ret = 0;
565 563
566 if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { 564 if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) {
567 ret = 0x03; 565 ret = 0x03;
568 } else if (source == PS3AV_CMD_AUDIO_SOURCE_SERIAL) { 566 } else if (source == PS3AV_CMD_AUDIO_SOURCE_SERIAL) {
569 p = enable; 567 ret = ((enable[0] << 4) + (enable[1] << 5) + (enable[2] << 6) +
570 ret = ((p[0] << 4) + (p[1] << 5) + (p[2] << 6) + (p[3] << 7)) | 568 (enable[3] << 7)) | 0x01;
571 0x01;
572 } else 569 } else
573 printk(KERN_ERR "%s failed, source:%x\n", __func__, source); 570 printk(KERN_ERR "%s failed, source:%x\n", __func__, source);
574 return ret; 571 return ret;
@@ -576,11 +573,9 @@ static u8 ps3av_cnv_enable(u32 source, const u8 *enable)
576 573
577static u8 ps3av_cnv_fifomap(const u8 *map) 574static u8 ps3av_cnv_fifomap(const u8 *map)
578{ 575{
579 const u8 *p;
580 u8 ret = 0; 576 u8 ret = 0;
581 577
582 p = map; 578 ret = map[0] + (map[1] << 2) + (map[2] << 4) + (map[3] << 6);
583 ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6);
584 return ret; 579 return ret;
585} 580}
586 581