Fixed MACRO,Extern and parentheses Coding style warnings and errors - listed only few bpctl_mod.c:120: WARNING: externs should be avoided in .c files bpctl_mod.c:121: WARNING: externs should be avoided in .c files bpctl_mod.c:122: WARNING: externs should be avoided in .c files bpctl_mod.c:124: WARNING: externs should be avoided in .c files bpctl_mod.c:125: WARNING: externs should be avoided in .c files bp_ioctl.h:54: ERROR: Macros with complex values should be enclosed in parenthesis bp_ioctl.h:159: ERROR: Macros with complex values should be enclosed in p arenthesis bpctl_mod.c:1395: WARNING: Unnecessary parentheses - maybe == should be = ? Signed-off-by: Surendra Patil <surendra.tux@xxxxxxxxx> --- drivers/staging/silicom/bpctl_mod.c | 28 ++++++++++++++-------------- drivers/staging/silicom/bypasslib/bp_ioctl.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/staging/silicom/bpctl_mod.c b/drivers/staging/silicom/bpctl_mod.c index 20325f5..5edb9d4 100644 --- a/drivers/staging/silicom/bpctl_mod.c +++ b/drivers/staging/silicom/bpctl_mod.c @@ -117,12 +117,12 @@ static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left); static struct bpctl_dev *get_status_port_fn(struct bpctl_dev *pbpctl_dev); static void if_scan_init(void); -int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block); -int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block); -int bp_proc_create(void); +static int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block); +static int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block); +static int bp_proc_create(void); -int is_bypass_fn(struct bpctl_dev *pbpctl_dev); -int get_dev_idx_bsf(int bus, int slot, int func); +static int is_bypass_fn(struct bpctl_dev *pbpctl_dev); +static int get_dev_idx_bsf(int bus, int slot, int func); static int bp_get_dev_idx_bsf(struct net_device *dev, int *index) { @@ -262,8 +262,8 @@ static struct notifier_block bp_notifier_block = { .notifier_call = bp_device_event, }; -int is_bypass_fn(struct bpctl_dev *pbpctl_dev); -int wdt_time_left(struct bpctl_dev *pbpctl_dev); +static int is_bypass_fn(struct bpctl_dev *pbpctl_dev); +static int wdt_time_left(struct bpctl_dev *pbpctl_dev); static void write_pulse(struct bpctl_dev *pbpctl_dev, unsigned int ctrl_ext, @@ -1392,7 +1392,7 @@ static int wdt_pulse(struct bpctl_dev *pbpctl_dev) (ctrl_ext & ~(BP10G_MCLK_DATA_OUT | BP10G_MDIO_DATA_OUT))); } - if ((pbpctl_dev->wdt_status == WDT_STATUS_EN)) + if (pbpctl_dev->wdt_status == WDT_STATUS_EN) /*&& (pbpctl_dev->bp_ext_ver<PXG4BPFI_VER) */ pbpctl_dev->bypass_wdt_on_time = jiffies; #ifdef BP_SYNC_FLAG @@ -2866,7 +2866,7 @@ int std_nic_off(struct bpctl_dev *pbpctl_dev) return BP_NOT_CAP; } -int wdt_time_left(struct bpctl_dev *pbpctl_dev) +static int wdt_time_left(struct bpctl_dev *pbpctl_dev) { /* unsigned long curr_time=((long long)(jiffies*1000))/HZ, delta_time=0,wdt_on_time=((long long)(pbpctl_dev->bypass_wdt_on_time*1000))/HZ; */ @@ -7101,13 +7101,13 @@ int get_bp_hw_reset_sd(int ifindex) } EXPORT_SYMBOL(get_bp_hw_reset_sd); -int get_bypass_info_sd(int ifindex, struct bp_info *bp_info) +static int get_bypass_info_sd(int ifindex, struct bp_info *bp_info) { return get_bypass_info_fn(get_dev_idx_p(ifindex), bp_info->prod_name, &bp_info->fw_ver); } EXPORT_SYMBOL(get_bypass_info_sd); -int bp_if_scan_sd(void) +static int bp_if_scan_sd(void) { if_scan_init(); return 0; @@ -7118,7 +7118,7 @@ EXPORT_SYMBOL(bp_if_scan_sd); static struct proc_dir_entry *bp_procfs_dir; -int bp_proc_create(void) +static int bp_proc_create(void) { bp_procfs_dir = proc_mkdir(BP_PROC_DIR, init_net.proc_net); if (bp_procfs_dir == (struct proc_dir_entry *)0) { @@ -7746,7 +7746,7 @@ static int show_wd_autoreset(struct seq_file *m, void *v) } RW_FOPS(wd_autoreset) -int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block) +static int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block) { struct bypass_pfs_sd *current_pfs = &(pbp_device_block->bypass_pfs_set); static struct proc_dir_entry *procfs_dir; @@ -7816,7 +7816,7 @@ int bypass_proc_create_dev_sd(struct bpctl_dev *pbp_device_block) return ret; } -int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block) +static int bypass_proc_remove_dev_sd(struct bpctl_dev *pbp_device_block) { struct bypass_pfs_sd *current_pfs = &pbp_device_block->bypass_pfs_set; diff --git a/drivers/staging/silicom/bypasslib/bp_ioctl.h b/drivers/staging/silicom/bypasslib/bp_ioctl.h index 2d1ef53..a0fb79f 100644 --- a/drivers/staging/silicom/bypasslib/bp_ioctl.h +++ b/drivers/staging/silicom/bypasslib/bp_ioctl.h @@ -51,7 +51,7 @@ #define WDT_STEP_TIME 0x10 /* BIT_4 */ #define WD_MIN_TIME_GET(desc) (desc & 0xf) -#define WD_STEP_COUNT_GET(desc) (desc>>5) & 0xf +#define WD_STEP_COUNT_GET(desc) ((desc>>5) & 0xf) typedef enum { IS_BYPASS = 1, @@ -156,7 +156,7 @@ typedef enum { } CMND_TYPE_SD; -#define SIOCGIFBYPASS SIOCDEVPRIVATE+10 +#define SIOCGIFBYPASS (SIOCDEVPRIVATE+10) struct bp_info { char prod_name[14]; -- 1.8.3.2 _______________________________________________ devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxx http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel