Skip to contentSkip to conversation

ALSA: hda - Remove unused snd_hda_get_nid_path()

PATCH New Takashi Iwai 1 participant 2 messages Dec 8, 2015 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ALSA: hda - Remove unused snd_hda_get_nid_path()

An exported helper function snd_hda_get_nid_path() is nowhere used. Let's remove it.

---
 sound/pci/hda/hda_generic.c | 16 ----------------
 sound/pci/hda/hda_generic.h |  2 --
 2 files changed, 18 deletions(-)
sound/pci/hda/hda_generic.c +0 -16
index c6e8a651cea1..a644fc3302f0 100644
@@ -279,22 +279,6 @@ static struct nid_path *get_nid_path(struct hda_codec *codec,
 }
 
 /**
- * snd_hda_get_nid_path - get the path between the given NIDs
- * @codec: the HDA codec
- * @from_nid: the NID where the path start from
- * @to_nid: the NID where the path ends at
- *
- * Return the found nid_path object or NULL for error.
- * Passing 0 to either @from_nid or @to_nid behaves as a wildcard.
- */
-struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec,
-				      hda_nid_t from_nid, hda_nid_t to_nid)
-{
-	return get_nid_path(codec, from_nid, to_nid, 0);
-}
-EXPORT_SYMBOL_GPL(snd_hda_get_nid_path);
-
-/**
  * snd_hda_get_path_idx - get the index number corresponding to the path
  * instance
  * @codec: the HDA codec
sound/pci/hda/hda_generic.h +0 -2
index 56e4139b9032..692510e59365 100644
@@ -306,8 +306,6 @@ int snd_hda_gen_spec_init(struct hda_gen_spec *spec);
 int snd_hda_gen_init(struct hda_codec *codec);
 void snd_hda_gen_free(struct hda_codec *codec);
 
-struct nid_path *snd_hda_get_nid_path(struct hda_codec *codec,
-				      hda_nid_t from_nid, hda_nid_t to_nid);
 int snd_hda_get_path_idx(struct hda_codec *codec, struct nid_path *path);
 struct nid_path *snd_hda_get_path_from_idx(struct hda_codec *codec, int idx);
 bool snd_hda_parse_nid_path(struct hda_codec *codec, hda_nid_t from_nid,
Signature · 1 line
2.6.3
#1 lore raw

PATCH 2/2 ALSA: hda - Make snd_hda_parse_nid_path() local

An exported function snd_hda_parse_nid_path() is used only inside hda_generic.c. Let's make it a static local function for a better code optimization.

---
 sound/pci/hda/hda_generic.c | 5 ++---
 sound/pci/hda/hda_generic.h | 3 ---
 2 files changed, 2 insertions(+), 6 deletions(-)
sound/pci/hda/hda_generic.c +2 -3
index a644fc3302f0..f3c058f6c831 100644
@@ -435,7 +435,7 @@ static bool __parse_nid_path(struct hda_codec *codec,
 	return true;
 }
 
-/**
+/*
  * snd_hda_parse_nid_path - parse the widget path from the given nid to
  * the target nid
  * @codec: the HDA codec
@@ -454,7 +454,7 @@ static bool __parse_nid_path(struct hda_codec *codec,
  * with the negative of given value are excluded, only other paths are chosen.
  * when @anchor_nid is zero, no special handling about path selection.
  */
-bool snd_hda_parse_nid_path(struct hda_codec *codec, hda_nid_t from_nid,
+static bool snd_hda_parse_nid_path(struct hda_codec *codec, hda_nid_t from_nid,
 			    hda_nid_t to_nid, int anchor_nid,
 			    struct nid_path *path)
 {
@@ -465,7 +465,6 @@ bool snd_hda_parse_nid_path(struct hda_codec *codec, hda_nid_t from_nid,
 	}
 	return false;
 }
-EXPORT_SYMBOL_GPL(snd_hda_parse_nid_path);
 
 /**
  * snd_hda_add_new_path - parse the path between the given NIDs and
sound/pci/hda/hda_generic.h +0 -3
index 692510e59365..f66fc7e25e07 100644
@@ -308,9 +308,6 @@ void snd_hda_gen_free(struct hda_codec *codec);
 
 int snd_hda_get_path_idx(struct hda_codec *codec, struct nid_path *path);
 struct nid_path *snd_hda_get_path_from_idx(struct hda_codec *codec, int idx);
-bool snd_hda_parse_nid_path(struct hda_codec *codec, hda_nid_t from_nid,
-			    hda_nid_t to_nid, int anchor_nid,
-			    struct nid_path *path);
 struct nid_path *
 snd_hda_add_new_path(struct hda_codec *codec, hda_nid_t from_nid,
 		     hda_nid_t to_nid, int anchor_nid);
Signature · 1 line
2.6.3