mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Gordon Mitchell <gordon@dumgoyne.me.uk>
To: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Gordon Mitchell <gordon@dumgoyne.me.uk>,
	devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: [PATCH] Staging: rtl8187se: Fixed coding style issues
Date: Sat, 13 Feb 2010 22:57:43 +0000	[thread overview]
Message-ID: <4B772E67.1030805@dumgoyne.me.uk> (raw)


commit eaf625ed89a5bbf40ef1e2740f2de6b6ac322c01
Author: Gordon Mitchell <gordon@dumgoyne.me.uk>
Date:   Sat Feb 13 21:09:24 2010 +0000

    Staging: rtl8187se: Apply kernel coding styles to r8180_93cx6.c
    This patch to r8180_93cx6.c corrects errors and warnings found
    by checkpatch.pl
    Signed-off-by: Gordon Mitchell <gordon@dumgoyne.me.uk>

diff --git a/drivers/staging/rtl8187se/r8180_93cx6.c b/drivers/staging/rtl8187se/r8180_93cx6.c
index 7e4711f..2a29cff 100644
--- a/drivers/staging/rtl8187se/r8180_93cx6.c
+++ b/drivers/staging/rtl8187se/r8180_93cx6.c
@@ -22,13 +22,13 @@
 
 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
+                       (1<<EPROM_CS_SHIFT) | \
+                       read_nic_byte(dev, EPROM_CMD)); /* enable EPROM */
        else
                write_nic_byte(dev, EPROM_CMD, read_nic_byte(dev, EPROM_CMD)\
-                              &~(1<<EPROM_CS_SHIFT)); //disable EPROM
+                       &~(1<<EPROM_CS_SHIFT)); /* disable EPROM */
 
        force_pci_posting(dev);
        udelay(EPROM_DELAY);
@@ -38,24 +38,24 @@ void eprom_cs(struct net_device *dev, short bit)
 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);
 }
 
 
-void eprom_w(struct net_device *dev,short bit)
+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)\
-                              &~(1<<EPROM_W_SHIFT));
+               write_nic_byte(dev, EPROM_CMD, read_nic_byte(dev, EPROM_CMD)\
+                       &~(1<<EPROM_W_SHIFT));
 
        force_pci_posting(dev);
        udelay(EPROM_DELAY);
@@ -66,10 +66,11 @@ 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 @@ 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,50 +89,50 @@ void eprom_send_bits_string(struct net_device *dev, short b[], int len)
 u32 eprom_read(struct net_device *dev, u32 addr)
 {
        struct r8180_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;
-        //enable EPROM programming
+       ret = 0;
+       /* enable EPROM programming */
        write_nic_byte(dev, EPROM_CMD,
-                      (EPROM_CMD_PROGRAM<<EPROM_CMD_OPERATING_MODE_SHIFT));
+               (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);
        eprom_send_bits_string(dev, read_cmd, 3);
        eprom_send_bits_string(dev, addr_str, addr_len);
 
-       //keep chip pin D to low state while reading.
-       //I'm unsure if it is necessary, but anyway shouldn't hurt
+       /* keep chip pin D to low state while reading.
+       I'm unsure if it is necessary, but anyway shouldn't hurt */
        eprom_w(dev, 0);
 
-       for(i=0;i<16;i++){
-               //eeprom needs a clk cycle between writing opcode&adr
-               //and reading data. (eeprom outs a dummy 0)
+       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);
                ret |= (eprom_r(dev)<<(15-i));
        }
@@ -139,8 +140,8 @@ u32 eprom_read(struct net_device *dev, u32 addr)
        eprom_cs(dev, 0);
        eprom_ck_cycle(dev);
 
-       //disable EPROM programming
+       /* disable EPROM programming */
        write_nic_byte(dev, EPROM_CMD,
-                      (EPROM_CMD_NORMAL<<EPROM_CMD_OPERATING_MODE_SHIFT));
+               (EPROM_CMD_NORMAL<<EPROM_CMD_OPERATING_MODE_SHIFT));
        return ret;
 }

             reply	other threads:[~2010-02-13 22:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-13 22:57 Gordon Mitchell [this message]
2010-02-24  0:35 ` Greg KH
2012-11-03 23:40 Mladen Mijatov
2013-04-29  1:31 [PATCH] Staging: rtl8187se: fixed " Matt Kilgore
2013-05-12 15:33 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B772E67.1030805@dumgoyne.me.uk \
    --to=gordon@dumgoyne.me.uk \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®