Commit 25b37eca authored by Gustavo Silva's avatar Gustavo Silva Committed by Greg Kroah-Hartman
Browse files

Staging: otus: fix coding style issues in ioctl.c



This is a patch to the ioctl.c file that fixes up the following
issues:

ERROR: that open brace { should be on the previous line				x  3
WARNING: please, no space before tabs								x  1
ERROR: space required before the open parenthesis '('				x  5
WARNING: braces {} are not necessary for single statement blocks	x  2
ERROR: space prohibited after that '!' (ctx:BxW)					x  1
WARNING: suspect code indent for conditional statements				x  2
ERROR: do not use C99 // comments									x  1
WARNING: braces {} are not necessary for any arm of this statement	x  4

Signed-off-by: default avatarGustavo Silva <silvagustavo@users.sourceforge.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 38d9df49
Loading
Loading
Loading
Loading
+23 −30
Original line number Original line Diff line number Diff line
@@ -63,8 +63,7 @@


extern u16_t zfLnxGetVapId(zdev_t *dev);
extern u16_t zfLnxGetVapId(zdev_t *dev);


static const u32_t channel_frequency_11A[] =
static const u32_t channel_frequency_11A[] = {
{
	/* Even element for Channel Number, Odd for Frequency */
	/* Even element for Channel Number, Odd for Frequency */
	36, 5180,
	36, 5180,
	40, 5200,
	40, 5200,
@@ -2309,11 +2308,10 @@ int usbdrv_cenc_ioctl(struct net_device *dev, struct zydas_cenc_param *zdparm)
	/* Get the AP Id */
	/* Get the AP Id */
	apId = zfLnxGetVapId(dev);
	apId = zfLnxGetVapId(dev);


	if (apId == 0xffff) {
	if (apId == 0xffff)
		apId = 0;
		apId = 0;
	} else {
	else
		apId = apId + 1;
		apId = apId + 1;
	}


	switch (zdparm->cmd) {
	switch (zdparm->cmd) {
	case ZM_CMD_CENC_SETCENC:
	case ZM_CMD_CENC_SETCENC:
@@ -2334,15 +2332,15 @@ int usbdrv_cenc_ioctl(struct net_device *dev, struct zydas_cenc_param *zdparm)


		printk(KERN_ERR "Key Index : % d\n", zdparm->u.crypt.keyid);
		printk(KERN_ERR "Key Index : % d\n", zdparm->u.crypt.keyid);
		printk(KERN_ERR "Encryption key = ");
		printk(KERN_ERR "Encryption key = ");
		for (ii = 0; ii < 16; ii++) {
		for (ii = 0; ii < 16; ii++)
			printk(KERN_ERR "0x%02x ", zdparm->u.crypt.key[ii]);
			printk(KERN_ERR "0x%02x ", zdparm->u.crypt.key[ii]);
		}

		printk(KERN_ERR "\n");
		printk(KERN_ERR "\n");


		printk(KERN_ERR "MIC key = ");
		printk(KERN_ERR "MIC key = ");
		for(ii = 16; ii < ZM_CENC_KEY_SIZE; ii++) {
		for (ii = 16; ii < ZM_CENC_KEY_SIZE; ii++)
			printk(KERN_ERR "0x%02x ", zdparm->u.crypt.key[ii]);
			printk(KERN_ERR "0x%02x ", zdparm->u.crypt.key[ii]);
		}

		printk(KERN_ERR "\n");
		printk(KERN_ERR "\n");


		/* Set up key information */
		/* Set up key information */
@@ -2582,8 +2580,7 @@ int usbdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
							ZM_AUTH_MODE_WPA);
							ZM_AUTH_MODE_WPA);
					} else if ((macp->supIe[17] == 0xf) &&
					} else if ((macp->supIe[17] == 0xf) &&
						(macp->supIe[18] == 0xac) &&
						(macp->supIe[18] == 0xac) &&
						(macp->supIe[19] == 0x2))
						(macp->supIe[19] == 0x2)) {
					{
						printk(KERN_ERR
						printk(KERN_ERR
				"wd->sta.authMode = ZM_AUTH_MODE_WPA2PSK\n");
				"wd->sta.authMode = ZM_AUTH_MODE_WPA2PSK\n");
				/* wd->sta.authMode = ZM_AUTH_MODE_WPA2PSK; */
				/* wd->sta.authMode = ZM_AUTH_MODE_WPA2PSK; */
@@ -2592,8 +2589,7 @@ int usbdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
				ZM_AUTH_MODE_WPA2PSK);
				ZM_AUTH_MODE_WPA2PSK);
			} else if ((macp->supIe[17] == 0xf) &&
			} else if ((macp->supIe[17] == 0xf) &&
				(macp->supIe[18] == 0xac) &&
				(macp->supIe[18] == 0xac) &&
				(macp->supIe[19] == 0x1))
				(macp->supIe[19] == 0x1)) {
				{
					printk(KERN_ERR
					printk(KERN_ERR
				"wd->sta.authMode = ZM_AUTH_MODE_WPA2\n");
				"wd->sta.authMode = ZM_AUTH_MODE_WPA2\n");
				/* wd->sta.authMode = ZM_AUTH_MODE_WPA2; */
				/* wd->sta.authMode = ZM_AUTH_MODE_WPA2; */
@@ -2618,7 +2614,7 @@ int usbdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
				zfiWlanSetWepStatus(dev, ZM_ENCRYPTION_AES);
				zfiWlanSetWepStatus(dev, ZM_ENCRYPTION_AES);
				}
				}
			}
			}
			//WPA2 or WPA2PSK
			/*WPA2 or WPA2PSK*/
			if ((macp->supIe[17] == 0xf) ||
			if ((macp->supIe[17] == 0xf) ||
				(macp->supIe[18] == 0xac)) {
				(macp->supIe[18] == 0xac)) {
				if (macp->supIe[13] == 0x2) {
				if (macp->supIe[13] == 0x2) {
@@ -2667,21 +2663,19 @@ int usbdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
		if (op == ZD_PARAM_DROPUNENCRYPTED) {
		if (op == ZD_PARAM_DROPUNENCRYPTED) {
			printk(KERN_ERR "ZD_PARAM_DROPUNENCRYPTED : ");
			printk(KERN_ERR "ZD_PARAM_DROPUNENCRYPTED : ");


			if(arg) {
			if (arg)
				printk(KERN_ERR "enable\n");
				printk(KERN_ERR "enable\n");
			} else {
			else
				printk(KERN_ERR "disable\n");
				printk(KERN_ERR "disable\n");
		}
		}
		}
		if (op == ZD_PARAM_AUTH_ALGS) {
		if (op == ZD_PARAM_AUTH_ALGS) {
			printk(KERN_ERR "ZD_PARAM_AUTH_ALGS : ");
			printk(KERN_ERR "ZD_PARAM_AUTH_ALGS : ");


			if (arg == 0) {
			if (arg == 0)
				printk(KERN_ERR "OPEN_SYSTEM\n");
				printk(KERN_ERR "OPEN_SYSTEM\n");
			} else {
			else
				printk(KERN_ERR "SHARED_KEY\n");
				printk(KERN_ERR "SHARED_KEY\n");
		}
		}
		}
		if (op == ZD_PARAM_WPS_FILTER) {
		if (op == ZD_PARAM_WPS_FILTER) {
			printk(KERN_ERR "ZD_PARAM_WPS_FILTER : ");
			printk(KERN_ERR "ZD_PARAM_WPS_FILTER : ");


@@ -2705,11 +2699,10 @@ int usbdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
		/* Get the AP Id */
		/* Get the AP Id */
		apId = zfLnxGetVapId(dev);
		apId = zfLnxGetVapId(dev);


		if (apId == 0xffff) {
		if (apId == 0xffff)
			apId = 0;
			apId = 0;
		} else {
		else
			apId = apId + 1;
			apId = apId + 1;
		}


		if (copy_from_user(&req_wpaie, ifr->ifr_data,
		if (copy_from_user(&req_wpaie, ifr->ifr_data,
					sizeof(struct ieee80211req_wpaie))) {
					sizeof(struct ieee80211req_wpaie))) {