* [PATCH] DRM: ast: Fixed coding style issues of ast_mode.c
@ 2021-07-31 0:53 Gregory Williams
2021-08-01 13:14 ` Thomas Zimmermann
0 siblings, 1 reply; 2+ messages in thread
From: Gregory Williams @ 2021-07-31 0:53 UTC (permalink / raw)
To: airlied; +Cc: tzimmermann, daniel, dri-devel
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 <gregwills85@gmail.com>
---
drivers/gpu/drm/ast/ast_mode.c | 31 ++++++++++++++++++++-----------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 36d9575aa27b..1310ed092073 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -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);
}
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] DRM: ast: Fixed coding style issues of ast_mode.c
2021-07-31 0:53 [PATCH] DRM: ast: Fixed coding style issues of ast_mode.c Gregory Williams
@ 2021-08-01 13:14 ` Thomas Zimmermann
0 siblings, 0 replies; 2+ messages in thread
From: Thomas Zimmermann @ 2021-08-01 13:14 UTC (permalink / raw)
To: Gregory Williams, airlied; +Cc: daniel, dri-devel
[-- Attachment #1.1: Type: text/plain, Size: 3846 bytes --]
Hi
Am 31.07.21 um 02:53 schrieb Gregory Williams:
> 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 <gregwills85@gmail.com>
Added to drm-misc-next. Thanks for the patch.
Best regards
Thomas
> ---
> drivers/gpu/drm/ast/ast_mode.c | 31 ++++++++++++++++++++-----------
> 1 file changed, 20 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index 36d9575aa27b..1310ed092073 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -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);
> }
>
--
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-08-01 13:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-07-31 0:53 [PATCH] DRM: ast: Fixed coding style issues of ast_mode.c Gregory Williams
2021-08-01 13:14 ` Thomas Zimmermann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.