USB: gadget: rndis: fix up coding style issues in the file
Corrected the coding style. Signed-off-by: Mihai Dontu <mihai.dontu@gmail.com> Cc: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
65fd42724a
commit
a1df4e45c8
@@ -161,9 +161,8 @@ static const u32 oid_supported_list [] =
|
||||
|
||||
|
||||
/* NDIS Functions */
|
||||
static int
|
||||
gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
|
||||
rndis_resp_t *r)
|
||||
static int gen_ndis_query_resp(int configNr, u32 OID, u8 *buf,
|
||||
unsigned buf_len, rndis_resp_t *r)
|
||||
{
|
||||
int retval = -ENOTSUPP;
|
||||
u32 length = 4; /* usually */
|
||||
@@ -294,9 +293,11 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
|
||||
case OID_GEN_VENDOR_DESCRIPTION:
|
||||
pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__);
|
||||
if (rndis_per_dev_params[configNr].vendorDescr) {
|
||||
length = strlen (rndis_per_dev_params [configNr].vendorDescr);
|
||||
length = strlen(rndis_per_dev_params[configNr].
|
||||
vendorDescr);
|
||||
memcpy(outbuf,
|
||||
rndis_per_dev_params [configNr].vendorDescr, length);
|
||||
rndis_per_dev_params[configNr].vendorDescr,
|
||||
length);
|
||||
} else {
|
||||
outbuf[0] = 0;
|
||||
}
|
||||
@@ -485,7 +486,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
|
||||
length = 0;
|
||||
|
||||
resp->InformationBufferLength = cpu_to_le32(length);
|
||||
r->length = length + sizeof *resp;
|
||||
r->length = length + sizeof(*resp);
|
||||
resp->MessageLength = cpu_to_le32(r->length);
|
||||
return retval;
|
||||
}
|
||||
@@ -577,8 +578,7 @@ static int rndis_init_response (int configNr, rndis_init_msg_type *buf)
|
||||
return -ENOMEM;
|
||||
resp = (rndis_init_cmplt_type *)r->buf;
|
||||
|
||||
resp->MessageType = cpu_to_le32 (
|
||||
REMOTE_NDIS_INITIALIZE_CMPLT);
|
||||
resp->MessageType = cpu_to_le32(REMOTE_NDIS_INITIALIZE_CMPLT);
|
||||
resp->MessageLength = cpu_to_le32(52);
|
||||
resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
|
||||
resp->Status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
|
||||
@@ -631,8 +631,7 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf)
|
||||
le32_to_cpu(buf->InformationBufferLength),
|
||||
r)) {
|
||||
/* OID not supported */
|
||||
resp->Status = cpu_to_le32 (
|
||||
RNDIS_STATUS_NOT_SUPPORTED);
|
||||
resp->Status = cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED);
|
||||
resp->MessageLength = cpu_to_le32(sizeof *resp);
|
||||
resp->InformationBufferLength = cpu_to_le32(0);
|
||||
resp->InformationBufferOffset = cpu_to_le32(0);
|
||||
@@ -747,8 +746,7 @@ static int rndis_indicate_status_msg (int configNr, u32 status)
|
||||
return -ENOMEM;
|
||||
resp = (rndis_indicate_status_msg_type *)r->buf;
|
||||
|
||||
resp->MessageType = cpu_to_le32 (
|
||||
REMOTE_NDIS_INDICATE_STATUS_MSG);
|
||||
resp->MessageType = cpu_to_le32(REMOTE_NDIS_INDICATE_STATUS_MSG);
|
||||
resp->MessageLength = cpu_to_le32(20);
|
||||
resp->Status = cpu_to_le32(status);
|
||||
resp->StatusBufferLength = cpu_to_le32(0);
|
||||
@@ -966,12 +964,12 @@ void rndis_add_hdr (struct sk_buff *skb)
|
||||
|
||||
if (!skb)
|
||||
return;
|
||||
header = (void *) skb_push (skb, sizeof *header);
|
||||
header = (void *)skb_push(skb, sizeof(*header));
|
||||
memset(header, 0, sizeof *header);
|
||||
header->MessageType = cpu_to_le32(REMOTE_NDIS_PACKET_MSG);
|
||||
header->MessageLength = cpu_to_le32(skb->len);
|
||||
header->DataOffset = cpu_to_le32(36);
|
||||
header->DataLength = cpu_to_le32(skb->len - sizeof *header);
|
||||
header->DataLength = cpu_to_le32(skb->len - sizeof(*header));
|
||||
}
|
||||
|
||||
void rndis_free_response(int configNr, u8 *buf)
|
||||
@@ -1161,11 +1159,10 @@ int rndis_init(void)
|
||||
char name [20];
|
||||
|
||||
sprintf(name, NAME_TEMPLATE, i);
|
||||
if (!(rndis_connect_state [i]
|
||||
= proc_create_data(name, 0660, NULL,
|
||||
rndis_connect_state[i] = proc_create_data(name, 0660, NULL,
|
||||
&rndis_proc_fops,
|
||||
(void *)(rndis_per_dev_params + i))))
|
||||
{
|
||||
(void *)(rndis_per_dev_params + i));
|
||||
if (!rndis_connect_state[i]) {
|
||||
pr_debug("%s: remove entries", __func__);
|
||||
while (i) {
|
||||
sprintf(name, NAME_TEMPLATE, --i);
|
||||
@@ -1198,4 +1195,3 @@ void rndis_exit (void)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user