Commit 382d277b authored by Michael Hoefler's avatar Michael Hoefler Committed by Greg Kroah-Hartman

silicom: remaining checkpatch issues in bypass.c

In this patch we fix some "logical" errors in bypass.c of the silicom bypass
driver (in staging).

Checkpatch complains about the following errors:
 - unnecessary forward declarations in a source file
 - assignment in if condition

In addition to that the __init and __exit macros were missing at the init and
cleanup function.

There are still two warnings left for this file related to too many leadingtabs
at nested blocks. I did not touch this issue becasue the code needs really some
refactoring. And since i do not have the appropriate hardware to test the code,
i do not change the functionality in any way.
Signed-off-by: default avatarMichael Hoefler <michael.hoefler@studium.uni-erlangen.de>
Signed-off-by: default avatarChristoph Kohl <christoph.kohl@t-online.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6618b750
...@@ -40,9 +40,6 @@ MODULE_AUTHOR("www.silicom.co.il"); ...@@ -40,9 +40,6 @@ MODULE_AUTHOR("www.silicom.co.il");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
int init_lib_module(void);
void cleanup_lib_module(void);
static int do_cmd(struct net_device *dev, struct ifreq *ifr, int cmd, int *data) static int do_cmd(struct net_device *dev, struct ifreq *ifr, int cmd, int *data)
{ {
int ret = -1; int ret = -1;
...@@ -151,9 +148,10 @@ static int is_bypass_dev(int if_index) ...@@ -151,9 +148,10 @@ static int is_bypass_dev(int if_index)
int data = 0; int data = 0;
while ((pdev = pci_get_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) { while ((pdev = pci_get_class(PCI_CLASS_NETWORK_ETHERNET << 8, pdev))) {
if ((dev = pci_get_drvdata(pdev)) != NULL) dev = pci_get_drvdata(pdev);
if (((dev = pci_get_drvdata(pdev)) != NULL) && if (dev != NULL) {
(dev->ifindex == if_index)) { dev = pci_get_drvdata(pdev);
if ((dev != NULL) && (dev->ifindex == if_index)) {
if ((pdev->vendor == SILICOM_VID) && if ((pdev->vendor == SILICOM_VID) &&
(pdev->device >= SILICOM_BP_PID_MIN) && (pdev->device >= SILICOM_BP_PID_MIN) &&
(pdev->device <= SILICOM_BP_PID_MAX)) { (pdev->device <= SILICOM_BP_PID_MAX)) {
...@@ -183,6 +181,7 @@ static int is_bypass_dev(int if_index) ...@@ -183,6 +181,7 @@ static int is_bypass_dev(int if_index)
#endif #endif
return -1; return -1;
} }
}
} }
send_cmd: send_cmd:
ret = do_cmd(dev, &ifr, IS_BYPASS, &data); ret = do_cmd(dev, &ifr, IS_BYPASS, &data);
...@@ -526,13 +525,13 @@ static int get_bypass_info(int if_index, struct bp_info *bp_info) ...@@ -526,13 +525,13 @@ static int get_bypass_info(int if_index, struct bp_info *bp_info)
} }
EXPORT_SYMBOL(get_bypass_info); EXPORT_SYMBOL(get_bypass_info);
int init_lib_module(void) int __init init_lib_module(void)
{ {
printk(VERSION); printk(VERSION);
return 0; return 0;
} }
void cleanup_lib_module(void) void __exit cleanup_lib_module(void)
{ {
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment