Skip to content

Commit

Permalink
staging: octeon-usb: delete redundant field from octeon_temp_buffer
Browse files Browse the repository at this point in the history
Since we are not moving/realigning the original pointer returned
by kmalloc, we don't need to store the value in a separate field.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Aaro Koskinen authored and Greg Kroah-Hartman committed Mar 24, 2015
1 parent 3f9697b commit 31170da
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/staging/octeon-usb/octeon-hcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ struct octeon_hcd {

/**
* struct octeon_temp_buffer - a bounce buffer for USB transfers
* @temp_buffer: the newly allocated temporary buffer (including meta-data)
* @orig_buffer: the original buffer passed by the USB stack
* @data: the newly allocated temporary buffer (excluding meta-data)
*
Expand All @@ -441,7 +440,6 @@ struct octeon_hcd {
* represents it.
*/
struct octeon_temp_buffer {
void *temp_buffer;
void *orig_buffer;
u8 data[0];
};
Expand Down Expand Up @@ -479,7 +477,6 @@ static int octeon_alloc_temp_buffer(struct urb *urb, gfp_t mem_flags)
if (!temp)
return -ENOMEM;

temp->temp_buffer = temp;
temp->orig_buffer = urb->transfer_buffer;
if (usb_urb_dir_out(urb))
memcpy(temp->data, urb->transfer_buffer,
Expand Down Expand Up @@ -510,7 +507,7 @@ static void octeon_free_temp_buffer(struct urb *urb)
urb->actual_length);
urb->transfer_buffer = temp->orig_buffer;
urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER;
kfree(temp->temp_buffer);
kfree(temp);
}

/**
Expand Down

0 comments on commit 31170da

Please sign in to comment.