Skip to content

Commit

Permalink
drm/sti: Reduce function calls for sequence output at five places
Browse files Browse the repository at this point in the history
Some data were put into a sequence by separate function calls.
Print the same data by five single function calls instead.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Benjamin Gaignard <benjamin.gaignard@linaro.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1f5c5b0d-77c4-6efc-7906-cee76c33d2b0@users.sourceforge.net
  • Loading branch information
Markus Elfring authored and Benjamin Gaignard committed May 9, 2017
1 parent adea1db commit ecf79d1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 10 deletions.
3 changes: 1 addition & 2 deletions drivers/gpu/drm/sti/sti_gdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ static void gdp_node_dump_node(struct seq_file *s, struct sti_gdp_node *node)
seq_printf(s, "\n\tKEY2 0x%08X", node->gam_gdp_key2);
seq_printf(s, "\n\tPPT 0x%08X", node->gam_gdp_ppt);
gdp_dbg_ppt(s, node->gam_gdp_ppt);
seq_printf(s, "\n\tCML 0x%08X", node->gam_gdp_cml);
seq_puts(s, "\n");
seq_printf(s, "\n\tCML 0x%08X\n", node->gam_gdp_cml);
}

static int gdp_node_dbg_show(struct seq_file *s, void *arg)
Expand Down
6 changes: 2 additions & 4 deletions drivers/gpu/drm/sti/sti_hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,8 +320,7 @@ static void hda_dbg_awg_microcode(struct seq_file *s, void __iomem *reg)
{
unsigned int i;

seq_puts(s, "\n\n");
seq_puts(s, " HDA AWG microcode:");
seq_puts(s, "\n\n HDA AWG microcode:");
for (i = 0; i < AWG_MAX_INST; i++) {
if (i % 8 == 0)
seq_printf(s, "\n %04X:", i);
Expand All @@ -333,8 +332,7 @@ static void hda_dbg_video_dacs_ctrl(struct seq_file *s, void __iomem *reg)
{
u32 val = readl(reg);

seq_puts(s, "\n");
seq_printf(s, "\n %-25s 0x%08X", "VIDEO_DACS_CONTROL", val);
seq_printf(s, "\n\n %-25s 0x%08X", "VIDEO_DACS_CONTROL", val);
seq_puts(s, "\tHD DACs ");
seq_puts(s, val & DAC_CFG_HD_HZUVW_OFF_MASK ? "disabled" : "enabled");
}
Expand Down
6 changes: 2 additions & 4 deletions drivers/gpu/drm/sti/sti_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,7 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD4, HDMI_IFRAME_SLOT_AVI);
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD5, HDMI_IFRAME_SLOT_AVI);
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_AVI);
seq_puts(s, "\n");
seq_printf(s, "\n AUDIO Infoframe (Data Island slot N=%d):",
seq_printf(s, "\n\n AUDIO Infoframe (Data Island slot N=%d):",
HDMI_IFRAME_SLOT_AUDIO);
DBGFS_DUMP_DI(HDMI_SW_DI_N_HEAD_WORD, HDMI_IFRAME_SLOT_AUDIO);
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD0, HDMI_IFRAME_SLOT_AUDIO);
Expand All @@ -703,8 +702,7 @@ static int hdmi_dbg_show(struct seq_file *s, void *data)
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD4, HDMI_IFRAME_SLOT_AUDIO);
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD5, HDMI_IFRAME_SLOT_AUDIO);
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD6, HDMI_IFRAME_SLOT_AUDIO);
seq_puts(s, "\n");
seq_printf(s, "\n VENDOR SPECIFIC Infoframe (Data Island slot N=%d):",
seq_printf(s, "\n\n VENDOR SPECIFIC Infoframe (Data Island slot N=%d):",
HDMI_IFRAME_SLOT_VENDOR);
DBGFS_DUMP_DI(HDMI_SW_DI_N_HEAD_WORD, HDMI_IFRAME_SLOT_VENDOR);
DBGFS_DUMP_DI(HDMI_SW_DI_N_PKT_WORD0, HDMI_IFRAME_SLOT_VENDOR);
Expand Down

0 comments on commit ecf79d1

Please sign in to comment.