* [PATCH] Staging: rtl8192e: fix spacing style issues in r8180_93cx6.c
@ 2010-02-04 19:57 Tim Schofield
2010-03-23 3:49 ` Vikram Dhillon
0 siblings, 1 reply; 2+ messages in thread
From: Tim Schofield @ 2010-02-04 19:57 UTC (permalink / raw)
To: gregkh; +Cc: devel, linux-kernel
>From ffe4ef649fc0bcd553d8901492a5385a42be585a Mon Sep 17 00:00:00 2001
From: Tim Schofield <tim@weberpafrica.com>
Date: Thu, 4 Feb 2010 18:28:48 +0000
Subject: [PATCH] Staging: rtl8192e: fix spacing style issues in r8180_93cx6.c
This is a patch to the r8180_93cx6.c file that fixes up spacing issue warnings found by the checkpatch.pl tool
Signed-off-by: Tim Schofield <tim@weberpafrica.com>
---
drivers/staging/rtl8192e/r8180_93cx6.c | 63 ++++++++++++++++----------------
1 files changed, 32 insertions(+), 31 deletions(-)
diff --git a/drivers/staging/rtl8192e/r8180_93cx6.c b/drivers/staging/rtl8192e/r8180_93cx6.c
index 79f7a0f..262ed5f 100644
--- a/drivers/staging/rtl8192e/r8180_93cx6.c
+++ b/drivers/staging/rtl8192e/r8180_93cx6.c
@@ -22,7 +22,7 @@
static void eprom_cs(struct net_device *dev, short bit)
{
- if(bit)
+ if (bit)
write_nic_byte(dev, EPROM_CMD,
(1<<EPROM_CS_SHIFT) | \
read_nic_byte(dev, EPROM_CMD)); //enable EPROM
@@ -38,23 +38,23 @@ static void eprom_cs(struct net_device *dev, short bit)
static void eprom_ck_cycle(struct net_device *dev)
{
write_nic_byte(dev, EPROM_CMD,
- (1<<EPROM_CK_SHIFT) | read_nic_byte(dev,EPROM_CMD));
+ (1<<EPROM_CK_SHIFT) | read_nic_byte(dev, EPROM_CMD));
force_pci_posting(dev);
udelay(EPROM_DELAY);
write_nic_byte(dev, EPROM_CMD,
- read_nic_byte(dev, EPROM_CMD) &~ (1<<EPROM_CK_SHIFT));
+ read_nic_byte(dev, EPROM_CMD) & ~(1<<EPROM_CK_SHIFT));
force_pci_posting(dev);
udelay(EPROM_DELAY);
}
-static void eprom_w(struct net_device *dev,short bit)
+static void eprom_w(struct net_device *dev, short bit)
{
- if(bit)
+ if (bit)
write_nic_byte(dev, EPROM_CMD, (1<<EPROM_W_SHIFT) | \
- read_nic_byte(dev,EPROM_CMD));
+ read_nic_byte(dev, EPROM_CMD));
else
- write_nic_byte(dev, EPROM_CMD, read_nic_byte(dev,EPROM_CMD)\
+ write_nic_byte(dev, EPROM_CMD, read_nic_byte(dev, EPROM_CMD)\
&~(1<<EPROM_W_SHIFT));
force_pci_posting(dev);
@@ -66,10 +66,11 @@ static short eprom_r(struct net_device *dev)
{
short bit;
- bit=(read_nic_byte(dev, EPROM_CMD) & (1<<EPROM_R_SHIFT) );
+ bit = (read_nic_byte(dev, EPROM_CMD) & (1<<EPROM_R_SHIFT));
udelay(EPROM_DELAY);
- if(bit) return 1;
+ if (bit)
+ return 1;
return 0;
}
@@ -78,7 +79,7 @@ static void eprom_send_bits_string(struct net_device *dev, short b[], int len)
{
int i;
- for(i=0; i<len; i++){
+ for (i = 0; i < len; i++) {
eprom_w(dev, b[i]);
eprom_ck_cycle(dev);
}
@@ -88,37 +89,37 @@ static void eprom_send_bits_string(struct net_device *dev, short b[], int len)
u32 eprom_read(struct net_device *dev, u32 addr)
{
struct r8192_priv *priv = ieee80211_priv(dev);
- short read_cmd[]={1,1,0};
+ short read_cmd[] = {1, 1, 0};
short addr_str[8];
int i;
int addr_len;
u32 ret;
- ret=0;
+ ret = 0;
//enable EPROM programming
write_nic_byte(dev, EPROM_CMD,
(EPROM_CMD_PROGRAM<<EPROM_CMD_OPERATING_MODE_SHIFT));
force_pci_posting(dev);
udelay(EPROM_DELAY);
- if (priv->epromtype==EPROM_93c56){
- addr_str[7]=addr & 1;
- addr_str[6]=addr & (1<<1);
- addr_str[5]=addr & (1<<2);
- addr_str[4]=addr & (1<<3);
- addr_str[3]=addr & (1<<4);
- addr_str[2]=addr & (1<<5);
- addr_str[1]=addr & (1<<6);
- addr_str[0]=addr & (1<<7);
- addr_len=8;
- }else{
- addr_str[5]=addr & 1;
- addr_str[4]=addr & (1<<1);
- addr_str[3]=addr & (1<<2);
- addr_str[2]=addr & (1<<3);
- addr_str[1]=addr & (1<<4);
- addr_str[0]=addr & (1<<5);
- addr_len=6;
+ if (priv->epromtype == EPROM_93c56) {
+ addr_str[7] = addr & 1;
+ addr_str[6] = addr & (1<<1);
+ addr_str[5] = addr & (1<<2);
+ addr_str[4] = addr & (1<<3);
+ addr_str[3] = addr & (1<<4);
+ addr_str[2] = addr & (1<<5);
+ addr_str[1] = addr & (1<<6);
+ addr_str[0] = addr & (1<<7);
+ addr_len = 8;
+ } else {
+ addr_str[5] = addr & 1;
+ addr_str[4] = addr & (1<<1);
+ addr_str[3] = addr & (1<<2);
+ addr_str[2] = addr & (1<<3);
+ addr_str[1] = addr & (1<<4);
+ addr_str[0] = addr & (1<<5);
+ addr_len = 6;
}
eprom_cs(dev, 1);
eprom_ck_cycle(dev);
@@ -129,7 +130,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
//I'm unsure if it is necessary, but anyway shouldn't hurt
eprom_w(dev, 0);
- for(i=0;i<16;i++){
+ for (i = 0; i < 16; i++) {
//eeprom needs a clk cycle between writing opcode&adr
//and reading data. (eeprom outs a dummy 0)
eprom_ck_cycle(dev);
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] Staging: rtl8192e: fix spacing style issues in r8180_93cx6.c
2010-02-04 19:57 [PATCH] Staging: rtl8192e: fix spacing style issues in r8180_93cx6.c Tim Schofield
@ 2010-03-23 3:49 ` Vikram Dhillon
0 siblings, 0 replies; 2+ messages in thread
From: Vikram Dhillon @ 2010-03-23 3:49 UTC (permalink / raw)
To: Tim Schofield; +Cc: gregkh, devel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 5332 bytes --]
On Thu, Feb 04, 2010 at 07:57:09PM +0000, Tim Schofield wrote:
> >From ffe4ef649fc0bcd553d8901492a5385a42be585a Mon Sep 17 00:00:00 2001
> From: Tim Schofield <tim@weberpafrica.com>
> Date: Thu, 4 Feb 2010 18:28:48 +0000
> Subject: [PATCH] Staging: rtl8192e: fix spacing style issues in r8180_93cx6.c
> This is a patch to the r8180_93cx6.c file that fixes up spacing issue warnings found by the checkpatch.pl tool
> Signed-off-by: Tim Schofield <tim@weberpafrica.com>
>
> ---
> drivers/staging/rtl8192e/r8180_93cx6.c | 63 ++++++++++++++++----------------
> 1 files changed, 32 insertions(+), 31 deletions(-)
>
> diff --git a/drivers/staging/rtl8192e/r8180_93cx6.c b/drivers/staging/rtl8192e/r8180_93cx6.c
> index 79f7a0f..262ed5f 100644
> --- a/drivers/staging/rtl8192e/r8180_93cx6.c
> +++ b/drivers/staging/rtl8192e/r8180_93cx6.c
> @@ -22,7 +22,7 @@
>
> static void eprom_cs(struct net_device *dev, short bit)
> {
> - if(bit)
> + if (bit)
> write_nic_byte(dev, EPROM_CMD,
> (1<<EPROM_CS_SHIFT) | \
> read_nic_byte(dev, EPROM_CMD)); //enable EPROM
> @@ -38,23 +38,23 @@ static void eprom_cs(struct net_device *dev, short bit)
> static void eprom_ck_cycle(struct net_device *dev)
> {
> write_nic_byte(dev, EPROM_CMD,
> - (1<<EPROM_CK_SHIFT) | read_nic_byte(dev,EPROM_CMD));
> + (1<<EPROM_CK_SHIFT) | read_nic_byte(dev, EPROM_CMD));
> force_pci_posting(dev);
> udelay(EPROM_DELAY);
> write_nic_byte(dev, EPROM_CMD,
> - read_nic_byte(dev, EPROM_CMD) &~ (1<<EPROM_CK_SHIFT));
> + read_nic_byte(dev, EPROM_CMD) & ~(1<<EPROM_CK_SHIFT));
> force_pci_posting(dev);
> udelay(EPROM_DELAY);
> }
>
>
> -static void eprom_w(struct net_device *dev,short bit)
> +static void eprom_w(struct net_device *dev, short bit)
> {
> - if(bit)
> + if (bit)
> write_nic_byte(dev, EPROM_CMD, (1<<EPROM_W_SHIFT) | \
> - read_nic_byte(dev,EPROM_CMD));
> + read_nic_byte(dev, EPROM_CMD));
> else
> - write_nic_byte(dev, EPROM_CMD, read_nic_byte(dev,EPROM_CMD)\
> + write_nic_byte(dev, EPROM_CMD, read_nic_byte(dev, EPROM_CMD)\
> &~(1<<EPROM_W_SHIFT));
>
> force_pci_posting(dev);
> @@ -66,10 +66,11 @@ static short eprom_r(struct net_device *dev)
> {
> short bit;
>
> - bit=(read_nic_byte(dev, EPROM_CMD) & (1<<EPROM_R_SHIFT) );
> + bit = (read_nic_byte(dev, EPROM_CMD) & (1<<EPROM_R_SHIFT));
> udelay(EPROM_DELAY);
>
> - if(bit) return 1;
> + if (bit)
> + return 1;
> return 0;
> }
>
> @@ -78,7 +79,7 @@ static void eprom_send_bits_string(struct net_device *dev, short b[], int len)
> {
> int i;
>
> - for(i=0; i<len; i++){
> + for (i = 0; i < len; i++) {
> eprom_w(dev, b[i]);
> eprom_ck_cycle(dev);
> }
> @@ -88,37 +89,37 @@ static void eprom_send_bits_string(struct net_device *dev, short b[], int len)
> u32 eprom_read(struct net_device *dev, u32 addr)
> {
> struct r8192_priv *priv = ieee80211_priv(dev);
> - short read_cmd[]={1,1,0};
> + short read_cmd[] = {1, 1, 0};
> short addr_str[8];
> int i;
> int addr_len;
> u32 ret;
>
> - ret=0;
> + ret = 0;
> //enable EPROM programming
> write_nic_byte(dev, EPROM_CMD,
> (EPROM_CMD_PROGRAM<<EPROM_CMD_OPERATING_MODE_SHIFT));
> force_pci_posting(dev);
> udelay(EPROM_DELAY);
>
> - if (priv->epromtype==EPROM_93c56){
> - addr_str[7]=addr & 1;
> - addr_str[6]=addr & (1<<1);
> - addr_str[5]=addr & (1<<2);
> - addr_str[4]=addr & (1<<3);
> - addr_str[3]=addr & (1<<4);
> - addr_str[2]=addr & (1<<5);
> - addr_str[1]=addr & (1<<6);
> - addr_str[0]=addr & (1<<7);
> - addr_len=8;
> - }else{
> - addr_str[5]=addr & 1;
> - addr_str[4]=addr & (1<<1);
> - addr_str[3]=addr & (1<<2);
> - addr_str[2]=addr & (1<<3);
> - addr_str[1]=addr & (1<<4);
> - addr_str[0]=addr & (1<<5);
> - addr_len=6;
> + if (priv->epromtype == EPROM_93c56) {
> + addr_str[7] = addr & 1;
> + addr_str[6] = addr & (1<<1);
> + addr_str[5] = addr & (1<<2);
> + addr_str[4] = addr & (1<<3);
> + addr_str[3] = addr & (1<<4);
> + addr_str[2] = addr & (1<<5);
> + addr_str[1] = addr & (1<<6);
> + addr_str[0] = addr & (1<<7);
> + addr_len = 8;
> + } else {
> + addr_str[5] = addr & 1;
> + addr_str[4] = addr & (1<<1);
> + addr_str[3] = addr & (1<<2);
> + addr_str[2] = addr & (1<<3);
> + addr_str[1] = addr & (1<<4);
> + addr_str[0] = addr & (1<<5);
> + addr_len = 6;
> }
> eprom_cs(dev, 1);
> eprom_ck_cycle(dev);
> @@ -129,7 +130,7 @@ u32 eprom_read(struct net_device *dev, u32 addr)
> //I'm unsure if it is necessary, but anyway shouldn't hurt
> eprom_w(dev, 0);
>
> - for(i=0;i<16;i++){
> + for (i = 0; i < 16; i++) {
> //eeprom needs a clk cycle between writing opcode&adr
> //and reading data. (eeprom outs a dummy 0)
> eprom_ck_cycle(dev);
> --
> 1.6.3.3
>
Looks good :) nice work
Reviewed-by: Vikram Dhillon <opensolarisdev@gmail.com>
--
Regards,
Vikram Dhillon
There is poetry and there is beauty in real sympathy; but there is more — there is action. The noblest and most powerful form of sympathy is not merely the responsive tear, the echoed sigh, the answering look; it is the embodiment of the sentiment in actual help.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-03-23 3:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-04 19:57 [PATCH] Staging: rtl8192e: fix spacing style issues in r8180_93cx6.c Tim Schofield
2010-03-23 3:49 ` Vikram Dhillon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox