alignment.c (6ad390a25a9d1d8606b9b826878f0a30639dc2b3) | alignment.c (496ad9aa8ef448058e36ca7a787c61f2e63f0f54) |
---|---|
1/* 2 * Alignment access counters and corresponding user-space interfaces. 3 * 4 * Copyright (C) 2009 ST Microelectronics 5 * Copyright (C) 2009 - 2010 Paul Mundt 6 * 7 * This file is subject to the terms and conditions of the GNU General Public 8 * License. See the file "COPYING" in the main directory of this archive --- 126 unchanged lines hidden (view full) --- 135static int alignment_proc_open(struct inode *inode, struct file *file) 136{ 137 return single_open(file, alignment_proc_show, NULL); 138} 139 140static ssize_t alignment_proc_write(struct file *file, 141 const char __user *buffer, size_t count, loff_t *pos) 142{ | 1/* 2 * Alignment access counters and corresponding user-space interfaces. 3 * 4 * Copyright (C) 2009 ST Microelectronics 5 * Copyright (C) 2009 - 2010 Paul Mundt 6 * 7 * This file is subject to the terms and conditions of the GNU General Public 8 * License. See the file "COPYING" in the main directory of this archive --- 126 unchanged lines hidden (view full) --- 135static int alignment_proc_open(struct inode *inode, struct file *file) 136{ 137 return single_open(file, alignment_proc_show, NULL); 138} 139 140static ssize_t alignment_proc_write(struct file *file, 141 const char __user *buffer, size_t count, loff_t *pos) 142{ |
143 int *data = PDE(file->f_path.dentry->d_inode)->data; | 143 int *data = PDE(file_inode(file))->data; |
144 char mode; 145 146 if (count > 0) { 147 if (get_user(mode, buffer)) 148 return -EFAULT; 149 if (mode >= '0' && mode <= '5') 150 *data = mode - '0'; 151 } --- 39 unchanged lines hidden --- | 144 char mode; 145 146 if (count > 0) { 147 if (get_user(mode, buffer)) 148 return -EFAULT; 149 if (mode >= '0' && mode <= '5') 150 *data = mode - '0'; 151 } --- 39 unchanged lines hidden --- |