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-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 22 Nov 2012 20:49:20 +0100
From:	Stefan Hajnoczi <stefanha@...il.com>
To:	devel@...verdev.osuosl.org
Cc:	Markus Grabner <grabner@....tugraz.at>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	line6linux-devel@...ts.sourceforge.net,
	<linux-kernel@...r.kernel.org>, laurent_navet@...oo.com,
	Stefan Hajnoczi <stefanha@...il.com>
Subject: [PATCH 41/46] staging: line6: drop pod prog_data buffers

The driver no longer keeps state of MIDI-accessible device parameters.
Drop the buffers but be careful to keep the device startup procedure
working even though we no longer store the contents of the dump request.
The startup procedure will be simplified in a later patch.

Signed-off-by: Stefan Hajnoczi <stefanha@...il.com>
---
 drivers/staging/line6/pod.c | 46 +++------------------------------------------
 drivers/staging/line6/pod.h | 25 ------------------------
 2 files changed, 3 insertions(+), 68 deletions(-)

diff --git a/drivers/staging/line6/pod.c b/drivers/staging/line6/pod.c
index 278976d..e892b4a 100644
--- a/drivers/staging/line6/pod.c
+++ b/drivers/staging/line6/pod.c
@@ -132,14 +132,6 @@ static char *pod_alloc_sysex_buffer(struct usb_line6_pod *pod, int code,
 }
 
 /*
-	Store parameter value in driver memory.
-*/
-static void pod_store_parameter(struct usb_line6_pod *pod, int param, int value)
-{
-	pod->prog_data.control[param] = value;
-}
-
-/*
 	Handle SAVE button.
 */
 static void pod_save_button_pressed(struct usb_line6_pod *pod, int type,
@@ -169,9 +161,6 @@ void line6_pod_process_message(struct usb_line6_pod *pod)
 	/* process all remaining messages */
 	switch (buf[0]) {
 	case LINE6_PARAM_CHANGE | LINE6_CHANNEL_DEVICE:
-		pod_store_parameter(pod, buf[1], buf[2]);
-		/* intentionally no break here! */
-
 	case LINE6_PARAM_CHANGE | LINE6_CHANNEL_HOST:
 		break;
 
@@ -187,36 +176,8 @@ void line6_pod_process_message(struct usb_line6_pod *pod)
 		if (memcmp(buf + 1, line6_midi_id, sizeof(line6_midi_id)) == 0) {
 			switch (buf[5]) {
 			case POD_SYSEX_DUMP:
-				if (pod->line6.message_length ==
-				    sizeof(pod->prog_data) + 7) {
-					switch (pod->dumpreq.in_progress) {
-					case LINE6_DUMP_CURRENT:
-						memcpy(&pod->prog_data, buf + 7,
-						       sizeof(pod->prog_data));
-						break;
-
-					case POD_DUMP_MEMORY:
-						memcpy(&pod->prog_data_buf,
-						       buf + 7,
-						       sizeof
-						       (pod->prog_data_buf));
-						break;
-
-					default:
-						dev_dbg(pod->line6.ifcdev,
-							"unknown dump code %02X\n",
-							pod->dumpreq.in_progress);
-					}
-
-					line6_dump_finished(&pod->dumpreq);
-					pod_startup3(pod);
-				} else
-					dev_dbg(pod->line6.ifcdev,
-						"wrong size of channel dump message (%d instead of %d)\n",
-						pod->line6.message_length,
-						(int)sizeof(pod->prog_data) +
-						7);
-
+				line6_dump_finished(&pod->dumpreq);
+				pod_startup3(pod);
 				break;
 
 			case POD_SYSEX_SYSTEM:{
@@ -279,8 +240,7 @@ void line6_pod_process_message(struct usb_line6_pod *pod)
 void line6_pod_transmit_parameter(struct usb_line6_pod *pod, int param,
 				  u8 value)
 {
-	if (line6_transmit_parameter(&pod->line6, param, value) == 0)
-		pod_store_parameter(pod, param, value);
+	line6_transmit_parameter(&pod->line6, param, value);
 }
 
 /*
diff --git a/drivers/staging/line6/pod.h b/drivers/staging/line6/pod.h
index 8543bae..52534ca 100644
--- a/drivers/staging/line6/pod.h
+++ b/drivers/staging/line6/pod.h
@@ -52,21 +52,6 @@ enum {
 	POD_STARTUP_LAST = POD_STARTUP_SETUP - 1
 };
 
-/**
-	Binary PODxt Pro program dump
-*/
-struct pod_program {
-	/**
-		Header information (including program name).
-	*/
-	unsigned char header[0x20];
-
-	/**
-		Program parameters.
-	*/
-	unsigned char control[POD_CONTROL_SIZE];
-};
-
 struct usb_line6_pod {
 	/**
 		Generic Line6 USB data.
@@ -79,16 +64,6 @@ struct usb_line6_pod {
 	struct line6_dump_request dumpreq;
 
 	/**
-		Current program settings.
-	*/
-	struct pod_program prog_data;
-
-	/**
-		Buffer for data retrieved from or to be stored on PODxt Pro.
-	*/
-	struct pod_program prog_data_buf;
-
-	/**
 		Instrument monitor level.
 	*/
 	int monitor_level;
-- 
1.8.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