<div class="zcontentRow"><p><span style="font-family: Arial, Helvetica, "Microsoft Yahei", sans-serif; background-color: rgb(255, 255, 255);">From: XieLudan <xie.ludan@zte.com.cn></span></p><p><br></p><p>Follow the advice in Documentation/filesystems/sysfs.rst:</p><p>show() should only use sysfs_emit() or sysfs_emit_at() when formatting</p><p>the value to be returned to user space.</p><p><br></p><p>Signed-off-by: XieLudan <xie.ludan@zte.com.cn></p><p>---</p><p> sound/soc/fsl/imx-audmux.c | 26 +++++++++++---------------</p><p> 1 file changed, 11 insertions(+), 15 deletions(-)</p><p><br></p><p>diff --git a/sound/soc/fsl/imx-audmux.c b/sound/soc/fsl/imx-audmux.c</p><p>index cc2918ee2cf5..6062503d3543 100644</p><p>--- a/sound/soc/fsl/imx-audmux.c</p><p>+++ b/sound/soc/fsl/imx-audmux.c</p><p>@@ -77,45 +77,41 @@ static ssize_t audmux_read_file(struct file *file, char __user *user_buf,</p><p> <span style="white-space:pre">    </span>ret = sysfs_emit(buf, "PDCR: %08x\nPTCR: %08x\n", pdcr, ptcr);</p><p> </p><p> <span style="white-space:pre">   </span>if (ptcr & IMX_AUDMUX_V2_PTCR_TFSDIR)</p><p>-<span style="white-space:pre">                </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>+<span style="white-space:pre">             </span>ret += sysfs_emit(buf + ret,</p><p> <span style="white-space:pre">                                </span>"TxFS output from %s, ",</p><p> <span style="white-space:pre">                          </span>audmux_port_string((ptcr >> 27) & 0x7));</p><p> <span style="white-space:pre">  </span>else</p><p>-<span style="white-space:pre">             </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>+<span style="white-space:pre">             </span>ret += sysfs_emit(buf + ret,</p><p> <span style="white-space:pre">                                </span>"TxFS input, ");</p><p> </p><p> <span style="white-space:pre"> </span>if (ptcr & IMX_AUDMUX_V2_PTCR_TCLKDIR)</p><p>-<span style="white-space:pre">               </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>+<span style="white-space:pre">             </span>ret += sysfs_emit(buf + ret,</p><p> <span style="white-space:pre">                                </span>"TxClk output from %s",</p><p> <span style="white-space:pre">                           </span>audmux_port_string((ptcr >> 22) & 0x7));</p><p> <span style="white-space:pre">  </span>else</p><p>-<span style="white-space:pre">             </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>-<span style="white-space:pre">                             </span>"TxClk input");</p><p>+<span style="white-space:pre">                </span>ret += sysfs_emit(buf + ret, "TxClk input");</p><p> </p><p>-<span style="white-space:pre">  </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret, "\n");</p><p>+<span style="white-space:pre">    </span>ret += sysfs_emit(buf + ret, "\n");</p><p> </p><p> <span style="white-space:pre">      </span>if (ptcr & IMX_AUDMUX_V2_PTCR_SYN) {</p><p>-<span style="white-space:pre">         </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>-<span style="white-space:pre">                             </span>"Port is symmetric");</p><p>+<span style="white-space:pre">          </span>ret += sysfs_emit(buf + ret, "Port is symmetric");</p><p> <span style="white-space:pre">        </span>} else {</p><p> <span style="white-space:pre">            </span>if (ptcr & IMX_AUDMUX_V2_PTCR_RFSDIR)</p><p>-<span style="white-space:pre">                        </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>+<span style="white-space:pre">                     </span>ret += sysfs_emit(buf + ret,</p><p> <span style="white-space:pre">                                        </span>"RxFS output from %s, ",</p><p> <span style="white-space:pre">                                  </span>audmux_port_string((ptcr >> 17) & 0x7));</p><p> <span style="white-space:pre">          </span>else</p><p>-<span style="white-space:pre">                     </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>-<span style="white-space:pre">                                     </span>"RxFS input, ");</p><p>+<span style="white-space:pre">                       </span>ret += sysfs_emit(buf + ret, "RxFS input, ");</p><p> </p><p> <span style="white-space:pre">            </span>if (ptcr & IMX_AUDMUX_V2_PTCR_RCLKDIR)</p><p>-<span style="white-space:pre">                       </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>+<span style="white-space:pre">                     </span>ret += sysfs_emit(buf + ret,</p><p> <span style="white-space:pre">                                        </span>"RxClk output from %s",</p><p> <span style="white-space:pre">                                   </span>audmux_port_string((ptcr >> 12) & 0x7));</p><p> <span style="white-space:pre">          </span>else</p><p>-<span style="white-space:pre">                     </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>-<span style="white-space:pre">                                     </span>"RxClk input");</p><p>+<span style="white-space:pre">                        </span>ret += sysfs_emit(buf + ret, "RxClk input");</p><p> <span style="white-space:pre">      </span>}</p><p> </p><p>-<span style="white-space:pre">       </span>ret += scnprintf(buf + ret, PAGE_SIZE - ret,</p><p>+<span style="white-space:pre">     </span>ret += sysfs_emit(buf + ret,</p><p> <span style="white-space:pre">                        </span>"\nData received from %s\n",</p><p> <span style="white-space:pre">                      </span>audmux_port_string((pdcr >> 13) & 0x7));</p><p> </p><p>-- </p><p>2.25.1</p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p><p style="font-size:14px;font-family:微软雅黑,Microsoft YaHei;"><br></p></div>