From patchwork Wed Feb 14 15:19:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Brown X-Patchwork-Id: 128360 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp719660ljc; Wed, 14 Feb 2018 07:19:44 -0800 (PST) X-Google-Smtp-Source: AH8x2267l8YW2PXElh9p3YTwo5D5vA7zhLCOHR0IBBQaWBLw3g4OmEO5UJX0UUw8nOhxQpq0Q6kT X-Received: by 10.223.188.144 with SMTP id g16mr5017829wrh.258.1518621583975; Wed, 14 Feb 2018 07:19:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518621583; cv=none; d=google.com; s=arc-20160816; b=ZeH60smWaBGUnt0QRG83XqyfSf4rwurIvLiLnhckQzaR89YtyndZ78QJXJ/w3byZCT MYJC6N7gBJRFJJopXMNsF9MwerX5TQuFIQtPy9Bd+09ZPRtMAQucnp0MoLz2p7n2VI25 Dzp3AAb0DebNhJCzyT0sc4qKtzSeHvq/lDHwXDkog5hbZ2WWt8UjPuYjBoIGUxULMsun m/GzQoWEnFScU2r4c5QWQOWPoeOVsMkQqb1837TJRwHBq68keaOBpk/wtpUyBjKySOWG wOBFxmrC8qkMQrFSQ6HSFQ3NFzx6C1ikUQGNabncEtfZav7oarID/h8Pi0mzzJOww7ht 3J3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:date:message-id:in-reply-to:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=xoiUXfV20zHdsWOLmfJN21tcjR01QTFruSCZjqaBNdk=; b=ujPjELXRl7Yts8x/OptWN7FhAPJkKr0XAQwUphuHjnh+wkp6EeLNYb2SoPmoaWQlTA K++sGVcdssUH7dzJ7LOlAsfdU+ir4IXBcVokK9k5XYb6a0UrMawe26Idbrv9ztWo/f0Y W/KuGZAIJa9RBuZ5rvKHSpkkGa2a32UhVz+pKvGO41UWyrP0ZfeFmAxw7P8lUOhOlslx SSSDkGce7LAU/wdc/HL1p8dVNvqSBHtwXO1GtxNUuK7euCoR0sHOyB+Z5wdYeAWDV5UN BxZ8vUtDoPl0bPUs0BL0vXqv/bxbVTkOt+90atX9iO2UR6BCRW0Zx0VOtEmq4y2CgOMA zBiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Xh0q7mhg; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id e131si6878816wmg.188.2018.02.14.07.19.43; Wed, 14 Feb 2018 07:19:43 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sirena.org.uk header.s=20170815-heliosphere header.b=Xh0q7mhg; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 1C0132677F5; Wed, 14 Feb 2018 16:19:42 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id BF2182677F8; Wed, 14 Feb 2018 16:19:39 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=disabled version=3.4.0 Received: from heliosphere.sirena.org.uk (heliosphere.sirena.org.uk [172.104.155.198]) by alsa0.perex.cz (Postfix) with ESMTP id 253DA2677F2 for ; Wed, 14 Feb 2018 16:19:37 +0100 (CET) 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 In-Reply-To: <1518619687-31442-1-git-send-email-dolinux.peng@gmail.com> Message-Id: Date: Wed, 14 Feb 2018 15:19:26 +0000 Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, tiwai@suse.com, lgirdwood@gmail.com, andy.shevchenko@gmail.com, broonie@kernel.org Subject: [alsa-devel] Applied "ASoC: use DEFINE_SHOW_ATTRIBUTE() to decrease code duplication" to the asoc tree X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.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(-) -- 2.16.1 _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel 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) {