Staging: cx25821: Fix style issues
v3 cover Staging: cx25821: Fix style issues
This patch series fixes some style issues in drivers/staging/cx25821 I split my previous patches per logical change and combined them into one patch series.
Leonid V. Fedorenchik (18):
Staging: cx25821: Get rid of typedef in cx25821.h
Staging: cx25821: Delete file cx25821-gpio.h
Staging: cx25821: Move EXPORT_SYMBOL() to the right place
Staging: cx25821: Use DEFINE_PCI_DEVICE_TABLE for cx25821_pci_tbl
Staging: cx25821: Fix wrong brace placement in cx25821-cards.c
Staging: cx25821: Fix wrong brace placement in cx25821-core.c
Staging: cx25821: Fix wrong brace placement in cx25821-i2c.c
Staging: cx25821: Fix too long lines in cx25821-audio.h
Staging: cx25821: Fix obscure line endings in cx25821-audio-upstream.c
Staging: cx25821: Fix long lines in cx25821-audio-upstream.c
Staging: cx25821: Fix long lines in cx25821-audio-upstream.h
Staging: cx25821: Replace :? by if-else in cx25821-video-upstream-ch2.c
Staging: cx25821: Fix labels' placement in cx25821-video-upstream-ch2.c
Staging: cx25821: Fix wrong line endings in cx25821-video-upstream-ch2.c
Staging: cx25821: Fix long lines in cx25821-video-upstream-ch2.c
Staging: cx25821: Fix long lines in cx25821-video-upstream-ch2.h
Staging: cx25821: Fix long lines in cx25821-video-upstream.c
Staging: cx25821: Fix long lines in cx25821-video-upstream.h
drivers/staging/cx25821/cx25821-audio-upstream.c | 33 +++----- drivers/staging/cx25821/cx25821-audio-upstream.h | 9 ++- drivers/staging/cx25821/cx25821-audio.h | 6 +- drivers/staging/cx25821/cx25821-cards.c | 6 +- drivers/staging/cx25821/cx25821-core.c | 31 ++++---- drivers/staging/cx25821/cx25821-gpio.c | 1 + drivers/staging/cx25821/cx25821-gpio.h | 2 - drivers/staging/cx25821/cx25821-i2c.c | 6 +- .../staging/cx25821/cx25821-video-upstream-ch2.c | 79 ++++++++----------- .../staging/cx25821/cx25821-video-upstream-ch2.h | 83 ++++++++++++++------ drivers/staging/cx25821/cx25821-video-upstream.c | 16 ++--- drivers/staging/cx25821/cx25821-video-upstream.h | 78 +++++++++++++------ drivers/staging/cx25821/cx25821.h | 8 +- 13 files changed, 204 insertions(+), 154 deletions(-) delete mode 100644 drivers/staging/cx25821/cx25821-gpio.h
PATCH v3 1/18 Staging: cx25821: Get rid of typedef in cx25821.h
Get rid of typedef in cx25821.h
--- drivers/staging/cx25821/cx25821.h | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-)
drivers/staging/cx25821/cx25821.h +5 -3
@@ -179,15 +179,17 @@ struct cx25821_input {u32 gpio0, gpio1, gpio2, gpio3; }; -typedef enum { +enum port {CX25821_UNDEFINED =0 ,CX25821_RAW ,CX25821_264 -}port_t ; +};struct cx25821_board {char *name; -port_t porta, portb, portc; +enum port porta; +enum port portb; +enum port portc;unsigned int tuner_type;unsigned int radio_type;unsigned char tuner_addr;
Signature · 1 line
1.7.0.4
PATCH v3 2/18 Staging: cx25821: Delete file cx25821-gpio.h
In reply to Leonid V. FedorenchikDelete file cx25821-gpio.h since it is not used.
--- drivers/staging/cx25821/cx25821-gpio.h | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) delete mode 100644 drivers/staging/cx25821/cx25821-gpio.h
drivers/staging/cx25821/cx25821-gpio.h deleted +0 -2
@@ -1,2 +0,0 @@ - -void cx25821_gpio_init (struct athena_dev *dev);
Signature · 1 line
1.7.0.4
PATCH v3 3/18 Staging: cx25821: Move EXPORT_SYMBOL() to the right place
In reply to Leonid V. FedorenchikMove EXPORT_SYMBOL(cx25821_set_gpiopin_direction) to the right place.
--- drivers/staging/cx25821/cx25821-core.c | 1 - drivers/staging/cx25821/cx25821-gpio.c | 1 + 2 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/cx25821/cx25821-core.c +0 -1
@@ -1512,7 +1512,6 @@ static void __exit cx25821_fini(void)pci_unregister_driver (&cx25821_pci_driver); } -EXPORT_SYMBOL (cx25821_set_gpiopin_direction);module_init (cx25821_init);module_exit (cx25821_fini);
drivers/staging/cx25821/cx25821-gpio.c +1 -0
@@ -50,6 +50,7 @@ void cx25821_set_gpiopin_direction(struct cx25821_dev *dev,cx_write (gpio_oe_reg, value); } +EXPORT_SYMBOL (cx25821_set_gpiopin_direction);static void cx25821_set_gpiopin_logicvalue (struct cx25821_dev *dev,int pin_number,int pin_logic_value)
Signature · 1 line
1.7.0.4
PATCH v3 4/18 Staging: cx25821: Use DEFINE_PCI_DEVICE_TABLE for cx25821_pci_tbl
In reply to Leonid V. FedorenchikUse DEFINE_PCI_DEVICE_TABLE for cx25821_pci_tbl
--- drivers/staging/cx25821/cx25821-core.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/cx25821/cx25821-core.c +1 -1
@@ -1473,7 +1473,7 @@ static void __devexit cx25821_finidev(struct pci_dev *pci_dev)kfree (dev); } -static struct pci_device_id cx25821_pci_tbl[] = { +static DEFINE_PCI_DEVICE_TABLE (cx25821_pci_tbl) = { {/* CX25821 Athena */ .vendor =0x14f1 ,
Signature · 1 line
1.7.0.4
PATCH v3 5/18 Staging: cx25821: Fix wrong brace placement in cx25821-cards.c
In reply to Leonid V. FedorenchikFix wrong brace placement in cx25821-cards.c
--- drivers/staging/cx25821/cx25821-cards.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/cx25821/cx25821-cards.c +3 -3
@@ -39,14 +39,14 @@ struct cx25821_board cx25821_boards[] = { .name = "UNKNOWN/GENERIC", /* Ensure safe default for unknown boards */ .clk_freq = 0, - }, + }, [CX25821_BOARD] = { .name = "CX25821", .portb = CX25821_RAW, .portc = CX25821_264, .input[0].type = CX25821_VMUX_COMPOSITE, - }, + }, };
@@ -57,7 +57,7 @@ struct cx25821_subid cx25821_subids[] = { .subvendor = 0x14f1, .subdevice = 0x0920, .card = CX25821_BOARD, - }, + }, };void cx25821_card_setup (struct cx25821_dev *dev)
Signature · 1 line
1.7.0.4
Re: [PATCH v3 05/18] Staging: cx25821: Fix wrong brace placement in cx25821-cards.c
Quoted 12 lines · Leonid V. Fedorenchik
Fix wrong brace placement in
cx25821-cards.cSigned-off-by Leonid V. Fedorenchik <[email protected]>--- drivers/staging/cx25821/cx25821-cards.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)drivers/staging/cx25821/cx25821-cards.c +0
-0
drivers/staging/cx25821/cx25821-cards.c struct cx25821_board cx25821_boards[] = { · line 41
Quoted 3 lines
drivers/staging/cx25821/cx25821-cards.c +0
-0@@ -39,14 +39,14 @@ struct cx25821_board cx25821_boards[] = { .name = "UNKNOWN/GENERIC",/* Ensure safe default for unknown boards */ .clk_freq = 0,
^^^^^^^^^^^^^
You may as well pull these in an indent level while you're at it.
drivers/staging/cx25821/cx25821-cards.c struct cx25821_board cx25821_boards[] = { · line 42
Quoted 2 lines
drivers/staging/cx25821/cx25821-cards.c +1
-1- }, + },
regards,
dan carpenter
Re: [PATCH v3 05/18] Staging: cx25821: Fix wrong brace placement in cx25821-cards.c
Quoted 17 lines · On Tue, 30 Aug 2011 17:05:32 +0300 Dan Carpenter <[email protected]> wrote:
Quoted 12 lines · Leonid V. Fedorenchik
Fix wrong brace placement in
cx25821-cards.cSigned-off-by Leonid V. Fedorenchik <[email protected]>--- drivers/staging/cx25821/cx25821-cards.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)drivers/staging/cx25821/cx25821-cards.c +0
-0drivers/staging/cx25821/cx25821-cards.c struct cx25821_board cx25821_boards[] = { · line 41
Quoted 3 lines
drivers/staging/cx25821/cx25821-cards.c +0
-0@@ -39,14 +39,14 @@ struct cx25821_board cx25821_boards[] = { .name = "UNKNOWN/GENERIC",/* Ensure safe default for unknown boards */ .clk_freq = 0,^^^^^^^^^^^^^
Quoted 1 line
You may as well pull these in an indent level while you're at it.
OK. Didn't think about it. Thanks.
Quoted 7 lines
drivers/staging/cx25821/cx25821-cards.c struct cx25821_board cx25821_boards[] = { · line 42
Quoted 3 lines
drivers/staging/cx25821/cx25821-cards.c +1
-1- }, + },regards,
dan carpenter
Leonid V. Fedorenchik
PATCH v3 6/18 Staging: cx25821: Fix wrong brace placement in cx25821-core.c
In reply to Leonid V. FedorenchikFix wrong brace placement in cx25821-core.c
--- drivers/staging/cx25821/cx25821-core.c | 28 ++++++++++++++-------------- 1 files changed, 14 insertions(+), 14 deletions(-)
drivers/staging/cx25821/cx25821-core.c +14 -14
@@ -69,7 +69,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_A_GPCNT, .vip_ctl = VID_DST_A_VIP_CTL, .pix_frmt = VID_DST_A_PIX_FRMT, - }, + }, [SRAM_CH01] = { .i = SRAM_CH01,
@@ -91,7 +91,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_B_GPCNT, .vip_ctl = VID_DST_B_VIP_CTL, .pix_frmt = VID_DST_B_PIX_FRMT, - }, + }, [SRAM_CH02] = { .i = SRAM_CH02,
@@ -113,7 +113,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_C_GPCNT, .vip_ctl = VID_DST_C_VIP_CTL, .pix_frmt = VID_DST_C_PIX_FRMT, - }, + }, [SRAM_CH03] = { .i = SRAM_CH03,
@@ -135,7 +135,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_D_GPCNT, .vip_ctl = VID_DST_D_VIP_CTL, .pix_frmt = VID_DST_D_PIX_FRMT, - }, + }, [SRAM_CH04] = { .i = SRAM_CH04,
@@ -157,7 +157,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_E_GPCNT, .vip_ctl = VID_DST_E_VIP_CTL, .pix_frmt = VID_DST_E_PIX_FRMT, - }, + }, [SRAM_CH05] = { .i = SRAM_CH05,
@@ -179,7 +179,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_F_GPCNT, .vip_ctl = VID_DST_F_VIP_CTL, .pix_frmt = VID_DST_F_PIX_FRMT, - }, + }, [SRAM_CH06] = { .i = SRAM_CH06,
@@ -201,7 +201,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_G_GPCNT, .vip_ctl = VID_DST_G_VIP_CTL, .pix_frmt = VID_DST_G_PIX_FRMT, - }, + }, [SRAM_CH07] = { .i = SRAM_CH07,
@@ -223,7 +223,7 @@ struct sram_channel cx25821_sram_channels[] = { .gpcnt = VID_DST_H_GPCNT, .vip_ctl = VID_DST_H_VIP_CTL, .pix_frmt = VID_DST_H_PIX_FRMT, - }, + }, [SRAM_CH08] = { .name = "audio from",
@@ -236,7 +236,7 @@ struct sram_channel cx25821_sram_channels[] = { .ptr2_reg = DMA17_PTR2, .cnt1_reg = DMA17_CNT1, .cnt2_reg = DMA17_CNT2, - }, + }, [SRAM_CH09] = { .i = SRAM_CH09,
@@ -262,7 +262,7 @@ struct sram_channel cx25821_sram_channels[] = { .vid_active_ctl2 = VID_SRC_I_ACTIVE_CTL2, .vid_cdt_size = VID_SRC_I_CDT_SZ, .irq_bit = 8, - }, + }, [SRAM_CH10] = { .i = SRAM_CH10,
@@ -288,7 +288,7 @@ struct sram_channel cx25821_sram_channels[] = { .vid_active_ctl2 = VID_SRC_J_ACTIVE_CTL2, .vid_cdt_size = VID_SRC_J_CDT_SZ, .irq_bit = 9, - }, + }, [SRAM_CH11] = { .i = SRAM_CH11,
@@ -313,7 +313,7 @@ struct sram_channel cx25821_sram_channels[] = { .fld_aud_fifo_en = FLD_AUD_SRC_B_FIFO_EN, .fld_aud_risc_en = FLD_AUD_SRC_B_RISC_EN, .irq_bit = 11, - }, + }, };EXPORT_SYMBOL (cx25821_sram_channels);
@@ -1480,10 +1480,10 @@ static DEFINE_PCI_DEVICE_TABLE(cx25821_pci_tbl) = { .device = 0x8210, .subvendor = 0x14f1, .subdevice = 0x0920, - }, + }, {/* --- end of list --- */ - } + } };MODULE_DEVICE_TABLE (pci, cx25821_pci_tbl);
Signature · 1 line
1.7.0.4
PATCH v3 7/18 Staging: cx25821: Fix wrong brace placement in cx25821-i2c.c
In reply to Leonid V. FedorenchikFix wrong brace placement in cx25821-i2c.c
--- drivers/staging/cx25821/cx25821-i2c.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/cx25821/cx25821-i2c.c +3 -3
@@ -374,12 +374,12 @@ int cx25821_i2c_read(struct cx25821_i2c *bus, u16 reg_addr, int *value) .flags = 0, .len = 2, .buf = addr, - }, { + }, { .addr = client->addr, .flags = I2C_M_RD, .len = 4, .buf = buf, - } + } }; addr[0 ] = (reg_addr >>8 );
@@ -407,7 +407,7 @@ int cx25821_i2c_write(struct cx25821_i2c *bus, u16 reg_addr, int value) .flags = 0, .len = 6, .buf = buf, - } + } }; buf[0 ] = reg_addr >>8 ;
Signature · 1 line
1.7.0.4
PATCH v3 8/18 Staging: cx25821: Fix too long lines in cx25821-audio.h
In reply to Leonid V. FedorenchikFix too long lines in cx25821-audio.h
--- drivers/staging/cx25821/cx25821-audio.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
drivers/staging/cx25821/cx25821-audio.h +4 -2
@@ -36,13 +36,15 @@*/ #ifndef USE_RISC_NOOP #define MAX_BUFFER_PROGRAM_SIZE \ - (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE*4) + (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE*4)#endif /* MAE 12 July 2005 Try to use NOOP RISC instruction instead */ #ifdef USE_RISC_NOOP #define MAX_BUFFER_PROGRAM_SIZE \ - (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_NOOP_INSTRUCTION_SIZE*4) + (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + \ + RISC_NOOP_INSTRUCTION_SIZE*4)#endif /* Sizes of various instructions in bytes. Used when adding instructions. */
Signature · 1 line
1.7.0.4
Re: [PATCH v3 08/18] Staging: cx25821: Fix too long lines in cx25821-audio.h
drivers/staging/cx25821/cx25821-audio.h line 40
Quoted 7 lines · Leonid V. Fedorenchik
drivers/staging/cx25821/cx25821-audio.h +2
-1@@ -36,13 +36,15 @@*/ #ifndef USE_RISC_NOOP #define MAX_BUFFER_PROGRAM_SIZE \ - (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE*4) + (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE*4)
Put spaces around the operands:
+ (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \
+ RISC_WRITECR_INSTRUCTION_SIZE * 4)
regards,
dan carpenter
Re: [PATCH v3 08/18] Staging: cx25821: Fix too long lines in cx25821-audio.h
Quoted 12 lines · On Tue, 30 Aug 2011 17:08:19 +0300 Dan Carpenter <[email protected]> wrote:
drivers/staging/cx25821/cx25821-audio.h line 40
Quoted 7 lines · Leonid V. Fedorenchik
drivers/staging/cx25821/cx25821-audio.h +2
-1@@ -36,13 +36,15 @@*/ #ifndef USE_RISC_NOOP #define MAX_BUFFER_PROGRAM_SIZE \ - (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE*4) + (2*LINES_PER_BUFFER*RISC_WRITE_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE*4)Put spaces around the operands:
Review
Quoted 2 lines
(quoted diff) +2
-0+ (2 * LINES_PER_BUFFER * RISC_WRITE_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE * 4)
I've missed this. Thanks.
Quoted 4 lines
regards,
dan carpenter
Leonid V. Fedorenchik
PATCH v3 9/18 Staging: cx25821: Fix obscure line endings in cx25821-audio-upstream.c
In reply to Leonid V. FedorenchikChange obscure line endings to less obscure ones. Rationale: more readable.
--- drivers/staging/cx25821/cx25821-audio-upstream.c | 20 ++++++++------------ 1 files changed, 8 insertions(+), 12 deletions(-)
drivers/staging/cx25821/cx25821-audio-upstream.c +8 -12
@@ -555,8 +555,7 @@ int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int chan_num, } }/* Jump to 2nd Audio Frame */ - *(rp++) = -cpu_to_le32 (RISC_JUMP |RISC_IRQ1 | + *(rp++) =cpu_to_le32 (RISC_JUMP |RISC_IRQ1 |RISC_CNT_RESET ); *(rp++) =cpu_to_le32 (risc_phys_jump_addr); *(rp++) =cpu_to_le32 (0 );
@@ -611,11 +610,9 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)/* Only deal with our interrupt */ if (audio_status) { - handled = -cx25821_audio_upstream_irq (dev, - dev-> - _audio_upstream_channel_select, - audio_status); + handled =cx25821_audio_upstream_irq (dev, + dev->_audio_upstream_channel_select, + audio_status); }if (handled <0 )
@@ -770,9 +767,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)memcpy (dev->_audiofilename, _defaultAudioName, str_length +1 ); } - retval = -cx25821_sram_channel_setup_upstream_audio (dev, sram_ch, _line_size, -0 ); + retval =cx25821_sram_channel_setup_upstream_audio (dev, sram_ch, + _line_size,0 ); dev->audio_upstream_riscbuf_size = AUDIO_RISC_DMA_BUF_SIZE * NUM_AUDIO_PROGS +
@@ -780,8 +776,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select) dev->audio_upstream_databuf_size =AUDIO_DATA_BUF_SZ *NUM_AUDIO_PROGS ;/* Allocating buffers and prepare RISC program */ - retval = -cx25821_audio_upstream_buffer_prepare (dev, sram_ch, _line_size); + retval =cx25821_audio_upstream_buffer_prepare (dev, sram_ch, + _line_size);if (retval <0 ) {pr_err ("%s: Failed to set up Audio upstream buffers!\n" , dev->name);
Signature · 1 line
1.7.0.4
PATCH v3 10/18 Staging: cx25821: Fix long lines in cx25821-audio-upstream.c
In reply to Leonid V. FedorenchikFix long lines in cx25821-audio-upstream.c
--- drivers/staging/cx25821/cx25821-audio-upstream.c | 13 +++++-------- 1 files changed, 5 insertions(+), 8 deletions(-)
drivers/staging/cx25821/cx25821-audio-upstream.c +5 -8
@@ -540,13 +540,9 @@ int cx25821_audio_upstream_irq(struct cx25821_dev *dev, int chan_num,AUDIO_RISC_DMA_BUF_SIZE ; rp =cx25821_risc_field_upstream_audio (dev, - dev-> - _risc_virt_start_addr - +1 , - dev-> - _audiodata_buf_phys_addr, -AUDIO_LINE_SIZE , -FIFO_DISABLE ); + dev->_risc_virt_start_addr +1 , + dev->_audiodata_buf_phys_addr, +AUDIO_LINE_SIZE ,FIFO_DISABLE );if (USE_RISC_NOOP_AUDIO ) {for (i =0 ; i <NUM_NO_OPS ; i++) {
@@ -603,7 +599,8 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)if (!dev)return -1 ; - sram_ch = dev->channels[dev->_audio_upstream_channel_select].sram_channels; + sram_ch = dev->channels[dev->_audio_upstream_channel_select]. + sram_channels; msk_stat =cx_read (sram_ch->int_mstat); audio_status =cx_read (sram_ch->int_stat);
Signature · 1 line
1.7.0.4
Re: [PATCH v3 10/18] Staging: cx25821: Fix long lines in cx25821-audio-upstream.c
drivers/staging/cx25821/cx25821-audio-upstream.c static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id) · line 603
Quoted 7 lines · Leonid V. Fedorenchik
drivers/staging/cx25821/cx25821-audio-upstream.c +2
-1@@ -603,7 +599,8 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)if (!dev)return -1 ; - sram_ch = dev->channels[dev->_audio_upstream_channel_select].sram_channels; + sram_ch = dev->channels[dev->_audio_upstream_channel_select]. + sram_channels;
$ echo -n "_audio_upstream_channel_select" | wc -c 30
I think I may have found the problem. (Don't use variable names that are a 30 zillion chars long).
regards,
dan carpenter
Re: [PATCH v3 10/18] Staging: cx25821: Fix long lines in cx25821-audio-upstream.c
Quoted 12 lines · On Tue, 30 Aug 2011 17:12:50 +0300 Dan Carpenter <[email protected]> wrote:
drivers/staging/cx25821/cx25821-audio-upstream.c static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id) · line 603
Quoted 7 lines · Leonid V. Fedorenchik
drivers/staging/cx25821/cx25821-audio-upstream.c +2
-1@@ -603,7 +599,8 @@ static irqreturn_t cx25821_upstream_irq_audio(int irq, void *dev_id)if (!dev)return -1 ; - sram_ch = dev->channels[dev->_audio_upstream_channel_select].sram_channels; + sram_ch = dev->channels[dev->_audio_upstream_channel_select]. + sram_channels;$ echo -n "_audio_upstream_channel_select" | wc -c 30
Quoted 2 lines
I think I may have found the problem. (Don't use variable names that are a 30 zillion chars long).
Yes, it's long, but I don't really know how to make it shorter. Is _audio_upstream_channel OK?
Quoted 4 lines
regards,
dan carpenter
Leonid V. Fedorenchik
PATCH v3 11/18 Staging: cx25821: Fix long lines in cx25821-audio-upstream.h
In reply to Leonid V. FedorenchikFix long lines in cx25821-audio-upstream.h
--- drivers/staging/cx25821/cx25821-audio-upstream.h | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-)
drivers/staging/cx25821/cx25821-audio-upstream.h +7 -2
@@ -46,11 +46,16 @@#define USE_RISC_NOOP_AUDIO 1#ifdef USE_RISC_NOOP_AUDIO -#define AUDIO_RISC_DMA_BUF_SIZE (LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE + RISC_JUMP_INSTRUCTION_SIZE) +#define AUDIO_RISC_DMA_BUF_SIZE \ + (LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE + \ + RISC_JUMP_INSTRUCTION_SIZE)#endif #ifndef USE_RISC_NOOP_AUDIO -#define AUDIO_RISC_DMA_BUF_SIZE (LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE) +#define AUDIO_RISC_DMA_BUF_SIZE \ + (LINES_PER_AUDIO_BUFFER*RISC_READ_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + RISC_JUMP_INSTRUCTION_SIZE)#endif static int _line_size;
Signature · 1 line
1.7.0.4
PATCH v3 12/18 Staging: cx25821: Replace :? by if-else in cx25821-video-upstream-ch2.c
In reply to Leonid V. FedorenchikReplace :? operator by if-else equivalent where it improves readability.
--- .../staging/cx25821/cx25821-video-upstream-ch2.c | 23 ++++++++++--------- 1 files changed, 12 insertions(+), 11 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +12 -11
@@ -145,15 +145,16 @@ int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,if (dev->_isNTSC_ch2) { odd_num_lines = singlefield_lines +1 ; risc_program_size =FRAME1_VID_PROG_SIZE ; - frame_size = - (bpl == -Y411_LINE_SZ ) ?FRAME_SIZE_NTSC_Y411 : -FRAME_SIZE_NTSC_Y422 ; +if (bpl ==Y411_LINE_SZ ) + frame_size =FRAME_SIZE_NTSC_Y411 ; +else + frame_size =FRAME_SIZE_NTSC_Y422 ; }else { risc_program_size =PAL_VID_PROG_SIZE ; - frame_size = - (bpl == -Y411_LINE_SZ ) ?FRAME_SIZE_PAL_Y411 :FRAME_SIZE_PAL_Y422 ; +if (bpl ==Y411_LINE_SZ ) + frame_size =FRAME_SIZE_PAL_Y411 ; +else + frame_size =FRAME_SIZE_PAL_Y422 ; }/* Virtual address of Risc buffer program */
@@ -565,10 +566,10 @@ int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, int chan_num, }if (dev->_dma_virt_start_addr_ch2 !=NULL ) { - line_size_in_bytes = - (dev->_pixel_format_ch2 == -PIXEL_FRMT_411 ) ?Y411_LINE_SZ : -Y422_LINE_SZ ; +if (dev->_pixel_format_ch2 ==PIXEL_FRMT_411 ) + line_size_in_bytes =Y411_LINE_SZ ; +else + line_size_in_bytes =Y422_LINE_SZ ; risc_phys_jump_addr = dev->_dma_phys_start_addr_ch2 + odd_risc_prog_size;
Signature · 1 line
1.7.0.4
PATCH v3 13/18 Staging: cx25821: Fix labels' placement in cx25821-video-upstream-ch2.c
In reply to Leonid V. FedorenchikDelete whitespace characters before labels.
--- .../staging/cx25821/cx25821-video-upstream-ch2.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +3 -3
@@ -521,7 +521,7 @@ static int cx25821_upstream_buffer_prepare_ch2(struct cx25821_dev *dev,return 0 ; - error: +error:return ret; }
@@ -720,7 +720,7 @@ int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev,return 0 ; - fail_irq: +fail_irq:cx25821_dev_unregister (dev);return err; }
@@ -830,7 +830,7 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,return 0 ; - error: +error:cx25821_dev_unregister (dev);return err;
Signature · 1 line
1.7.0.4
PATCH v3 14/18 Staging: cx25821: Fix wrong line endings in cx25821-video-upstream-ch2.c
In reply to Leonid V. FedorenchikChange obscure line endings to less obscure ones. Rationale: improve readability.
--- .../staging/cx25821/cx25821-video-upstream-ch2.c | 24 +++++++------------ 1 files changed, 9 insertions(+), 15 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +9 -15
@@ -179,17 +179,14 @@ int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,/* Even field */ rp =cx25821_risc_field_upstream_ch2 (dev, rp, - dev-> - _data_buf_phys_addr_ch2 + - databuf_offset, - bottom_offset,0x200 , bpl, - singlefield_lines, - fifo_enable,EVEN_FIELD ); + dev->_data_buf_phys_addr_ch2 + databuf_offset, + bottom_offset,0x200 , bpl, singlefield_lines, + fifo_enable,EVEN_FIELD );if (frame ==0 ) { risc_flag =RISC_CNT_RESET ; - risc_phys_jump_addr = - dev->_dma_phys_start_addr_ch2 + risc_program_size; + risc_phys_jump_addr = dev->_dma_phys_start_addr_ch2 + + risc_program_size; }else { risc_flag =RISC_CNT_INC ; risc_phys_jump_addr = dev->_dma_phys_start_addr_ch2;
@@ -511,9 +508,8 @@ static int cx25821_upstream_buffer_prepare_ch2(struct cx25821_dev *dev,return ret;/* Creating RISC programs */ - ret = -cx25821_risc_buffer_upstream_ch2 (dev, dev->pci,0 , bpl, - dev->_lines_count_ch2); + ret =cx25821_risc_buffer_upstream_ch2 (dev, dev->pci,0 , bpl, + dev->_lines_count_ch2);if (ret <0 ) {pr_info ("Failed creating Video Upstream Risc programs!\n" ); goto error;
@@ -806,8 +802,7 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, } } - retval = -cx25821_sram_channel_setup_upstream (dev, sram_ch, + retval =cx25821_sram_channel_setup_upstream (dev, sram_ch, dev->_line_size_ch2,0 );/* setup fifo + format */
@@ -817,8 +812,7 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, dev->upstream_databuf_size_ch2 = data_frame_size *2 ;/* Allocating buffers and prepare RISC program */ - retval = -cx25821_upstream_buffer_prepare_ch2 (dev, sram_ch, + retval =cx25821_upstream_buffer_prepare_ch2 (dev, sram_ch, dev->_line_size_ch2);if (retval <0 ) { pr_err("%s: Failed to set up Video upstream buffers!\n",
Signature · 1 line
1.7.0.4
PATCH v3 15/18 Staging: cx25821: Fix long lines in cx25821-video-upstream-ch2.c
In reply to Leonid V. FedorenchikFix long lines in cx25821-video-upstream-ch2.c
--- .../staging/cx25821/cx25821-video-upstream-ch2.c | 26 +++++++------------- 1 files changed, 9 insertions(+), 17 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +9 -17
@@ -40,8 +40,8 @@ MODULE_DESCRIPTION("v4l2 driver module for cx25821 based TV cards");MODULE_AUTHOR ("Hiep Huynh <[email protected]>" );MODULE_LICENSE ("GPL" ); -static int _intr_msk = -FLD_VID_SRC_RISC1 |FLD_VID_SRC_UF |FLD_VID_SRC_SYNC |FLD_VID_SRC_OPC_ERR ; +static int _intr_msk =FLD_VID_SRC_RISC1 |FLD_VID_SRC_UF |FLD_VID_SRC_SYNC | +FLD_VID_SRC_OPC_ERR ; static __le32 *cx25821_update_riscprogram_ch2(struct cx25821_dev *dev, __le32 *rp, unsigned int offset,
@@ -166,13 +166,9 @@ int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,if (UNSET != top_offset) { fifo_enable = (frame ==0 ) ?FIFO_ENABLE :FIFO_DISABLE ; rp =cx25821_risc_field_upstream_ch2 (dev, rp, - dev-> - _data_buf_phys_addr_ch2 - + databuf_offset, - top_offset,0 , bpl, - odd_num_lines, - fifo_enable, -ODD_FIELD ); + dev->_data_buf_phys_addr_ch2 + databuf_offset, + top_offset,0 , bpl, odd_num_lines, fifo_enable, +ODD_FIELD ); } fifo_enable =FIFO_DISABLE ;
@@ -571,14 +567,10 @@ int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, int chan_num, odd_risc_prog_size; rp =cx25821_update_riscprogram_ch2 (dev, - dev-> - _dma_virt_start_addr_ch2, -TOP_OFFSET , - line_size_in_bytes, -0x0 , - singlefield_lines, -FIFO_DISABLE , -ODD_FIELD ); + dev->_dma_virt_start_addr_ch2, +TOP_OFFSET , line_size_in_bytes, +0x0 , singlefield_lines, +FIFO_DISABLE ,ODD_FIELD );/* Jump to Even Risc program of 1st Frame */ *(rp++) =cpu_to_le32 (RISC_JUMP );
Signature · 1 line
1.7.0.4
PATCH v3 16/18 Staging: cx25821: Fix long lines in cx25821-video-upstream-ch2.h
In reply to Leonid V. FedorenchikFix long lines in cx25821-video-upstream-ch2.h
--- .../staging/cx25821/cx25821-video-upstream-ch2.h | 83 ++++++++++++++------ 1 files changed, 60 insertions(+), 23 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream-ch2.h +60 -23
@@ -65,37 +65,74 @@#define USE_RISC_NOOP_VIDEO 1#ifdef USE_RISC_NOOP_VIDEO -#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ - RISC_SYNC_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define PAL_US_VID_PROG_SIZE \ + (PAL_FIELD_HEIGHT * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE)#define PAL_RISC_BUF_SIZE (2 * PAL_US_VID_PROG_SIZE) -#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE) +#define PAL_VID_PROG_SIZE \ + ((PAL_FIELD_HEIGHT * 2) * 3 * DWORD_SIZE + \ + 2 * RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + JUMP_INSTRUCTION_SIZE + 2 * NUM_NO_OPS * DWORD_SIZE) -#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define ODD_FLD_PAL_PROG_SIZE \ + (PAL_FIELD_HEIGHT * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE) -#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ - JUMP_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define NTSC_US_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE) -#define NTSC_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) +#define NTSC_RISC_BUF_SIZE \ + (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) -#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE) -#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define FRAME1_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * \ + 3 * DWORD_SIZE + 2 * RISC_SYNC_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + \ + 2 * NUM_NO_OPS * DWORD_SIZE) + +#define ODD_FLD_NTSC_PROG_SIZE \ + (NTSC_ODD_FLD_LINES * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE)#endif #ifndef USE_RISC_NOOP_VIDEO -#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) -#define PAL_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + PAL_US_VID_PROG_SIZE)) -#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) -#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) -#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) -#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) -#define NTSC_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) -#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) +#define PAL_US_VID_PROG_SIZE \ + ((PAL_FIELD_HEIGHT + 1) * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE) + +#define PAL_RISC_BUF_SIZE \ + (2 * (RISC_SYNC_INSTRUCTION_SIZE + PAL_US_VID_PROG_SIZE)) + +#define PAL_VID_PROG_SIZE \ + ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + \ + 2 * RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + JUMP_INSTRUCTION_SIZE) + +#define ODD_FLD_PAL_PROG_SIZE \ + (PAL_FIELD_HEIGHT * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) + +#define ODD_FLD_NTSC_PROG_SIZE \ + (NTSC_ODD_FLD_LINES * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) + +#define NTSC_US_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) + +#define NTSC_RISC_BUF_SIZE \ + (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) + +#define FRAME1_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * \ + 3 * DWORD_SIZE + 2 * RISC_SYNC_INSTRUCTION_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) +#endif
Signature · 1 line
1.7.0.4
PATCH v3 17/18 Staging: cx25821: Fix long lines in cx25821-video-upstream.c
In reply to Leonid V. FedorenchikFix long lines in cx25821-video-upstream.c
--- drivers/staging/cx25821/cx25821-video-upstream.c | 16 ++++++---------- 1 files changed, 6 insertions(+), 10 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream.c +6 -10
@@ -40,8 +40,8 @@ MODULE_DESCRIPTION("v4l2 driver module for cx25821 based TV cards");MODULE_AUTHOR ("Hiep Huynh <[email protected]>" );MODULE_LICENSE ("GPL" ); -static int _intr_msk = -FLD_VID_SRC_RISC1 |FLD_VID_SRC_UF |FLD_VID_SRC_SYNC |FLD_VID_SRC_OPC_ERR ; +static int _intr_msk =FLD_VID_SRC_RISC1 |FLD_VID_SRC_UF |FLD_VID_SRC_SYNC | +FLD_VID_SRC_OPC_ERR ; int cx25821_sram_channel_setup_upstream(struct cx25821_dev *dev, struct sram_channel *ch,
@@ -615,14 +615,10 @@ int cx25821_video_upstream_irq(struct cx25821_dev *dev, int chan_num, odd_risc_prog_size; rp =cx25821_update_riscprogram (dev, - dev-> - _dma_virt_start_addr, -TOP_OFFSET , - line_size_in_bytes, -0x0 , - singlefield_lines, -FIFO_DISABLE , -ODD_FIELD ); + dev->_dma_virt_start_addr,TOP_OFFSET , + line_size_in_bytes,0x0 , + singlefield_lines,FIFO_DISABLE , +ODD_FIELD );/* Jump to Even Risc program of 1st Frame */ *(rp++) =cpu_to_le32 (RISC_JUMP );
Signature · 1 line
1.7.0.4
PATCH v3 18/18 Staging: cx25821: Fix long lines in cx25821-video-upstream.h
In reply to Leonid V. FedorenchikFix long lines in cx25821-video-upstream.h
--- drivers/staging/cx25821/cx25821-video-upstream.h | 78 +++++++++++++++------- 1 files changed, 54 insertions(+), 24 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream.h +54 -24
@@ -66,44 +66,74 @@#define USE_RISC_NOOP_VIDEO 1#ifdef USE_RISC_NOOP_VIDEO -#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ - RISC_SYNC_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define PAL_US_VID_PROG_SIZE \ + (PAL_FIELD_HEIGHT * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE)#define PAL_RISC_BUF_SIZE (2 * PAL_US_VID_PROG_SIZE) -#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE) +#define PAL_VID_PROG_SIZE \ + ((PAL_FIELD_HEIGHT * 2) * 3 * DWORD_SIZE + \ + 2 * RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + JUMP_INSTRUCTION_SIZE + 2 * NUM_NO_OPS * DWORD_SIZE) -#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define ODD_FLD_PAL_PROG_SIZE \ + (PAL_FIELD_HEIGHT * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE) -#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define ODD_FLD_NTSC_PROG_SIZE \ + (NTSC_ODD_FLD_LINES * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE) -#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ - JUMP_INSTRUCTION_SIZE + NUM_NO_OPS*DWORD_SIZE) +#define NTSC_US_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + \ + NUM_NO_OPS * DWORD_SIZE) -#define NTSC_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) +#define NTSC_RISC_BUF_SIZE \ + (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) -#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE + 2*NUM_NO_OPS*DWORD_SIZE) +#define FRAME1_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + \ + 2 * RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + JUMP_INSTRUCTION_SIZE + 2 * NUM_NO_OPS * DWORD_SIZE)#endif #ifndef USE_RISC_NOOP_VIDEO -#define PAL_US_VID_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ - RISC_SYNC_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) +#define PAL_US_VID_PROG_SIZE \ + (PAL_FIELD_HEIGHT * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + RISC_SYNC_INSTRUCTION_SIZE + \ + JUMP_INSTRUCTION_SIZE) -#define PAL_RISC_BUF_SIZE (2 * PAL_US_VID_PROG_SIZE) +#define PAL_RISC_BUF_SIZE (2 * PAL_US_VID_PROG_SIZE) + +#define PAL_VID_PROG_SIZE \ + ((PAL_FIELD_HEIGHT * 2) * 3 * DWORD_SIZE + \ + 2 * RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + JUMP_INSTRUCTION_SIZE) + +#define ODD_FLD_PAL_PROG_SIZE \ + (PAL_FIELD_HEIGHT * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) + +#define ODD_FLD_NTSC_PROG_SIZE \ + (NTSC_ODD_FLD_LINES * 3 * DWORD_SIZE + \ + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) + +#define NTSC_US_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + \ + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) -#define PAL_VID_PROG_SIZE ((PAL_FIELD_HEIGHT*2) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) +#define NTSC_RISC_BUF_SIZE \ + (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) -#define ODD_FLD_PAL_PROG_SIZE ((PAL_FIELD_HEIGHT) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) -#define ODD_FLD_NTSC_PROG_SIZE ((NTSC_ODD_FLD_LINES) * 3 * DWORD_SIZE + RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE) +#define FRAME1_VID_PROG_SIZE \ + ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + \ + 2 * RISC_SYNC_INSTRUCTION_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + \ + JUMP_INSTRUCTION_SIZE) -#define NTSC_US_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + 1) * 3 * DWORD_SIZE + RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE) -#define NTSC_RISC_BUF_SIZE (2 * (RISC_SYNC_INSTRUCTION_SIZE + NTSC_US_VID_PROG_SIZE)) -#define FRAME1_VID_PROG_SIZE ((NTSC_ODD_FLD_LINES + NTSC_FIELD_HEIGHT) * 3 * DWORD_SIZE + 2*RISC_SYNC_INSTRUCTION_SIZE + \ - RISC_WRITECR_INSTRUCTION_SIZE + JUMP_INSTRUCTION_SIZE)#endif
Signature · 1 line
1.7.0.4