]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
misc: tegra-throughput: 64-bit compatibility
authorArto Merilainen <amerilainen@nvidia.com>
Tue, 4 Mar 2014 06:23:32 +0000 (08:23 +0200)
committerBharat Nihalani <bnihalani@nvidia.com>
Wed, 5 Mar 2014 07:56:06 +0000 (23:56 -0800)
This patch modifies the ioctls to be 64-bit compatible by:
- making the tegra_throughput_target_fps_args size explicit
- adding .compat_ioctl to support 32bit userspace

Bug 1468697

Change-Id: Ib92894e733012171e29096105604353f3ff881df
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/376948
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Tested-by: Bharat Nihalani <bnihalani@nvidia.com>
drivers/misc/tegra-throughput.c
include/linux/throughput_ioctl.h

index cf517ac744ba76258a39de91406357051aeb3842..cb9ef937311a9b8db05b58f431641269a43b90a8 100644 (file)
@@ -1,20 +1,17 @@
 /*
- * drivers/misc/throughput.c
+ * Copyright (c) 2012-2014, NVIDIA CORPORATION.  All rights reserved.
  *
- * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
+ * This program is distributed in the hope it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <linux/kthread.h>
@@ -215,6 +212,9 @@ throughput_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 static const struct file_operations throughput_user_fops = {
        .owner                  = THIS_MODULE,
        .open                   = throughput_open,
+#ifdef CONFIG_COMPAT
+       .compat_ioctl           = throughput_ioctl,
+#endif
        .release                = throughput_release,
        .unlocked_ioctl         = throughput_ioctl,
 };
index 96e57399b2e972f85288133a17397be61a2a64c3..2b58f0166b465808852d9665fd20399c7dcf93d8 100644 (file)
@@ -1,22 +1,17 @@
 /*
- * include/linux/throughput_ioctl.h
+ * Copyright (c) 2012-2014, NVIDIA CORPORATION.  All rights reserved.
  *
- * ioctl declarations for throughput miscdev
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms and conditions of the GNU General Public License,
+ * version 2, as published by the Free Software Foundation.
  *
- * Copyright (c) 2012, NVIDIA Corporation.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, version 2 of the License.
- *
- * This program is distributed in the hope that it will be useful, but WITHOUT
+ * This program is distributed in the hope it will be useful, but WITHOUT
  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
  * more details.
  *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef __TEGRA_THROUGHPUT_IOCTL_H
@@ -28,7 +23,7 @@
 
 struct tegra_throughput_target_fps_args {
        __u32 target_fps;
-};
+} __packed;
 
 #define TEGRA_THROUGHPUT_IOCTL_TARGET_FPS \
        _IOW(TEGRA_THROUGHPUT_MAGIC, 1, struct tegra_throughput_target_fps_args)