Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a1df4e45 authored by Mihai Donțu's avatar Mihai Donțu Committed by Greg Kroah-Hartman
Browse files

USB: gadget: rndis: fix up coding style issues in the file



Corrected the coding style.

Signed-off-by: default avatarMihai Dontu <mihai.dontu@gmail.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 65fd4272
Loading
Loading
Loading
Loading
+244 −248
Original line number Original line Diff line number Diff line
@@ -161,9 +161,8 @@ static const u32 oid_supported_list [] =




/* NDIS Functions */
/* NDIS Functions */
static int
static int gen_ndis_query_resp(int configNr, u32 OID, u8 *buf,
gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
			       unsigned buf_len, rndis_resp_t *r)
		rndis_resp_t *r)
{
{
	int retval = -ENOTSUPP;
	int retval = -ENOTSUPP;
	u32 length = 4;	/* usually */
	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:
	case OID_GEN_VENDOR_DESCRIPTION:
		pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__);
		pr_debug("%s: OID_GEN_VENDOR_DESCRIPTION\n", __func__);
		if (rndis_per_dev_params[configNr].vendorDescr) {
		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,
			memcpy(outbuf,
				rndis_per_dev_params [configNr].vendorDescr, length);
				rndis_per_dev_params[configNr].vendorDescr,
				length);
		} else {
		} else {
			outbuf[0] = 0;
			outbuf[0] = 0;
		}
		}
@@ -485,7 +486,7 @@ gen_ndis_query_resp (int configNr, u32 OID, u8 *buf, unsigned buf_len,
		length = 0;
		length = 0;


	resp->InformationBufferLength = cpu_to_le32(length);
	resp->InformationBufferLength = cpu_to_le32(length);
	r->length = length + sizeof *resp;
	r->length = length + sizeof(*resp);
	resp->MessageLength = cpu_to_le32(r->length);
	resp->MessageLength = cpu_to_le32(r->length);
	return retval;
	return retval;
}
}
@@ -577,8 +578,7 @@ static int rndis_init_response (int configNr, rndis_init_msg_type *buf)
		return -ENOMEM;
		return -ENOMEM;
	resp = (rndis_init_cmplt_type *)r->buf;
	resp = (rndis_init_cmplt_type *)r->buf;


	resp->MessageType = cpu_to_le32 (
	resp->MessageType = cpu_to_le32(REMOTE_NDIS_INITIALIZE_CMPLT);
			REMOTE_NDIS_INITIALIZE_CMPLT);
	resp->MessageLength = cpu_to_le32(52);
	resp->MessageLength = cpu_to_le32(52);
	resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
	resp->RequestID = buf->RequestID; /* Still LE in msg buffer */
	resp->Status = cpu_to_le32(RNDIS_STATUS_SUCCESS);
	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),
			le32_to_cpu(buf->InformationBufferLength),
			r)) {
			r)) {
		/* OID not supported */
		/* OID not supported */
		resp->Status = cpu_to_le32 (
		resp->Status = cpu_to_le32(RNDIS_STATUS_NOT_SUPPORTED);
				RNDIS_STATUS_NOT_SUPPORTED);
		resp->MessageLength = cpu_to_le32(sizeof *resp);
		resp->MessageLength = cpu_to_le32(sizeof *resp);
		resp->InformationBufferLength = cpu_to_le32(0);
		resp->InformationBufferLength = cpu_to_le32(0);
		resp->InformationBufferOffset = 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;
		return -ENOMEM;
	resp = (rndis_indicate_status_msg_type *)r->buf;
	resp = (rndis_indicate_status_msg_type *)r->buf;


	resp->MessageType = cpu_to_le32 (
	resp->MessageType = cpu_to_le32(REMOTE_NDIS_INDICATE_STATUS_MSG);
			REMOTE_NDIS_INDICATE_STATUS_MSG);
	resp->MessageLength = cpu_to_le32(20);
	resp->MessageLength = cpu_to_le32(20);
	resp->Status = cpu_to_le32(status);
	resp->Status = cpu_to_le32(status);
	resp->StatusBufferLength = cpu_to_le32(0);
	resp->StatusBufferLength = cpu_to_le32(0);
@@ -966,12 +964,12 @@ void rndis_add_hdr (struct sk_buff *skb)


	if (!skb)
	if (!skb)
		return;
		return;
	header = (void *) skb_push (skb, sizeof *header);
	header = (void *)skb_push(skb, sizeof(*header));
	memset(header, 0, sizeof *header);
	memset(header, 0, sizeof *header);
	header->MessageType = cpu_to_le32(REMOTE_NDIS_PACKET_MSG);
	header->MessageType = cpu_to_le32(REMOTE_NDIS_PACKET_MSG);
	header->MessageLength = cpu_to_le32(skb->len);
	header->MessageLength = cpu_to_le32(skb->len);
	header->DataOffset = cpu_to_le32(36);
	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)
void rndis_free_response(int configNr, u8 *buf)
@@ -1161,11 +1159,10 @@ int rndis_init(void)
		char name [20];
		char name [20];


		sprintf(name, NAME_TEMPLATE, i);
		sprintf(name, NAME_TEMPLATE, i);
		if (!(rndis_connect_state [i]
		rndis_connect_state[i] = proc_create_data(name, 0660, NULL,
				= proc_create_data(name, 0660, NULL,
					&rndis_proc_fops,
					&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__);
			pr_debug("%s: remove entries", __func__);
			while (i) {
			while (i) {
				sprintf(name, NAME_TEMPLATE, --i);
				sprintf(name, NAME_TEMPLATE, --i);
@@ -1198,4 +1195,3 @@ void rndis_exit (void)
	}
	}
#endif
#endif
}
}