Staging: cx25821: fix style issues
cover Staging: cx25821: fix style issues
This patch series fixes various coding style issues in drivers/staging/cx25821
PATCH 1/3 Staging: cx25821: fix style issues in cx25821-audio-upstream
Fix long lines in cx25821-audio-upstream.c and cx25821-audio-upstream.h Change obscure line endings to less obscure ones.
--- drivers/staging/cx25821/cx25821-audio-upstream.c | 33 ++++++++------------- drivers/staging/cx25821/cx25821-audio-upstream.h | 9 ++++- 2 files changed, 20 insertions(+), 22 deletions(-)
drivers/staging/cx25821/cx25821-audio-upstream.c +13 -20
@@ -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++) {
@@ -555,8 +551,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 );
@@ -604,18 +599,17 @@ 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);/* 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 +764,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 +773,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);
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 2/3 Staging: cx25821: fix style issues in cx25821-video-upstream-ch2
In reply to Leonid V. FedorenchikFix long lines in files cx25821-video-upstream-ch2.{c,h} Change obscure line endings to less obscure ones. Delete whitespace characters before labels.
--- .../staging/cx25821/cx25821-video-upstream-ch2.c | 75 ++++++++------------ .../staging/cx25821/cx25821-video-upstream-ch2.h | 70 ++++++++++++------ 2 files changed, 76 insertions(+), 69 deletions(-)
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +29 -46
@@ -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,
@@ -151,9 +151,8 @@ int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,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 ; + frame_size = (bpl ==Y411_LINE_SZ ) ?FRAME_SIZE_PAL_Y411 : +FRAME_SIZE_PAL_Y422 ; }/* Virtual address of Risc buffer program */
@@ -165,30 +164,23 @@ 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 ; -/* Even field */ +/* 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;
@@ -510,9 +502,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;
@@ -520,7 +511,7 @@ static int cx25821_upstream_buffer_prepare_ch2(struct cx25821_dev *dev,return 0 ; - error: +error:return ret; }
@@ -565,23 +556,18 @@ 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 ; + line_size_in_bytes = (dev->_pixel_format_ch2 == +PIXEL_FRMT_411 ) ?Y411_LINE_SZ : +Y422_LINE_SZ ; risc_phys_jump_addr = - dev->_dma_phys_start_addr_ch2 + - odd_risc_prog_size; + dev->_dma_phys_start_addr_ch2 + + 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 );
@@ -719,7 +705,7 @@ int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev,return 0 ; - fail_irq: +fail_irq:cx25821_dev_unregister (dev);return err; }
@@ -805,8 +791,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 */
@@ -816,8 +801,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",
@@ -829,8 +813,7 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,return 0 ; - error: +error:cx25821_dev_unregister (dev); -return err; }
drivers/staging/cx25821/cx25821-video-upstream-ch2.h +47 -23
84 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Re: [PATCH 2/3] Staging: cx25821: fix style issues in cx25821-video-upstream-ch2
Quoted 3 lines · Leonid V. Fedorenchik
Fix long lines in files cx25821-video-upstream-ch2.{c,h} Change obscure line endings to less obscure ones. Delete whitespace characters before labels.
[]
drivers/staging/cx25821/cx25821-video-upstream-ch2.c int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,
Quoted 5 lines
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +0
-0@@ -151,9 +151,8 @@ int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev,
[]
drivers/staging/cx25821/cx25821-video-upstream-ch2.c int cx25821_risc_buffer_upstream_ch2(struct cx25821_dev *dev, · line 155
Quoted 5 lines
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +2
-3- frame_size = - (bpl == -Y411_LINE_SZ ) ?FRAME_SIZE_PAL_Y411 :FRAME_SIZE_PAL_Y422 ; + frame_size = (bpl ==Y411_LINE_SZ ) ?FRAME_SIZE_PAL_Y411 : +FRAME_SIZE_PAL_Y422 ;
I think this becomes more readable without the ?: as:
if (bpl == Y411_LINE_SZ) frame_size = FRAME_SIZE_PAL_Y411; else frame_size = FRAME_SIZE_PAL_Y422;
drivers/staging/cx25821/cx25821-video-upstream-ch2.c int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, int chan_num, · line 561
Quoted 11 lines
drivers/staging/cx25821/cx25821-video-upstream-ch2.c +3
-4@@ -565,23 +556,18 @@ 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 ; + line_size_in_bytes = (dev->_pixel_format_ch2 == +PIXEL_FRMT_411 ) ?Y411_LINE_SZ : +Y422_LINE_SZ ;
no ?: here too.
drivers/staging/cx25821/cx25821-video-upstream-ch2.h
Quoted 1 line
drivers/staging/cx25821/cx25821-video-upstream-ch2.h +0
-0
[]
drivers/staging/cx25821/cx25821-video-upstream-ch2.h line 70
Quoted 9 lines
drivers/staging/cx25821/cx25821-video-upstream-ch2.h +3
-2@@ -65,37 +65,61 @@#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)
These multi line macros might be more readable and consistent if indented identically.
#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)
PAL_FIELD_HEIGHT does not needs parentheses here.
[]
drivers/staging/cx25821/cx25821-video-upstream-ch2.h line 76
Quoted 3 lines
drivers/staging/cx25821/cx25821-video-upstream-ch2.h +3
-0+#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)
drivers/staging/cx25821/cx25821-video-upstream-ch2.h line 80
Quoted 3 lines
drivers/staging/cx25821/cx25821-video-upstream-ch2.h +3
-0+#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)
etc...
PATCH 3/3 Staging: cx25821: fix style issues in cx25821-video-upstream
In reply to Leonid V. FedorenchikFix too long lines in files cx25821-video-upstream.{c,h}
--- drivers/staging/cx25821/cx25821-video-upstream.c | 16 ++--- drivers/staging/cx25821/cx25821-video-upstream.h | 65 ++++++++++++++-------- 2 files changed, 48 insertions(+), 33 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 );
drivers/staging/cx25821/cx25821-video-upstream.h +42 -23
86 lines not on this page · raw message
Signature · 1 line
1.7.0.4