[PATCH 19/20] staging: octeon-usb: cvmx_usb_control_header_t -> union cvmx_usb_control_header

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Replace cvmx_usb_control_header_t with union cvmx_usb_control_header.

Signed-off-by: Aaro Koskinen <aaro.koskinen@xxxxxx>
---
 drivers/staging/octeon-usb/cvmx-usb.c | 12 ++++++++----
 drivers/staging/octeon-usb/cvmx-usb.h | 31 ++++++++++++++++++-------------
 2 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/drivers/staging/octeon-usb/cvmx-usb.c b/drivers/staging/octeon-usb/cvmx-usb.c
index 3cc315d..8a9d94b 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.c
+++ b/drivers/staging/octeon-usb/cvmx-usb.c
@@ -1448,7 +1448,8 @@ static void __cvmx_usb_start_channel_control(struct cvmx_usb_internal_state *usb
 					     struct cvmx_usb_pipe *pipe)
 {
 	struct cvmx_usb_transaction *transaction = pipe->head;
-	cvmx_usb_control_header_t *header = cvmx_phys_to_ptr(transaction->control_header);
+	union cvmx_usb_control_header *header =
+		cvmx_phys_to_ptr(transaction->control_header);
 	int bytes_to_transfer = transaction->buffer_length - transaction->actual_bytes;
 	int packets_to_transfer;
 	cvmx_usbcx_hctsizx_t usbc_hctsiz;
@@ -2319,7 +2320,8 @@ int cvmx_usb_submit_control(struct cvmx_usb_state *state, int pipe_handle,
 {
 	int submit_handle;
 	struct cvmx_usb_internal_state *usb = (struct cvmx_usb_internal_state *)state;
-	cvmx_usb_control_header_t *header = cvmx_phys_to_ptr(control_header);
+	union cvmx_usb_control_header *header =
+		cvmx_phys_to_ptr(control_header);
 
 	/* Pipe handle checking is done later in a common place */
 	if (unlikely(!control_header))
@@ -2884,7 +2886,8 @@ static int __cvmx_usb_poll_channel(struct cvmx_usb_internal_state *usb, int chan
 				if (__cvmx_usb_pipe_needs_split(usb, pipe))
 					transaction->stage = CVMX_USB_STAGE_SETUP_SPLIT_COMPLETE;
 				else {
-					cvmx_usb_control_header_t *header = cvmx_phys_to_ptr(transaction->control_header);
+					union cvmx_usb_control_header *header =
+						cvmx_phys_to_ptr(transaction->control_header);
 					if (header->s.length)
 						transaction->stage = CVMX_USB_STAGE_DATA;
 					else
@@ -2893,7 +2896,8 @@ static int __cvmx_usb_poll_channel(struct cvmx_usb_internal_state *usb, int chan
 				break;
 			case CVMX_USB_STAGE_SETUP_SPLIT_COMPLETE:
 				{
-					cvmx_usb_control_header_t *header = cvmx_phys_to_ptr(transaction->control_header);
+					union cvmx_usb_control_header *header =
+						cvmx_phys_to_ptr(transaction->control_header);
 					if (header->s.length)
 						transaction->stage = CVMX_USB_STAGE_DATA;
 					else
diff --git a/drivers/staging/octeon-usb/cvmx-usb.h b/drivers/staging/octeon-usb/cvmx-usb.h
index bd6a2fb..8bf3696 100644
--- a/drivers/staging/octeon-usb/cvmx-usb.h
+++ b/drivers/staging/octeon-usb/cvmx-usb.h
@@ -335,20 +335,25 @@ struct cvmx_usb_port_status {
 };
 
 /**
- * This is the structure of a Control packet header
+ * union cvmx_usb_control_header - the structure of a Control packet header
+ *
+ * @s.request_type:	Bit 7 tells the direction: 1=IN, 0=OUT
+ * @s.request		The standard usb request to make
+ * @s.value		Value parameter for the request in little endian format
+ * @s.index		Index for the request in little endian format
+ * @s.length		Length of the data associated with this request in
+ *			little endian format
  */
-typedef union
-{
-    uint64_t u64;
-    struct
-    {
-        uint64_t request_type   : 8;  /**< Bit 7 tells the direction: 1=IN, 0=OUT */
-        uint64_t request        : 8;  /**< The standard usb request to make */
-        uint64_t value          : 16; /**< Value parameter for the request in little endian format */
-        uint64_t index          : 16; /**< Index for the request in little endian format */
-        uint64_t length         : 16; /**< Length of the data associated with this request in little endian format */
-    } s;
-} cvmx_usb_control_header_t;
+union cvmx_usb_control_header {
+	uint64_t u64;
+	struct {
+		uint64_t request_type   : 8;
+		uint64_t request        : 8;
+		uint64_t value          : 16;
+		uint64_t index          : 16;
+		uint64_t length         : 16;
+	} s;
+};
 
 /**
  * struct cvmx_usb_iso_packet - descriptor for Isochronous packets
-- 
1.8.3.2

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux