@@ -303,9 +303,7 @@ static ssize_t proc_reg_read_iter(struct kiocb *iocb, struct iov_iter *iter)
303
303
304
304
static ssize_t pde_read (struct proc_dir_entry * pde , struct file * file , char __user * buf , size_t count , loff_t * ppos )
305
305
{
306
- typeof_member (struct proc_ops , proc_read ) read ;
307
-
308
- read = pde -> proc_ops -> proc_read ;
306
+ __auto_type read = pde -> proc_ops -> proc_read ;
309
307
if (read )
310
308
return read (file , buf , count , ppos );
311
309
return - EIO ;
@@ -327,9 +325,7 @@ static ssize_t proc_reg_read(struct file *file, char __user *buf, size_t count,
327
325
328
326
static ssize_t pde_write (struct proc_dir_entry * pde , struct file * file , const char __user * buf , size_t count , loff_t * ppos )
329
327
{
330
- typeof_member (struct proc_ops , proc_write ) write ;
331
-
332
- write = pde -> proc_ops -> proc_write ;
328
+ __auto_type write = pde -> proc_ops -> proc_write ;
333
329
if (write )
334
330
return write (file , buf , count , ppos );
335
331
return - EIO ;
@@ -351,9 +347,7 @@ static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t
351
347
352
348
static __poll_t pde_poll (struct proc_dir_entry * pde , struct file * file , struct poll_table_struct * pts )
353
349
{
354
- typeof_member (struct proc_ops , proc_poll ) poll ;
355
-
356
- poll = pde -> proc_ops -> proc_poll ;
350
+ __auto_type poll = pde -> proc_ops -> proc_poll ;
357
351
if (poll )
358
352
return poll (file , pts );
359
353
return DEFAULT_POLLMASK ;
@@ -375,9 +369,7 @@ static __poll_t proc_reg_poll(struct file *file, struct poll_table_struct *pts)
375
369
376
370
static long pde_ioctl (struct proc_dir_entry * pde , struct file * file , unsigned int cmd , unsigned long arg )
377
371
{
378
- typeof_member (struct proc_ops , proc_ioctl ) ioctl ;
379
-
380
- ioctl = pde -> proc_ops -> proc_ioctl ;
372
+ __auto_type ioctl = pde -> proc_ops -> proc_ioctl ;
381
373
if (ioctl )
382
374
return ioctl (file , cmd , arg );
383
375
return - ENOTTY ;
@@ -400,9 +392,7 @@ static long proc_reg_unlocked_ioctl(struct file *file, unsigned int cmd, unsigne
400
392
#ifdef CONFIG_COMPAT
401
393
static long pde_compat_ioctl (struct proc_dir_entry * pde , struct file * file , unsigned int cmd , unsigned long arg )
402
394
{
403
- typeof_member (struct proc_ops , proc_compat_ioctl ) compat_ioctl ;
404
-
405
- compat_ioctl = pde -> proc_ops -> proc_compat_ioctl ;
395
+ __auto_type compat_ioctl = pde -> proc_ops -> proc_compat_ioctl ;
406
396
if (compat_ioctl )
407
397
return compat_ioctl (file , cmd , arg );
408
398
return - ENOTTY ;
@@ -424,9 +414,7 @@ static long proc_reg_compat_ioctl(struct file *file, unsigned int cmd, unsigned
424
414
425
415
static int pde_mmap (struct proc_dir_entry * pde , struct file * file , struct vm_area_struct * vma )
426
416
{
427
- typeof_member (struct proc_ops , proc_mmap ) mmap ;
428
-
429
- mmap = pde -> proc_ops -> proc_mmap ;
417
+ __auto_type mmap = pde -> proc_ops -> proc_mmap ;
430
418
if (mmap )
431
419
return mmap (file , vma );
432
420
return - EIO ;
@@ -483,7 +471,6 @@ static int proc_reg_open(struct inode *inode, struct file *file)
483
471
struct proc_dir_entry * pde = PDE (inode );
484
472
int rv = 0 ;
485
473
typeof_member (struct proc_ops , proc_open ) open ;
486
- typeof_member (struct proc_ops , proc_release ) release ;
487
474
struct pde_opener * pdeo ;
488
475
489
476
if (!pde -> proc_ops -> proc_lseek )
@@ -510,7 +497,7 @@ static int proc_reg_open(struct inode *inode, struct file *file)
510
497
if (!use_pde (pde ))
511
498
return - ENOENT ;
512
499
513
- release = pde -> proc_ops -> proc_release ;
500
+ __auto_type release = pde -> proc_ops -> proc_release ;
514
501
if (release ) {
515
502
pdeo = kmem_cache_alloc (pde_opener_cache , GFP_KERNEL );
516
503
if (!pdeo ) {
@@ -547,9 +534,7 @@ static int proc_reg_release(struct inode *inode, struct file *file)
547
534
struct pde_opener * pdeo ;
548
535
549
536
if (pde_is_permanent (pde )) {
550
- typeof_member (struct proc_ops , proc_release ) release ;
551
-
552
- release = pde -> proc_ops -> proc_release ;
537
+ __auto_type release = pde -> proc_ops -> proc_release ;
553
538
if (release ) {
554
539
return release (inode , file );
555
540
}
0 commit comments