Remove checkpatch.pl warning
WARNING: braces {} are not necessary for any arm of this statement
+ if (tempword & 0x1f) {
[...]
+ } else {
[...]
Signed-off-by: Pushpendra Singh <[email protected]>
---
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index e7072bc..374db6d 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -1947,11 +1947,10 @@ static irqreturn_t ft1000_interrupt(int irq, void *dev_id)
ft1000_read_reg(dev,
FT1000_REG_MAG_DFSR);
}
- if (tempword & 0x1f) {
+ if (tempword & 0x1f)
ft1000_copy_up_pkt(dev);
- } else {
+ else
break;
- }
cnt++;
} while (cnt < MAX_RCV_LOOP);
--
1.9.1
Removed Checkpatch.pl warning
WARNING: Missing a blank line after declarations
+ struct ft1000_info *ft_info;
+ ft_info = netdev_priv(dev);
Signed-off-by: Pushpendra Singh <[email protected]>
---
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index 374db6d..9d0fd6c 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -2006,8 +2006,8 @@ static void ft1000_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct ft1000_info *ft_info;
- ft_info = netdev_priv(dev);
+ ft_info = netdev_priv(dev);
strlcpy(info->driver, "ft1000", sizeof(info->driver));
snprintf(info->bus_info, sizeof(info->bus_info), "PCMCIA 0x%lx",
dev->base_addr);
--
1.9.1
Remove checkpatch.pl warning
WARNING: Unnecessary parentheses
+ if ((tempword != *ppseudohdr)) {
Signed-off-by: Pushpendra Singh <[email protected]>
---
drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
index 9d0fd6c..26659d0 100644
--- a/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-pcmcia/ft1000_hw.c
@@ -911,7 +911,7 @@ static bool ft1000_receive_cmd(struct net_device *dev, u16 *pbuffer,
tempword = *ppseudohdr++;
for (i = 1; i < 7; i++)
tempword ^= *ppseudohdr++;
- if ((tempword != *ppseudohdr)) {
+ if (tempword != *ppseudohdr) {
pr_debug("Pseudo header checksum mismatch\n");
/* Drop this message */
return false;
--
1.9.1
Remove checkpatch.pl warning
WARNING: Unnecessary parentheses - maybe == should be = ?
+ if ((dev->app_info[i].fileobject == NULL))
Signed-off-by: Pushpendra Singh <[email protected]>
---
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
index c8d2782..25166db 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
@@ -317,7 +317,7 @@ static int ft1000_open(struct inode *inode, struct file *file)
/* Search for available application info block */
for (i = 0; i < MAX_NUM_APP; i++) {
- if ((dev->app_info[i].fileobject == NULL)) {
+ if (dev->app_info[i].fileobject == NULL) {
break;
}
}
--
1.9.1
Removed Checkpatch.pl warning
WARNING: braces {} are not necessary for single statement blocks
+ if (dev->app_info[i].fileobject == NULL) {
+ break;
+ }
Signed-off-by: Pushpendra Singh <[email protected]>
---
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
index 25166db..bd0d25c 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
@@ -317,9 +317,8 @@ static int ft1000_open(struct inode *inode, struct file *file)
/* Search for available application info block */
for (i = 0; i < MAX_NUM_APP; i++) {
- if (dev->app_info[i].fileobject == NULL) {
+ if (dev->app_info[i].fileobject == NULL)
break;
- }
}
/* Fail due to lack of application info block */
@@ -575,9 +574,8 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
} else {
/* Check if this message came from a registered application */
for (i = 0; i < MAX_NUM_APP; i++) {
- if (ft1000dev->app_info[i].fileobject == &file->f_owner) {
+ if (ft1000dev->app_info[i].fileobject == &file->f_owner)
break;
- }
}
if (i == MAX_NUM_APP) {
pr_debug("No matching application fileobject\n");
@@ -629,9 +627,8 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
pmsg = (u16 *)&dpram_data->pseudohdr;
ppseudo_hdr = (struct pseudo_hdr *)pmsg;
total_len = msgsz+2;
- if (total_len & 0x1) {
+ if (total_len & 0x1)
total_len++;
- }
/* Insert slow queue sequence number */
ppseudo_hdr->seq_num = info->squeseqnum++;
--
1.9.1
their is no statements for if condition, but else have so instead
of using else condition ,use a single condition statement if(!qtype)
Signed-off-by: Puhspendra Singh <[email protected]>
---
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
index bd0d25c..a6dfe65 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
@@ -588,8 +588,7 @@ static long ft1000_ioctl(struct file *file, unsigned int command,
/* Check message qtype type which is the lower byte within qos_class */
qtype = ntohs(dpram_data->pseudohdr.qos_class) & 0xff;
/* pr_debug("qtype = %d\n", qtype); */
- if (qtype) {
- } else {
+ if (!qtype) {
/* Put message into Slow Queue */
/* Only put a message into the DPRAM if msg doorbell is available */
status = ft1000_read_register(ft1000dev, &tempword, FT1000_REG_DOORBELL);
--
1.9.1
Remove checkpatch.pl warning
WARNING: Possible unnecessary 'out of memory' message
+ if (skb == NULL) {
+ pr_debug("No Network buffers available\n");
Signed-off-by: Pushpendra Singh <[email protected]>
---
drivers/staging/ft1000/ft1000-usb/ft1000_hw.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
index f0ac438..690032b 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
@@ -843,7 +843,6 @@ static int ft1000_copy_up_pkt(struct urb *urb)
skb = dev_alloc_skb(len + 12 + 2);
if (skb == NULL) {
- pr_debug("No Network buffers available\n");
info->stats.rx_errors++;
ft1000_submit_rx_urb(info);
return -1;
--
1.9.1