]> git.karo-electronics.de Git - linux-beck.git/commitdiff
bonding: quit messing with IOCTL
authorAl Viro <viro@zeniv.linux.org.uk>
Sat, 3 Sep 2016 23:37:25 +0000 (19:37 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 28 Sep 2016 01:15:21 +0000 (21:15 -0400)
The only remaining users are issuing SIOCGMIIPHY and SIOCGMIIREG,
neither of which deals with userland pointers.  Simply calling
->ndo_do_ioctl() is fine; no messing with set_fs() is needed.
It used to mess with SIOCETHTOOL, which would've needed set_fs(),
but that has been killed in "[NET] ethtool ops are the only way"
9 years ago...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/net/bonding/bond_main.c
include/net/bonding.h

index 9599ed6f121382355b660147fb63554d7a405970..3892811079d0f410f4a1ad38fe30f7f4b1af718d 100644 (file)
@@ -471,9 +471,9 @@ static int bond_check_dev_link(struct bonding *bond,
                /* Yes, the mii is overlaid on the ifreq.ifr_ifru */
                strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
                mii = if_mii(&ifr);
-               if (IOCTL(slave_dev, &ifr, SIOCGMIIPHY) == 0) {
+               if (ioctl(slave_dev, &ifr, SIOCGMIIPHY) == 0) {
                        mii->reg_num = MII_BMSR;
-                       if (IOCTL(slave_dev, &ifr, SIOCGMIIREG) == 0)
+                       if (ioctl(slave_dev, &ifr, SIOCGMIIREG) == 0)
                                return mii->val_out & BMSR_LSTATUS;
                }
        }
index 6360c259da6d62cd3c4b99c858acd6db19eff401..f32f7ef8a23a25a06f8e095f6982b57c78b0dd7f 100644 (file)
 #ifndef __long_aligned
 #define __long_aligned __attribute__((aligned((sizeof(long)))))
 #endif
-/*
- * Less bad way to call ioctl from within the kernel; this needs to be
- * done some other way to get the call out of interrupt context.
- * Needs "ioctl" variable to be supplied by calling context.
- */
-#define IOCTL(dev, arg, cmd) ({                \
-       int res = 0;                    \
-       mm_segment_t fs = get_fs();     \
-       set_fs(get_ds());               \
-       res = ioctl(dev, arg, cmd);     \
-       set_fs(fs);                     \
-       res; })
 
 #define BOND_MODE(bond) ((bond)->params.mode)