DRM: ast: Fixed coding style issues of ast_mode.c
Subsystems (3)
PATCH 1/1 DRM: ast: Fixed coding style issues of ast_mode.c
Removed space before comma, fixed if statements by putting trailing statements on new line, fixed unsigned int declaration, and removed not needed else statement after return.
Signed-off-by Gregory Williams <[email protected]>
--- drivers/gpu/drm/ast/ast_mode.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-)
drivers/gpu/drm/ast/ast_mode.c +20 -11
@@ -275,7 +275,7 @@ static void ast_set_std_reg(struct ast_private *ast,ast_set_index_reg_mask (ast,AST_IO_SEQ_PORT ,0x01 ,0xdf , stdtable->seq[0 ]);for (i =1 ; i <4 ; i++) { jreg = stdtable->seq[i]; -ast_set_index_reg (ast,AST_IO_SEQ_PORT , (i +1 ) , jreg); +ast_set_index_reg (ast,AST_IO_SEQ_PORT , (i +1 ), jreg); }/* Set CRTC; except base address and offset */
@@ -498,13 +498,15 @@ static void ast_set_sync_reg(struct ast_private *ast, jreg =ast_io_read8 (ast,AST_IO_MISC_PORT_READ ); jreg &= ~0xC0 ; -if (vbios_mode->enh_table->flags & NVSync) jreg |=0x80 ; -if (vbios_mode->enh_table->flags & NHSync) jreg |=0x40 ; +if (vbios_mode->enh_table->flags & NVSync) + jreg |=0x80 ; +if (vbios_mode->enh_table->flags & NHSync) + jreg |=0x40 ;ast_io_write8 (ast,AST_IO_MISC_PORT_WRITE , jreg); }static void ast_set_start_address_crt1 (struct ast_private *ast, -unsigned offset) +unsigned int offset) {u32 addr;
@@ -1212,6 +1214,7 @@ static int ast_get_modes(struct drm_connector *connector)struct edid *edid;int ret;bool flags = false; +if (ast->tx_chip_type ==AST_TX_DP501 ) { ast->dp501_maxclk =0xff ; edid =kmalloc (128 ,GFP_KERNEL );
@@ -1231,8 +1234,8 @@ static int ast_get_modes(struct drm_connector *connector) ret =drm_add_edid_modes (connector, edid);kfree (edid);return ret; - }else -drm_connector_update_edid_property (&ast_connector->base,NULL ); + } +drm_connector_update_edid_property (&ast_connector->base,NULL );return 0 ; }
@@ -1272,19 +1275,24 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector, }switch (mode->hdisplay) {case 640 : -if (mode->vdisplay ==480 ) flags =MODE_OK ; +if (mode->vdisplay ==480 ) + flags =MODE_OK ;break ;case 800 : -if (mode->vdisplay ==600 ) flags =MODE_OK ; +if (mode->vdisplay ==600 ) + flags =MODE_OK ;break ;case 1024 : -if (mode->vdisplay ==768 ) flags =MODE_OK ; +if (mode->vdisplay ==768 ) + flags =MODE_OK ;break ;case 1280 : -if (mode->vdisplay ==1024 ) flags =MODE_OK ; +if (mode->vdisplay ==1024 ) + flags =MODE_OK ;break ;case 1600 : -if (mode->vdisplay ==1200 ) flags =MODE_OK ; +if (mode->vdisplay ==1200 ) + flags =MODE_OK ;break ;default :return flags;
@@ -1296,6 +1304,7 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,static void ast_connector_destroy (struct drm_connector *connector) {struct ast_connector *ast_connector =to_ast_connector (connector); +ast_i2c_destroy (ast_connector->i2c);drm_connector_cleanup (connector); }
Signature · 1 line
2.17.1
Thomas Zimmermann
maintainerHi
Am 31.07.21 um 02:53 schrieb Gregory Williams:
Quoted 5 lines
Removed space before comma, fixed if statements by putting trailing statements on new line, fixed unsigned int declaration, and removed not needed else statement after return.
Signed-off-by Gregory Williams <[email protected]>
Added to drm-misc-next. Thanks for the patch.
Best regards
Thomas
Quoted 94 lines
--- drivers/gpu/drm/ast/ast_mode.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-)drivers/gpu/drm/ast/ast_mode.c +20
-11@@ -275,7 +275,7 @@ static void ast_set_std_reg(struct ast_private *ast,ast_set_index_reg_mask (ast,AST_IO_SEQ_PORT ,0x01 ,0xdf , stdtable->seq[0 ]);for (i =1 ; i <4 ; i++) { jreg = stdtable->seq[i]; -ast_set_index_reg (ast,AST_IO_SEQ_PORT , (i +1 ) , jreg); +ast_set_index_reg (ast,AST_IO_SEQ_PORT , (i +1 ), jreg); }/* Set CRTC; except base address and offset */ @@ -498,13 +498,15 @@ static void ast_set_sync_reg(struct ast_private *ast, jreg =ast_io_read8 (ast,AST_IO_MISC_PORT_READ ); jreg &= ~0xC0 ; -if (vbios_mode->enh_table->flags & NVSync) jreg |=0x80 ; -if (vbios_mode->enh_table->flags & NHSync) jreg |=0x40 ; +if (vbios_mode->enh_table->flags & NVSync) + jreg |=0x80 ; +if (vbios_mode->enh_table->flags & NHSync) + jreg |=0x40 ;ast_io_write8 (ast,AST_IO_MISC_PORT_WRITE , jreg); }static void ast_set_start_address_crt1 (struct ast_private *ast, -unsigned offset) +unsigned int offset) {u32 addr;@@ -1212,6 +1214,7 @@ static int ast_get_modes(struct drm_connector *connector)struct edid *edid;int ret;bool flags = false; +if (ast->tx_chip_type ==AST_TX_DP501 ) { ast->dp501_maxclk =0xff ; edid =kmalloc (128 ,GFP_KERNEL );@@ -1231,8 +1234,8 @@ static int ast_get_modes(struct drm_connector *connector) ret =drm_add_edid_modes (connector, edid);kfree (edid);return ret; - }else -drm_connector_update_edid_property (&ast_connector->base,NULL ); + } +drm_connector_update_edid_property (&ast_connector->base,NULL );return 0 ; }@@ -1272,19 +1275,24 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector, }switch (mode->hdisplay) {case 640 : -if (mode->vdisplay ==480 ) flags =MODE_OK ; +if (mode->vdisplay ==480 ) + flags =MODE_OK ;break ;case 800 : -if (mode->vdisplay ==600 ) flags =MODE_OK ; +if (mode->vdisplay ==600 ) + flags =MODE_OK ;break ;case 1024 : -if (mode->vdisplay ==768 ) flags =MODE_OK ; +if (mode->vdisplay ==768 ) + flags =MODE_OK ;break ;case 1280 : -if (mode->vdisplay ==1024 ) flags =MODE_OK ; +if (mode->vdisplay ==1024 ) + flags =MODE_OK ;break ;case 1600 : -if (mode->vdisplay ==1200 ) flags =MODE_OK ; +if (mode->vdisplay ==1200 ) + flags =MODE_OK ;break ;default :return flags;@@ -1296,6 +1304,7 @@ static enum drm_mode_status ast_mode_valid(struct drm_connector *connector,static void ast_connector_destroy (struct drm_connector *connector) {struct ast_connector *ast_connector =to_ast_connector (connector); +ast_i2c_destroy (ast_connector->i2c);drm_connector_cleanup (connector); }
Signature · 6 lines
Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Felix Imendörffer