aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-03-11 15:00:01 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-03-22 03:54:06 -0400
commit1039752353f1308bcd594a79196f60a22d45975d (patch)
treedb8a95d611f605f8446b91015fe2de881c2f76f5 /drivers/media/video
parent972d724caf8b6c461b585c800d6460a12c098a5e (diff)
[media] cpia2: Fix some gcc 4.6 warnings when debug is disabled
cpia2_core.c:529:14: warning: variable 'dir' set but not used [-Wunused-but-set-variable] cpia2_core.c:526:5: warning: variable 'block_index' set but not used [-Wunused-but-set-variable] Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cpia2/cpia2_core.c34
1 files changed, 14 insertions, 20 deletions
diff --git a/drivers/media/video/cpia2/cpia2_core.c b/drivers/media/video/cpia2/cpia2_core.c
index aaffca8e13fd..ee91e295c90a 100644
--- a/drivers/media/video/cpia2/cpia2_core.c
+++ b/drivers/media/video/cpia2/cpia2_core.c
@@ -519,22 +519,16 @@ int cpia2_do_command(struct camera_data *cam,
519 * cpia2_send_command 519 * cpia2_send_command
520 * 520 *
521 *****************************************************************************/ 521 *****************************************************************************/
522
523#define DIR(cmd) ((cmd->direction == TRANSFER_WRITE) ? "Write" : "Read")
524#define BINDEX(cmd) (cmd->req_mode & 0x03)
525
522int cpia2_send_command(struct camera_data *cam, struct cpia2_command *cmd) 526int cpia2_send_command(struct camera_data *cam, struct cpia2_command *cmd)
523{ 527{
524 u8 count; 528 u8 count;
525 u8 start; 529 u8 start;
526 u8 block_index;
527 u8 *buffer; 530 u8 *buffer;
528 int retval; 531 int retval;
529 const char* dir;
530
531 if (cmd->direction == TRANSFER_WRITE) {
532 dir = "Write";
533 } else {
534 dir = "Read";
535 }
536
537 block_index = cmd->req_mode & 0x03;
538 532
539 switch (cmd->req_mode & 0x0c) { 533 switch (cmd->req_mode & 0x0c) {
540 case CAMERAACCESS_TYPE_RANDOM: 534 case CAMERAACCESS_TYPE_RANDOM:
@@ -542,32 +536,32 @@ int cpia2_send_command(struct camera_data *cam, struct cpia2_command *cmd)
542 start = 0; 536 start = 0;
543 buffer = (u8 *) & cmd->buffer; 537 buffer = (u8 *) & cmd->buffer;
544 if (debugs_on & DEBUG_REG) 538 if (debugs_on & DEBUG_REG)
545 DBG("%s Random: Register block %s\n", dir, 539 DBG("%s Random: Register block %s\n", DIR(cmd),
546 block_name[block_index]); 540 block_name[BINDEX(cmd)]);
547 break; 541 break;
548 case CAMERAACCESS_TYPE_BLOCK: 542 case CAMERAACCESS_TYPE_BLOCK:
549 count = cmd->reg_count; 543 count = cmd->reg_count;
550 start = cmd->start; 544 start = cmd->start;
551 buffer = cmd->buffer.block_data; 545 buffer = cmd->buffer.block_data;
552 if (debugs_on & DEBUG_REG) 546 if (debugs_on & DEBUG_REG)
553 DBG("%s Block: Register block %s\n", dir, 547 DBG("%s Block: Register block %s\n", DIR(cmd),
554 block_name[block_index]); 548 block_name[BINDEX(cmd)]);
555 break; 549 break;
556 case CAMERAACCESS_TYPE_MASK: 550 case CAMERAACCESS_TYPE_MASK:
557 count = cmd->reg_count * sizeof(struct cpia2_reg_mask); 551 count = cmd->reg_count * sizeof(struct cpia2_reg_mask);
558 start = 0; 552 start = 0;
559 buffer = (u8 *) & cmd->buffer; 553 buffer = (u8 *) & cmd->buffer;
560 if (debugs_on & DEBUG_REG) 554 if (debugs_on & DEBUG_REG)
561 DBG("%s Mask: Register block %s\n", dir, 555 DBG("%s Mask: Register block %s\n", DIR(cmd),
562 block_name[block_index]); 556 block_name[BINDEX(cmd)]);
563 break; 557 break;
564 case CAMERAACCESS_TYPE_REPEAT: /* For patch blocks only */ 558 case CAMERAACCESS_TYPE_REPEAT: /* For patch blocks only */
565 count = cmd->reg_count; 559 count = cmd->reg_count;
566 start = cmd->start; 560 start = cmd->start;
567 buffer = cmd->buffer.block_data; 561 buffer = cmd->buffer.block_data;
568 if (debugs_on & DEBUG_REG) 562 if (debugs_on & DEBUG_REG)
569 DBG("%s Repeat: Register block %s\n", dir, 563 DBG("%s Repeat: Register block %s\n", DIR(cmd),
570 block_name[block_index]); 564 block_name[BINDEX(cmd)]);
571 break; 565 break;
572 default: 566 default:
573 LOG("%s: invalid request mode\n",__func__); 567 LOG("%s: invalid request mode\n",__func__);
@@ -584,10 +578,10 @@ int cpia2_send_command(struct camera_data *cam, struct cpia2_command *cmd)
584 for (i = 0; i < cmd->reg_count; i++) { 578 for (i = 0; i < cmd->reg_count; i++) {
585 if((cmd->req_mode & 0x0c) == CAMERAACCESS_TYPE_BLOCK) 579 if((cmd->req_mode & 0x0c) == CAMERAACCESS_TYPE_BLOCK)
586 KINFO("%s Block: [0x%02X] = 0x%02X\n", 580 KINFO("%s Block: [0x%02X] = 0x%02X\n",
587 dir, start + i, buffer[i]); 581 DIR(cmd), start + i, buffer[i]);
588 if((cmd->req_mode & 0x0c) == CAMERAACCESS_TYPE_RANDOM) 582 if((cmd->req_mode & 0x0c) == CAMERAACCESS_TYPE_RANDOM)
589 KINFO("%s Random: [0x%02X] = 0x%02X\n", 583 KINFO("%s Random: [0x%02X] = 0x%02X\n",
590 dir, cmd->buffer.registers[i].index, 584 DIR(cmd), cmd->buffer.registers[i].index,
591 cmd->buffer.registers[i].value); 585 cmd->buffer.registers[i].value);
592 } 586 }
593 } 587 }