lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 28 Dec 2015 22:47:10 +0800
From:	Geliang Tang <geliangtang@....com>
To:	Jaroslav Kysela <perex@...ex.cz>, Takashi Iwai <tiwai@...e.com>,
	Mark Brown <broonie@...nel.org>
Cc:	Geliang Tang <geliangtang@....com>, alsa-devel@...a-project.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH 1/4] ALSA: core: use dev_to_snd_card

Use dev_to_snd_card() instead of open-coding it.

Signed-off-by: Geliang Tang <geliangtang@....com>
---
 sound/core/init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/core/init.c b/sound/core/init.c
index 20f37fb..fcb84e1 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -639,7 +639,7 @@ static ssize_t
 card_id_show_attr(struct device *dev,
 		  struct device_attribute *attr, char *buf)
 {
-	struct snd_card *card = container_of(dev, struct snd_card, card_dev);
+	struct snd_card *card = dev_to_snd_card(dev);
 	return snprintf(buf, PAGE_SIZE, "%s\n", card->id);
 }
 
@@ -647,7 +647,7 @@ static ssize_t
 card_id_store_attr(struct device *dev, struct device_attribute *attr,
 		   const char *buf, size_t count)
 {
-	struct snd_card *card = container_of(dev, struct snd_card, card_dev);
+	struct snd_card *card = dev_to_snd_card(dev);
 	char buf1[sizeof(card->id)];
 	size_t copy = count > sizeof(card->id) - 1 ?
 					sizeof(card->id) - 1 : count;
@@ -679,7 +679,7 @@ static ssize_t
 card_number_show_attr(struct device *dev,
 		     struct device_attribute *attr, char *buf)
 {
-	struct snd_card *card = container_of(dev, struct snd_card, card_dev);
+	struct snd_card *card = dev_to_snd_card(dev);
 	return snprintf(buf, PAGE_SIZE, "%i\n", card->number);
 }
 
-- 
2.5.0


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ