From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32696C10F27 for ; Tue, 10 Mar 2020 13:10:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F29D92468D for ; Tue, 10 Mar 2020 13:10:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845827; bh=4TsMt/hkVyeNp32B7AhGN4QkaO1VpBI7eNal2nbGosw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=pmgPVRJVE7laTF22P4GidqVGCSYQaH1wQcWbgIDnErRGAX/Z8450B7QDI9AQXaOGD Ya0Ph8E6KIkVPppKvp5Z6itaeuo911tqNl2rI6qZLvOVsFieqHYcPG/d5ka8TcHGhM gY/skuIpqaywuSWBMdWWCq5nCp3wS+ddKIq6meWk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728197AbgCJNKZ (ORCPT ); Tue, 10 Mar 2020 09:10:25 -0400 Received: from mail.kernel.org ([198.145.29.99]:59692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731323AbgCJNKX (ORCPT ); Tue, 10 Mar 2020 09:10:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6758D2468D; Tue, 10 Mar 2020 13:10:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1583845821; bh=4TsMt/hkVyeNp32B7AhGN4QkaO1VpBI7eNal2nbGosw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tbElbyu4BJdxbdHO4/Bo17oL7kPSgDqUztFwgLWXKBiTkI6zM06l3RS6KX5XnlWlp doh0ce6E0JQNxtiuf0YoO5hfcqdBmjlGhz/mLSEvlaRMHuO1PCyjoy7YxrLR5A8XZN PIci4fTlxyK/Y9Pz2atywTTfr3moW5vub7WyVCD4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Takashi Iwai , Cezary Rojewski , Mark Brown Subject: [PATCH 4.14 112/126] ASoC: intel: skl: Fix pin debug prints Date: Tue, 10 Mar 2020 13:42:13 +0100 Message-Id: <20200310124210.701409699@linuxfoundation.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200310124203.704193207@linuxfoundation.org> References: <20200310124203.704193207@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai commit 64bbacc5f08c01954890981c63de744df1f29a30 upstream. skl_print_pins() loops over all given pins but it overwrites the text at the very same position while increasing the returned length. Fix this to show the all pin contents properly. Fixes: d14700a01f91 ("ASoC: Intel: Skylake: Debugfs facility to dump module config") Signed-off-by: Takashi Iwai Acked-by: Cezary Rojewski Link: https://lore.kernel.org/r/20200218111737.14193-2-tiwai@suse.de Signed-off-by: Mark Brown Signed-off-by: Greg Kroah-Hartman --- sound/soc/intel/skylake/skl-debug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/sound/soc/intel/skylake/skl-debug.c +++ b/sound/soc/intel/skylake/skl-debug.c @@ -42,7 +42,7 @@ static ssize_t skl_print_pins(struct skl int i; ssize_t ret = 0; - for (i = 0; i < max_pin; i++) + for (i = 0; i < max_pin; i++) { ret += snprintf(buf + size, MOD_BUF - size, "%s %d\n\tModule %d\n\tInstance %d\n\t" "In-used %s\n\tType %s\n" @@ -53,6 +53,8 @@ static ssize_t skl_print_pins(struct skl m_pin[i].in_use ? "Used" : "Unused", m_pin[i].is_dynamic ? "Dynamic" : "Static", m_pin[i].pin_state, i); + size += ret; + } return ret; }