Skip to contentSkip to conversation

msm: audio: qdsp6v2: simplify linked lists

PATCH In review [email protected] 2 participants 5 messages Feb 15, 2011 – Feb 16, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/4 msm: audio: qdsp6v2: simplify linked lists

From: Eero Nurkkala <[email protected]>

There's no point in introducing linked lists as they're already provided by the kernel. Remove the proprietary linked lists which may actually introduce risks.

---
branch: android-msm-2.6.35

 .../mach-msm/include/mach/qdsp6v2/audio_dev_ctl.h  |    5 +-
 arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c          |  110 +++++---------------
 2 files changed, 27 insertions(+), 88 deletions(-)
arch/arm/mach-msm/include/mach/qdsp6v2/audio_dev_ctl.h +2 -3
index a72d21a..53a641b 100644
@@ -193,12 +193,11 @@ struct msm_snd_evt_listner {
 	void (*auddev_evt_listener)(u32 evt_id,
 		union auddev_evt_data *evt_payload,
 		void *private_data);
-	struct msm_snd_evt_listner *cb_next;
-	struct msm_snd_evt_listner *cb_prev;
+	struct list_head list;
 };
 
 struct event_listner {
-	struct msm_snd_evt_listner *cb;
+	struct list_head list;
 	u32 num_listner;
 	int state; /* Call state */ /* TODO remove this if not req*/
 };
arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c +25 -85

189 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/4 msm: audio: qdsp6v2: remove unused mixer_post_event()

From: Eero Nurkkala <[email protected]>

Remove unused mixer_post_event() which is not referenced anywhere.

---
branch: android-msm-2.6.35

 .../mach-msm/include/mach/qdsp6v2/audio_dev_ctl.h  |    1 -
 arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c          |   43 --------------------
 2 files changed, 0 insertions(+), 44 deletions(-)
arch/arm/mach-msm/include/mach/qdsp6v2/audio_dev_ctl.h +0 -1
index 53a641b..39039a1 100644
@@ -209,7 +209,6 @@ int auddev_register_evt_listner(u32 evt_id, u32 clnt_type, u32 clnt_id,
 			void *private_data),
 		void *private_data);
 int auddev_unregister_evt_listner(u32 clnt_type, u32 clnt_id);
-void mixer_post_event(u32 evt_id, u32 dev_id);
 void broadcast_event(u32 evt_id, u32 dev_id, u64 session_id);
 int auddev_cfg_tx_copp_topology(int session_id, int cfg);
 int msm_snddev_request_freq(int *freq, u32 session_id,
arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c +0 -43

49 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#2 lore raw

PATCH 3/4 msm: audio: qdsp6v2: fix potential memory corruption

In reply to [email protected]

From: Eero Nurkkala <[email protected]>

kzalloc() may fail, which can result in memory corruption later in the code.

---
branch: android-msm-2.6.35

 arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c +5 -0
index 2d848d5..b414f3e 100644
@@ -1028,6 +1028,11 @@ void broadcast_event(u32 evt_id, u32 dev_id, u64 session_id)
 
 	evt_payload = kzalloc(sizeof(union auddev_evt_data),
 			GFP_KERNEL);
+	if (!evt_payload) {
+		pr_err("%s:Out of memory\n", __func__);
+		mutex_unlock(&session_lock);
+		return;
+	}
 
 	list_for_each_entry(callback, &event.list, list) {
 		if (!(evt_id & callback->evt_id))
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH 4/4 msm: audio: qdsp6v2: simplify broadcast_event()

In reply to [email protected]

From: Eero Nurkkala <[email protected]>

Instead of having a large broadcast_event() - function, split it with a sub function msm_fill_evt_payload() that fills the structures. This makes the broadcast_event() more readable.

---
branch: android-msm-2.6.35

 .../mach-msm/include/mach/qdsp6v2/audio_dev_ctl.h  |    2 +
 arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c          |  149 +++++++++++---------
 2 files changed, 82 insertions(+), 69 deletions(-)
arch/arm/mach-msm/include/mach/qdsp6v2/audio_dev_ctl.h +2 -0
index 39039a1..4ef22d6 100644
@@ -179,6 +179,8 @@ struct message_header {
 #define AUDDEV_EVT_VOICE_STATE_CHG 0x200 /* Change in voice state */
 
 #define AUDDEV_CLNT_VOC 0x1 /*Vocoder clients*/
+#define AUDDEV_CLNT_VOC_S1 0x11 /* subtypes for msm_fill_evt_payload() */
+#define AUDDEV_CLNT_VOC_S2 0x12
 #define AUDDEV_CLNT_DEC 0x2 /*Decoder clients*/
 #define AUDDEV_CLNT_ENC 0x3 /* Encoder clients */
 #define AUDDEV_CLNT_AUDIOCAL 0x4 /* AudioCalibration client */
arch/arm/mach-msm/qdsp6v2/audio_dev_ctl.c +80 -69

198 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#4 lore raw

Re: [PATCH/RFC 4/4] msm: audio: qdsp6v2: simplify broadcast_event()

Quoted 7 lines · On 2/15/2011 4:08 AM, [email protected] wrote:

From: Eero Nurkkala<[email protected]>

Instead of having a large broadcast_event() - function, split it with a sub function msm_fill_evt_payload() that fills the structures. This makes the broadcast_event() more readable.

Thanks for the patches. We will pull in all four patches and test them out.

Patrick