return tfile->napi_frags_enabled;
 }
 
-#ifdef CONFIG_TUN_VNET_CROSS_LE
 static inline bool tun_legacy_is_little_endian(struct tun_struct *tun)
 {
-       return tun->flags & TUN_VNET_BE ? false :
-               virtio_legacy_is_little_endian();
+       bool be = IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE) &&
+                 (tun->flags & TUN_VNET_BE);
+
+       return !be && virtio_legacy_is_little_endian();
 }
 
 static long tun_get_vnet_be(struct tun_struct *tun, int __user *argp)
 {
        int be = !!(tun->flags & TUN_VNET_BE);
 
+       if (!IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE))
+               return -EINVAL;
+
        if (put_user(be, argp))
                return -EFAULT;
 
 {
        int be;
 
+       if (!IS_ENABLED(CONFIG_TUN_VNET_CROSS_LE))
+               return -EINVAL;
+
        if (get_user(be, argp))
                return -EFAULT;
 
 
        return 0;
 }
-#else
-static inline bool tun_legacy_is_little_endian(struct tun_struct *tun)
-{
-       return virtio_legacy_is_little_endian();
-}
-
-static long tun_get_vnet_be(struct tun_struct *tun, int __user *argp)
-{
-       return -EINVAL;
-}
-
-static long tun_set_vnet_be(struct tun_struct *tun, int __user *argp)
-{
-       return -EINVAL;
-}
-#endif /* CONFIG_TUN_VNET_CROSS_LE */
 
 static inline bool tun_is_little_endian(struct tun_struct *tun)
 {