Received: by 10.223.185.116 with SMTP id b49csp1118389wrg; Wed, 14 Feb 2018 11:57:07 -0800 (PST) X-Google-Smtp-Source: AH8x224BHYprgOr89m8uaDc4GPBPP3Ow1HnYh7jspNu2tkUVnoHrw6GOu9rWzox/jCsaysaiYxl6 X-Received: by 10.98.26.143 with SMTP id a137mr208297pfa.100.1518638227785; Wed, 14 Feb 2018 11:57:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518638227; cv=none; d=google.com; s=arc-20160816; b=RnxYk7ObSuFoPzPFET3Vu65mU1CwDRa+9Npb1lAgPkY8Z5MkGnKHR106eQ9dJmwGSH BD3AWloMt2RyghklCOdQvd11zcuCaKvzPRja5nDIN3fZ+4C9XetdAq+P2hxZyKK73JxE dVIW4EWyc2CWX95xNbCqnwYEN0e4XaScQ+AEkuMztZm/o90FmClaJ+4xbDLulXpvjJZw VlN9sOfQP6P1LEJUY6cS3NUbqISRuJNNtDKZEHJEXHtjtwiRebs0p5OxLWOvakIEdP42 up2oqUVf29jZscyFJKfvgO0VnRwyiLXqx7jJYiXTxB7z+EqqQgCoSAttVs0CFATysKDp 2ryg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:message-id:in-reply-to:subject:cc:to :from:dkim-signature:arc-authentication-results; bh=wieEoccTY82vC0jhlu2bzF94gWdJjJna7Mh2PlHcsgg=; b=Yd/TXv2AejRNUFg3onSL/PEWtg+ilpn2f3X31/upL/B0ujiwyW/1jEIVftIGRqCOCM Hr4r1CFczDrxIlGdo7QZRypn6BczBqi6AYMWbNevsfIM9TuH2B3hg4CYfvxZuYETw6Rx tPMeVvtOiV6hexEwoCAFHi2yxKWurmewH5LTo6ii5KICpoRvo8Au3Cz3H+UST9GEIqKp oPyOymOYdSPHgJQ+pieGKW1Xs2V0XOcBovDkojZJRo387TBBb5VT37lxNbPWGNOfzPpH wVGyem3daRM8gnmaYDkp4qjhgDWOBjqXSGRy8/Wuti1pDmrD01ZYpdYBfpdJVJRpSaLG lJ5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Xh0q7mhg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t12si317756pgb.190.2018.02.14.11.56.53; Wed, 14 Feb 2018 11:57:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Xh0q7mhg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031213AbeBNPTk (ORCPT + 99 others); Wed, 14 Feb 2018 10:19:40 -0500 Received: from heliosphere.sirena.org.uk ([172.104.155.198]:51196 "EHLO heliosphere.sirena.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030839AbeBNPTh (ORCPT ); Wed, 14 Feb 2018 10:19:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sirena.org.uk; s=20170815-heliosphere; h=Date:Message-Id:In-Reply-To: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner: List-Archive; bh=wieEoccTY82vC0jhlu2bzF94gWdJjJna7Mh2PlHcsgg=; b=Xh0q7mhguozT pN5wQaORie8VcpuZ7bK6cGiJwRn6gAZuc0sjAyL1Bw6jfsZemDGRausHWdP7dVaiFgYKePQjAvEgS ei3Kf+AAKB7SWBFV1mcwKi6k1oTb7Z3iUKFXhytibAQwFomEn7rDUc5dgGVta77L7kyBM80NWA4mO RLJ1A=; Received: from debutante.sirena.org.uk ([2001:470:1f1d:6b5::3] helo=debutante) by heliosphere.sirena.org.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1elyqE-0005S9-QR; Wed, 14 Feb 2018 15:19:26 +0000 Received: from broonie by debutante with local (Exim 4.90_1) (envelope-from ) id 1elyqE-0002KT-59; Wed, 14 Feb 2018 15:19:26 +0000 From: Mark Brown To: Peng Donglin Cc: Mark Brown , lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, andy.shevchenko@gmail.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, alsa-devel@alsa-project.org Subject: Applied "ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication" to the asoc tree In-Reply-To: <1518619687-31442-1-git-send-email-dolinux.peng@gmail.com> Message-Id: Date: Wed, 14 Feb 2018 15:19:26 +0000 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The patch ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication has been applied to the asoc tree at https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark From 658829d5f40f764d708e544dd85061ef3c3110fd Mon Sep 17 00:00:00 2001 From: Peng Donglin Date: Wed, 14 Feb 2018 22:48:07 +0800 Subject: [PATCH] ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication There is some duplicate code in soc-core.c, and the kernel provides DEFINE_SHOW_ATTRIBUTE() helper macro to decrease it in seq_file.h. Signed-off-by: Peng Donglin Reviewed-by: Andy Shevchenko Signed-off-by: Mark Brown --- sound/soc/soc-core.c | 45 ++++++--------------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index b928c59ea775..a2c9aa473324 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -349,7 +349,7 @@ static void soc_init_codec_debugfs(struct snd_soc_component *component) "ASoC: Failed to create codec register debugfs file\n"); } -static int codec_list_seq_show(struct seq_file *m, void *v) +static int codec_list_show(struct seq_file *m, void *v) { struct snd_soc_codec *codec; @@ -362,20 +362,9 @@ static int codec_list_seq_show(struct seq_file *m, void *v) return 0; } +DEFINE_SHOW_ATTRIBUTE(codec_list); -static int codec_list_seq_open(struct inode *inode, struct file *file) -{ - return single_open(file, codec_list_seq_show, NULL); -} - -static const struct file_operations codec_list_fops = { - .open = codec_list_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int dai_list_seq_show(struct seq_file *m, void *v) +static int dai_list_show(struct seq_file *m, void *v) { struct snd_soc_component *component; struct snd_soc_dai *dai; @@ -390,20 +379,9 @@ static int dai_list_seq_show(struct seq_file *m, void *v) return 0; } +DEFINE_SHOW_ATTRIBUTE(dai_list); -static int dai_list_seq_open(struct inode *inode, struct file *file) -{ - return single_open(file, dai_list_seq_show, NULL); -} - -static const struct file_operations dai_list_fops = { - .open = dai_list_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; - -static int platform_list_seq_show(struct seq_file *m, void *v) +static int platform_list_show(struct seq_file *m, void *v) { struct snd_soc_platform *platform; @@ -416,18 +394,7 @@ static int platform_list_seq_show(struct seq_file *m, void *v) return 0; } - -static int platform_list_seq_open(struct inode *inode, struct file *file) -{ - return single_open(file, platform_list_seq_show, NULL); -} - -static const struct file_operations platform_list_fops = { - .open = platform_list_seq_open, - .read = seq_read, - .llseek = seq_lseek, - .release = single_release, -}; +DEFINE_SHOW_ATTRIBUTE(platform_list); static void soc_init_card_debugfs(struct snd_soc_card *card) { -- 2.16.1