Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: Silicom: bpctl_mod.c & bypass.c: Adding blank lines

Added a blank line after declarations in many places to fix
the following warning issued by checkpatch.pl:

WARNING: Missing a blank line after declarations

Signed-off-by: Chaitanya Hazarey <c@24.io>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Chaitanya Hazarey and committed by
Greg Kroah-Hartman
9c73b46a ef71c9b8

+88 -2
+86 -2
drivers/staging/silicom/bpctl_mod.c
··· 752 752 uint32_t ctrl_ext = 0, ctrl = 0; 753 753 struct bpctl_dev *pbpctl_dev_c = NULL; 754 754 unsigned long flags; 755 + 755 756 if (pbpctl_dev->bp_10g9) { 756 757 pbpctl_dev_c = get_status_port_fn(pbpctl_dev); 757 758 if (!pbpctl_dev_c) ··· 928 927 929 928 #ifdef BP_SYNC_FLAG 930 929 unsigned long flags; 930 + 931 931 spin_lock_irqsave(&pbpctl_dev->bypass_wr_lock, flags); 932 932 #else 933 933 atomic_set(&pbpctl_dev->wdt_busy, 1); ··· 1565 1563 int zero_set_fn(struct bpctl_dev *pbpctl_dev) 1566 1564 { 1567 1565 uint32_t ctrl_ext = 0, ctrl_value = 0; 1566 + 1568 1567 if (!pbpctl_dev) 1569 1568 return -1; 1570 1569 ··· 1591 1588 int pulse_get2_fn(struct bpctl_dev *pbpctl_dev) 1592 1589 { 1593 1590 uint32_t ctrl_ext = 0, ctrl_value = 0; 1591 + 1594 1592 if (!pbpctl_dev) 1595 1593 return -1; 1596 1594 ··· 1607 1603 int pulse_get1_fn(struct bpctl_dev *pbpctl_dev) 1608 1604 { 1609 1605 uint32_t ctrl_ext = 0, ctrl_value = 0; 1606 + 1610 1607 if (!pbpctl_dev) 1611 1608 return -1; 1612 1609 ··· 1671 1666 { 1672 1667 struct bpctl_dev *p; 1673 1668 int n; 1669 + 1674 1670 for (n = 0, p = bpctl_dev_arr; n < device_num && p->pdev; n++) { 1675 1671 if (p->bus == dev->bus 1676 1672 && p->slot == dev->slot ··· 1849 1843 static int tap_off(struct bpctl_dev *pbpctl_dev) 1850 1844 { 1851 1845 int ret = BP_NOT_CAP; 1846 + 1852 1847 if ((pbpctl_dev->bp_caps & TAP_CAP) 1853 1848 && (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) { 1854 1849 write_data(pbpctl_dev, TAP_OFF); ··· 1863 1856 static int tap_on(struct bpctl_dev *pbpctl_dev) 1864 1857 { 1865 1858 int ret = BP_NOT_CAP; 1859 + 1866 1860 if ((pbpctl_dev->bp_caps & TAP_CAP) 1867 1861 && (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER)) { 1868 1862 write_data(pbpctl_dev, TAP_ON); ··· 1877 1869 static int disc_off(struct bpctl_dev *pbpctl_dev) 1878 1870 { 1879 1871 int ret = 0; 1872 + 1880 1873 if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 0x8)) { 1881 1874 write_data(pbpctl_dev, DISC_OFF); 1882 1875 msec_delay_bp(LATCH_DELAY); ··· 1890 1881 static int disc_on(struct bpctl_dev *pbpctl_dev) 1891 1882 { 1892 1883 int ret = 0; 1884 + 1893 1885 if ((pbpctl_dev->bp_caps & DISC_CAP) && (pbpctl_dev->bp_ext_ver >= 0x8)) { 1894 1886 write_data(pbpctl_dev, /*DISC_ON */ 0x85); 1895 1887 msec_delay_bp(LATCH_DELAY); ··· 2280 2270 { 2281 2271 int ret = 0, ctrl = 0; 2282 2272 struct bpctl_dev *pbpctl_dev_m; 2273 + 2283 2274 if ((is_bypass_fn(pbpctl_dev)) == 1) 2284 2275 pbpctl_dev_m = pbpctl_dev; 2285 2276 else ··· 2813 2802 static int wdt_timer(struct bpctl_dev *pbpctl_dev, int *time_left) 2814 2803 { 2815 2804 int ret = 0; 2805 + 2816 2806 if (pbpctl_dev->bp_caps & WD_CTL_CAP) { 2817 2807 { 2818 2808 if (pbpctl_dev->wdt_status == WDT_STATUS_UNKNOWN) ··· 3026 3014 { 3027 3015 uint32_t ctrl = 0; 3028 3016 struct bpctl_dev *pbpctl_dev_m; 3017 + 3029 3018 if ((is_bypass_fn(pbpctl_dev)) == 1) 3030 3019 pbpctl_dev_m = pbpctl_dev; 3031 3020 else ··· 3208 3195 static int bypass_status(struct bpctl_dev *pbpctl_dev) 3209 3196 { 3210 3197 u32 ctrl_ext = 0; 3198 + 3211 3199 if (pbpctl_dev->bp_caps & BP_CAP) { 3212 3200 3213 3201 struct bpctl_dev *pbpctl_dev_b = NULL; ··· 3337 3323 static int wdt_programmed(struct bpctl_dev *pbpctl_dev, int *timeout) 3338 3324 { 3339 3325 int ret = 0; 3326 + 3340 3327 if (pbpctl_dev->bp_caps & WD_CTL_CAP) { 3341 3328 if (pbpctl_dev->bp_ext_ver >= PXG2BPI_VER) { 3342 3329 if ((read_reg(pbpctl_dev, STATUS_REG_ADDR)) & ··· 3401 3386 static int tap_flag_status_clear(struct bpctl_dev *pbpctl_dev) 3402 3387 { 3403 3388 uint32_t status_reg = 0; 3389 + 3404 3390 if (pbpctl_dev->bp_caps & TAP_STATUS_CAP) { 3405 3391 if (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER) { 3406 3392 status_reg = read_reg(pbpctl_dev, STATUS_TAP_REG_ADDR); ··· 3416 3400 static int tap_change_status(struct bpctl_dev *pbpctl_dev) 3417 3401 { 3418 3402 int ret = BP_NOT_CAP; 3403 + 3419 3404 if (pbpctl_dev->bp_ext_ver >= PXG2TBPI_VER) { 3420 3405 if (pbpctl_dev->bp_caps & TAP_CAP) { 3421 3406 if (pbpctl_dev->bp_caps & BP_CAP) { ··· 3507 3490 static int disc_flag_status_clear(struct bpctl_dev *pbpctl_dev) 3508 3491 { 3509 3492 uint32_t status_reg = 0; 3493 + 3510 3494 if (pbpctl_dev->bp_caps & DISC_CAP) { 3511 3495 if (pbpctl_dev->bp_ext_ver >= 0x8) { 3512 3496 status_reg = read_reg(pbpctl_dev, STATUS_DISC_REG_ADDR); ··· 3522 3504 static int disc_change_status(struct bpctl_dev *pbpctl_dev) 3523 3505 { 3524 3506 int ret = BP_NOT_CAP; 3507 + 3525 3508 if (pbpctl_dev->bp_caps & DISC_CAP) { 3526 3509 ret = disc_flag_status(pbpctl_dev); 3527 3510 disc_flag_status_clear(pbpctl_dev); ··· 3618 3599 static int disc_status(struct bpctl_dev *pbpctl_dev) 3619 3600 { 3620 3601 int ctrl = 0; 3602 + 3621 3603 if (pbpctl_dev->bp_caps & DISC_CAP) { 3622 3604 ctrl = disc_off_status(pbpctl_dev); 3623 3605 if (ctrl < 0) ··· 3764 3744 3765 3745 #ifdef BYPASS_DEBUG 3766 3746 int ret = 0; 3747 + 3767 3748 if (!(INTEL_IF_SERIES(adapter->bp_device_block.subdevice))) { 3768 3749 ret = read_reg(pbpctl_dev, VER_REG_ADDR); 3769 3750 printk("VER_REG reg1=%x\n", ret); ··· 4176 4155 static int set_dis_bypass_fn(struct bpctl_dev *pbpctl_dev, int dis_param) 4177 4156 { 4178 4157 int ret = 0; 4158 + 4179 4159 if (!pbpctl_dev) 4180 4160 return -1; 4181 4161 ··· 4204 4182 static int set_bypass_pwoff_fn(struct bpctl_dev *pbpctl_dev, int bypass_mode) 4205 4183 { 4206 4184 int ret = 0; 4185 + 4207 4186 if (!pbpctl_dev) 4208 4187 return -1; 4209 4188 ··· 4232 4209 static int set_bypass_pwup_fn(struct bpctl_dev *pbpctl_dev, int bypass_mode) 4233 4210 { 4234 4211 int ret = 0; 4212 + 4235 4213 if (!pbpctl_dev) 4236 4214 return -1; 4237 4215 ··· 4260 4236 static int set_bypass_wd_fn(struct bpctl_dev *pbpctl_dev, int timeout) 4261 4237 { 4262 4238 int ret = 0; 4239 + 4263 4240 if (!pbpctl_dev) 4264 4241 return -1; 4265 4242 ··· 4307 4282 static int get_wd_set_caps_fn(struct bpctl_dev *pbpctl_dev) 4308 4283 { 4309 4284 int bp_status = 0; 4310 - 4311 4285 unsigned int step_value = TIMEOUT_MAX_STEP + 1, bit_cnt = 0; 4286 + 4312 4287 if (!pbpctl_dev) 4313 4288 return -1; 4314 4289 ··· 4331 4306 static int set_std_nic_fn(struct bpctl_dev *pbpctl_dev, int nic_mode) 4332 4307 { 4333 4308 int ret = 0; 4309 + 4334 4310 if (!pbpctl_dev) 4335 4311 return -1; 4336 4312 ··· 4384 4358 static int set_tap_pwup_fn(struct bpctl_dev *pbpctl_dev, int tap_mode) 4385 4359 { 4386 4360 int ret = 0; 4361 + 4387 4362 if (!pbpctl_dev) 4388 4363 return -1; 4389 4364 ··· 4403 4376 static int get_tap_pwup_fn(struct bpctl_dev *pbpctl_dev) 4404 4377 { 4405 4378 int ret = 0; 4379 + 4406 4380 if (!pbpctl_dev) 4407 4381 return -1; 4408 4382 ··· 4424 4396 static int set_dis_tap_fn(struct bpctl_dev *pbpctl_dev, int dis_param) 4425 4397 { 4426 4398 int ret = 0; 4399 + 4427 4400 if (!pbpctl_dev) 4428 4401 return -1; 4429 4402 ··· 4467 4438 static int get_disc_fn(struct bpctl_dev *pbpctl_dev) 4468 4439 { 4469 4440 int ret = 0; 4441 + 4470 4442 if (!pbpctl_dev) 4471 4443 return -1; 4472 4444 ··· 4479 4449 static int set_disc_pwup_fn(struct bpctl_dev *pbpctl_dev, int disc_mode) 4480 4450 { 4481 4451 int ret = 0; 4452 + 4482 4453 if (!pbpctl_dev) 4483 4454 return -1; 4484 4455 ··· 4498 4467 static int get_disc_pwup_fn(struct bpctl_dev *pbpctl_dev) 4499 4468 { 4500 4469 int ret = 0; 4470 + 4501 4471 if (!pbpctl_dev) 4502 4472 return -1; 4503 4473 ··· 4509 4477 static int get_disc_change_fn(struct bpctl_dev *pbpctl_dev) 4510 4478 { 4511 4479 int ret = 0; 4480 + 4512 4481 if (!pbpctl_dev) 4513 4482 return -1; 4514 4483 ··· 4520 4487 static int set_dis_disc_fn(struct bpctl_dev *pbpctl_dev, int dis_param) 4521 4488 { 4522 4489 int ret = 0; 4490 + 4523 4491 if (!pbpctl_dev) 4524 4492 return -1; 4525 4493 ··· 4539 4505 static int get_dis_disc_fn(struct bpctl_dev *pbpctl_dev) 4540 4506 { 4541 4507 int ret = 0; 4508 + 4542 4509 if (!pbpctl_dev) 4543 4510 return -1; 4544 4511 ··· 4566 4531 4567 4532 static int set_tx_fn(struct bpctl_dev *pbpctl_dev, int tx_state) 4568 4533 { 4569 - 4570 4534 struct bpctl_dev *pbpctl_dev_b = NULL; 4535 + 4571 4536 if (!pbpctl_dev) 4572 4537 return -1; 4573 4538 ··· 4645 4610 struct bpctl_dev **pbpctl_dev_out) 4646 4611 { 4647 4612 int idx_dev = 0; 4613 + 4648 4614 if (!pbpctl_dev) 4649 4615 return -1; 4650 4616 ··· 4689 4653 static int get_tx_fn(struct bpctl_dev *pbpctl_dev) 4690 4654 { 4691 4655 struct bpctl_dev *pbpctl_dev_b = NULL; 4656 + 4692 4657 if (!pbpctl_dev) 4693 4658 return -1; 4694 4659 ··· 4849 4812 static int get_tpl_fn(struct bpctl_dev *pbpctl_dev) 4850 4813 { 4851 4814 int ret = BP_NOT_CAP; 4815 + 4852 4816 if (!pbpctl_dev) 4853 4817 return -1; 4854 4818 ··· 4884 4846 static int get_bp_wait_at_pwup_fn(struct bpctl_dev *pbpctl_dev) 4885 4847 { 4886 4848 int ret = 0; 4849 + 4887 4850 if (!pbpctl_dev) 4888 4851 return -1; 4889 4852 ··· 4918 4879 static int get_bp_hw_reset_fn(struct bpctl_dev *pbpctl_dev) 4919 4880 { 4920 4881 int ret = 0; 4882 + 4921 4883 if (!pbpctl_dev) 4922 4884 return -1; 4923 4885 ··· 4946 4906 static int get_dev_idx_bsf(int bus, int slot, int func) 4947 4907 { 4948 4908 int idx_dev = 0; 4909 + 4949 4910 for (idx_dev = 0; 4950 4911 ((bpctl_dev_arr[idx_dev].pdev != NULL) && (idx_dev < device_num)); 4951 4912 idx_dev++) { ··· 6442 6401 static void __exit bypass_cleanup_module(void) 6443 6402 { 6444 6403 int i; 6404 + 6445 6405 unregister_netdevice_notifier(&bp_notifier_block); 6446 6406 6447 6407 for (i = 0; i < device_num; i++) { ··· 6747 6705 { 6748 6706 struct bpctl_dev *pbpctl_dev_out; 6749 6707 int ret = get_bypass_slave_fn(get_dev_idx_p(ifindex), &pbpctl_dev_out); 6708 + 6750 6709 if (ret == 1) 6751 6710 return pbpctl_dev_out->ifindex; 6752 6711 return -1; ··· 6797 6754 struct bpctl_dev *dev) 6798 6755 { 6799 6756 struct bypass_pfs_sd *pfs = &dev->bypass_pfs_set; 6757 + 6800 6758 if (!proc_create_data(proc_name, 0644, pfs->bypass_entry, fops, dev)) 6801 6759 return -1; 6802 6760 return 0; ··· 6842 6798 { 6843 6799 struct bpctl_dev *dev = m->private; 6844 6800 struct bpctl_dev *slave = get_status_port_fn(dev); 6801 + 6845 6802 if (!slave) 6846 6803 slave = dev; 6847 6804 if (!slave) ··· 6857 6812 { 6858 6813 struct bpctl_dev *dev = m->private; 6859 6814 int ret = get_bypass_caps_fn(dev); 6815 + 6860 6816 if (ret == BP_NOT_CAP) 6861 6817 seq_puts(m, "-1\n"); 6862 6818 else ··· 6870 6824 { 6871 6825 struct bpctl_dev *dev = m->private; 6872 6826 int ret = get_wd_set_caps_fn(dev); 6827 + 6873 6828 if (ret == BP_NOT_CAP) 6874 6829 seq_puts(m, "-1\n"); 6875 6830 else ··· 6907 6860 size_t count, loff_t *pos) 6908 6861 { 6909 6862 int bypass_param = user_on_off(buffer, count); 6863 + 6910 6864 if (bypass_param < 0) 6911 6865 return -1; 6912 6866 ··· 6918 6870 { 6919 6871 struct bpctl_dev *dev = m->private; 6920 6872 int ret = get_bypass_fn(dev); 6873 + 6921 6874 if (ret == BP_NOT_CAP) 6922 6875 seq_puts(m, "fail\n"); 6923 6876 else if (ret == 1) ··· 6933 6884 size_t count, loff_t *pos) 6934 6885 { 6935 6886 int tap_param = user_on_off(buffer, count); 6887 + 6936 6888 if (tap_param < 0) 6937 6889 return -1; 6938 6890 ··· 6944 6894 { 6945 6895 struct bpctl_dev *dev = m->private; 6946 6896 int ret = get_tap_fn(dev); 6897 + 6947 6898 if (ret == BP_NOT_CAP) 6948 6899 seq_puts(m, "fail\n"); 6949 6900 else if (ret == 1) ··· 6959 6908 size_t count, loff_t *pos) 6960 6909 { 6961 6910 int tap_param = user_on_off(buffer, count); 6911 + 6962 6912 if (tap_param < 0) 6963 6913 return -1; 6964 6914 ··· 6970 6918 { 6971 6919 struct bpctl_dev *dev = m->private; 6972 6920 int ret = get_disc_fn(dev); 6921 + 6973 6922 if (ret == BP_NOT_CAP) 6974 6923 seq_puts(m, "fail\n"); 6975 6924 else if (ret == 1) ··· 6985 6932 { 6986 6933 struct bpctl_dev *dev = m->private; 6987 6934 int ret = get_bypass_change_fn(dev); 6935 + 6988 6936 if (ret == 1) 6989 6937 seq_puts(m, "on\n"); 6990 6938 else if (ret == 0) ··· 7000 6946 { 7001 6947 struct bpctl_dev *dev = m->private; 7002 6948 int ret = get_tap_change_fn(dev); 6949 + 7003 6950 if (ret == 1) 7004 6951 seq_puts(m, "on\n"); 7005 6952 else if (ret == 0) ··· 7015 6960 { 7016 6961 struct bpctl_dev *dev = m->private; 7017 6962 int ret = get_disc_change_fn(dev); 6963 + 7018 6964 if (ret == 1) 7019 6965 seq_puts(m, "on\n"); 7020 6966 else if (ret == 0) ··· 7032 6976 struct bpctl_dev *dev = PDE_DATA(file_inode(file)); 7033 6977 int timeout; 7034 6978 int ret = kstrtoint_from_user(buffer, count, 10, &timeout); 6979 + 7035 6980 if (ret) 7036 6981 return ret; 7037 6982 set_bypass_wd_fn(dev, timeout); ··· 7060 7003 { 7061 7004 struct bpctl_dev *dev = m->private; 7062 7005 int ret = 0, timeout = 0; 7006 + 7063 7007 ret = get_wd_expire_time_fn(dev, &timeout); 7064 7008 if (ret == BP_NOT_CAP) 7065 7009 seq_puts(m, "fail\n"); ··· 7079 7021 { 7080 7022 struct bpctl_dev *dev = PDE_DATA(file_inode(file)); 7081 7023 int tpl_param = user_on_off(buffer, count); 7024 + 7082 7025 if (tpl_param < 0) 7083 7026 return -1; 7084 7027 ··· 7090 7031 { 7091 7032 struct bpctl_dev *dev = m->private; 7092 7033 int ret = get_tpl_fn(dev); 7034 + 7093 7035 if (ret == BP_NOT_CAP) 7094 7036 seq_puts(m, "fail\n"); 7095 7037 else if (ret == 1) ··· 7107 7047 { 7108 7048 struct bpctl_dev *dev = PDE_DATA(file_inode(file)); 7109 7049 int tpl_param = user_on_off(buffer, count); 7050 + 7110 7051 if (tpl_param < 0) 7111 7052 return -1; 7112 7053 ··· 7118 7057 { 7119 7058 struct bpctl_dev *dev = m->private; 7120 7059 int ret = get_bp_wait_at_pwup_fn(dev); 7060 + 7121 7061 if (ret == BP_NOT_CAP) 7122 7062 seq_puts(m, "fail\n"); 7123 7063 else if (ret == 1) ··· 7134 7072 { 7135 7073 struct bpctl_dev *dev = PDE_DATA(file_inode(file)); 7136 7074 int tpl_param = user_on_off(buffer, count); 7075 + 7137 7076 if (tpl_param < 0) 7138 7077 return -1; 7139 7078 ··· 7145 7082 { 7146 7083 struct bpctl_dev *dev = m->private; 7147 7084 int ret = get_bp_hw_reset_fn(dev); 7085 + 7148 7086 if (ret == BP_NOT_CAP) 7149 7087 seq_puts(m, "fail\n"); 7150 7088 else if (ret == 1) ··· 7162 7098 { 7163 7099 struct bpctl_dev *dev = m->private; 7164 7100 int ret = reset_bypass_wd_timer_fn(dev); 7101 + 7165 7102 if (ret == BP_NOT_CAP) 7166 7103 seq_puts(m, "fail\n"); 7167 7104 else if (ret == 0) ··· 7177 7112 size_t count, loff_t *pos) 7178 7113 { 7179 7114 int bypass_param = user_on_off(buffer, count); 7115 + 7180 7116 if (bypass_param < 0) 7181 7117 return -EINVAL; 7182 7118 ··· 7188 7122 { 7189 7123 struct bpctl_dev *dev = m->private; 7190 7124 int ret = get_dis_bypass_fn(dev); 7125 + 7191 7126 if (ret == BP_NOT_CAP) 7192 7127 seq_puts(m, "fail\n"); 7193 7128 else if (ret == 0) ··· 7203 7136 size_t count, loff_t *pos) 7204 7137 { 7205 7138 int tap_param = user_on_off(buffer, count); 7139 + 7206 7140 if (tap_param < 0) 7207 7141 return -EINVAL; 7208 7142 ··· 7214 7146 { 7215 7147 struct bpctl_dev *dev = m->private; 7216 7148 int ret = get_dis_tap_fn(dev); 7149 + 7217 7150 if (ret == BP_NOT_CAP) 7218 7151 seq_puts(m, "fail\n"); 7219 7152 else if (ret == 0) ··· 7229 7160 size_t count, loff_t *pos) 7230 7161 { 7231 7162 int tap_param = user_on_off(buffer, count); 7163 + 7232 7164 if (tap_param < 0) 7233 7165 return -EINVAL; 7234 7166 ··· 7240 7170 { 7241 7171 struct bpctl_dev *dev = m->private; 7242 7172 int ret = get_dis_disc_fn(dev); 7173 + 7243 7174 if (ret == BP_NOT_CAP) 7244 7175 seq_puts(m, "fail\n"); 7245 7176 else if (ret == 0) ··· 7255 7184 size_t count, loff_t *pos) 7256 7185 { 7257 7186 int bypass_param = user_on_off(buffer, count); 7187 + 7258 7188 if (bypass_param < 0) 7259 7189 return -EINVAL; 7260 7190 ··· 7266 7194 { 7267 7195 struct bpctl_dev *dev = m->private; 7268 7196 int ret = get_bypass_pwup_fn(dev); 7197 + 7269 7198 if (ret == BP_NOT_CAP) 7270 7199 seq_puts(m, "fail\n"); 7271 7200 else if (ret == 0) ··· 7281 7208 size_t count, loff_t *pos) 7282 7209 { 7283 7210 int bypass_param = user_on_off(buffer, count); 7211 + 7284 7212 if (bypass_param < 0) 7285 7213 return -EINVAL; 7286 7214 ··· 7292 7218 { 7293 7219 struct bpctl_dev *dev = m->private; 7294 7220 int ret = get_bypass_pwoff_fn(dev); 7221 + 7295 7222 if (ret == BP_NOT_CAP) 7296 7223 seq_puts(m, "fail\n"); 7297 7224 else if (ret == 0) ··· 7307 7232 size_t count, loff_t *pos) 7308 7233 { 7309 7234 int tap_param = user_on_off(buffer, count); 7235 + 7310 7236 if (tap_param < 0) 7311 7237 return -EINVAL; 7312 7238 ··· 7318 7242 { 7319 7243 struct bpctl_dev *dev = m->private; 7320 7244 int ret = get_tap_pwup_fn(dev); 7245 + 7321 7246 if (ret == BP_NOT_CAP) 7322 7247 seq_puts(m, "fail\n"); 7323 7248 else if (ret == 0) ··· 7333 7256 size_t count, loff_t *pos) 7334 7257 { 7335 7258 int tap_param = user_on_off(buffer, count); 7259 + 7336 7260 if (tap_param < 0) 7337 7261 return -EINVAL; 7338 7262 ··· 7344 7266 { 7345 7267 struct bpctl_dev *dev = m->private; 7346 7268 int ret = get_disc_pwup_fn(dev); 7269 + 7347 7270 if (ret == BP_NOT_CAP) 7348 7271 seq_puts(m, "fail\n"); 7349 7272 else if (ret == 0) ··· 7359 7280 size_t count, loff_t *pos) 7360 7281 { 7361 7282 int bypass_param = user_on_off(buffer, count); 7283 + 7362 7284 if (bypass_param < 0) 7363 7285 return -EINVAL; 7364 7286 ··· 7370 7290 { 7371 7291 struct bpctl_dev *dev = m->private; 7372 7292 int ret = get_std_nic_fn(dev); 7293 + 7373 7294 if (ret == BP_NOT_CAP) 7374 7295 seq_puts(m, "fail\n"); 7375 7296 else if (ret == 0) ··· 7413 7332 { 7414 7333 struct bpctl_dev *dev = m->private; 7415 7334 int ret = get_wd_exp_mode_fn(dev); 7335 + 7416 7336 if (ret == 1) 7417 7337 seq_puts(m, "tap\n"); 7418 7338 else if (ret == 0) ··· 7431 7349 { 7432 7350 int timeout; 7433 7351 int ret = kstrtoint_from_user(buffer, count, 10, &timeout); 7352 + 7434 7353 if (ret) 7435 7354 return ret; 7436 7355 set_wd_autoreset_fn(PDE_DATA(file_inode(file)), timeout); ··· 7441 7358 { 7442 7359 struct bpctl_dev *dev = m->private; 7443 7360 int ret = get_wd_autoreset_fn(dev); 7361 + 7444 7362 if (ret >= 0) 7445 7363 seq_printf(m, "%d\n", ret); 7446 7364 else
+2
drivers/staging/silicom/bypasslib/bypass.c
··· 135 135 static int is_dev_sd(int if_index) 136 136 { 137 137 int ret = 0; 138 + 138 139 SET_BPLIB_INT_FN(is_bypass, int, if_index, ret); 139 140 return ret >= 0 ? 1 : 0; 140 141 } ··· 187 186 static int is_bypass(int if_index) 188 187 { 189 188 int ret = 0; 189 + 190 190 SET_BPLIB_INT_FN(is_bypass, int, if_index, ret); 191 191 192 192 if (ret < 0)