@@ -71,7 +71,7 @@ static DEFINE_SPINLOCK(hash_lock);
71
71
* SIGEV values. Here we put out an error if this assumption fails.
72
72
*/
73
73
#if SIGEV_THREAD_ID != (SIGEV_THREAD_ID & \
74
- ~(SIGEV_SIGNAL | SIGEV_NONE | SIGEV_THREAD ))
74
+ ~(SIGEV_SIGNAL | SIGEV_NONE | SIGEV_THREAD ))
75
75
#error "SIGEV_THREAD_ID must not share bit with other SIGEV values!"
76
76
#endif
77
77
@@ -252,7 +252,8 @@ static int posix_get_monotonic_coarse(clockid_t which_clock,
252
252
return 0 ;
253
253
}
254
254
255
- static int posix_get_coarse_res (const clockid_t which_clock , struct timespec * tp )
255
+ static int posix_get_coarse_res (const clockid_t which_clock ,
256
+ struct timespec * tp )
256
257
{
257
258
* tp = ktime_to_timespec (KTIME_LOW_RES );
258
259
return 0 ;
@@ -333,14 +334,16 @@ static __init int init_posix_timers(void)
333
334
posix_timers_register_clock (CLOCK_REALTIME , & clock_realtime );
334
335
posix_timers_register_clock (CLOCK_MONOTONIC , & clock_monotonic );
335
336
posix_timers_register_clock (CLOCK_MONOTONIC_RAW , & clock_monotonic_raw );
336
- posix_timers_register_clock (CLOCK_REALTIME_COARSE , & clock_realtime_coarse );
337
- posix_timers_register_clock (CLOCK_MONOTONIC_COARSE , & clock_monotonic_coarse );
337
+ posix_timers_register_clock (CLOCK_REALTIME_COARSE ,
338
+ & clock_realtime_coarse );
339
+ posix_timers_register_clock (CLOCK_MONOTONIC_COARSE ,
340
+ & clock_monotonic_coarse );
338
341
posix_timers_register_clock (CLOCK_BOOTTIME , & clock_boottime );
339
342
posix_timers_register_clock (CLOCK_TAI , & clock_tai );
340
343
341
344
posix_timers_cache = kmem_cache_create ("posix_timers_cache" ,
342
- sizeof (struct k_itimer ), 0 , SLAB_PANIC ,
343
- NULL );
345
+ sizeof (struct k_itimer ), 0 ,
346
+ SLAB_PANIC , NULL );
344
347
return 0 ;
345
348
}
346
349
@@ -494,11 +497,11 @@ static enum hrtimer_restart posix_timer_fn(struct hrtimer *timer)
494
497
return ret ;
495
498
}
496
499
497
- static struct pid * good_sigevent (sigevent_t * event )
500
+ static struct pid * good_sigevent (sigevent_t * event )
498
501
{
499
502
struct task_struct * rtn = current -> group_leader ;
500
503
501
- if ((event -> sigev_notify & SIGEV_THREAD_ID ) &&
504
+ if ((event -> sigev_notify & SIGEV_THREAD_ID ) &&
502
505
(!(rtn = find_task_by_vpid (event -> sigev_notify_thread_id )) ||
503
506
!same_thread_group (rtn , current ) ||
504
507
(event -> sigev_notify & ~SIGEV_THREAD_ID ) != SIGEV_SIGNAL ))
@@ -515,18 +518,18 @@ void posix_timers_register_clock(const clockid_t clock_id,
515
518
struct k_clock * new_clock )
516
519
{
517
520
if ((unsigned ) clock_id >= MAX_CLOCKS ) {
518
- printk ( KERN_WARNING "POSIX clock register failed for clock_id %d\n" ,
521
+ pr_warn ( "POSIX clock register failed for clock_id %d\n" ,
519
522
clock_id );
520
523
return ;
521
524
}
522
525
523
526
if (!new_clock -> clock_get ) {
524
- printk ( KERN_WARNING "POSIX clock id %d lacks clock_get()\n" ,
527
+ pr_warn ( "POSIX clock id %d lacks clock_get()\n" ,
525
528
clock_id );
526
529
return ;
527
530
}
528
531
if (!new_clock -> clock_getres ) {
529
- printk ( KERN_WARNING "POSIX clock id %d lacks clock_getres()\n" ,
532
+ pr_warn ( "POSIX clock id %d lacks clock_getres()\n" ,
530
533
clock_id );
531
534
return ;
532
535
}
@@ -535,7 +538,7 @@ void posix_timers_register_clock(const clockid_t clock_id,
535
538
}
536
539
EXPORT_SYMBOL_GPL (posix_timers_register_clock );
537
540
538
- static struct k_itimer * alloc_posix_timer (void )
541
+ static struct k_itimer * alloc_posix_timer (void )
539
542
{
540
543
struct k_itimer * tmr ;
541
544
tmr = kmem_cache_zalloc (posix_timers_cache , GFP_KERNEL );
@@ -622,7 +625,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
622
625
new_timer -> it_overrun = -1 ;
623
626
624
627
if (timer_event_spec ) {
625
- if (copy_from_user (& event , timer_event_spec , sizeof (event ))) {
628
+ if (copy_from_user (& event , timer_event_spec , sizeof (event ))) {
626
629
error = - EFAULT ;
627
630
goto out ;
628
631
}
@@ -647,7 +650,7 @@ SYSCALL_DEFINE3(timer_create, const clockid_t, which_clock,
647
650
new_timer -> sigq -> info .si_code = SI_TIMER ;
648
651
649
652
if (copy_to_user (created_timer_id ,
650
- & new_timer_id , sizeof (new_timer_id ))) {
653
+ & new_timer_id , sizeof (new_timer_id ))) {
651
654
error = - EFAULT ;
652
655
goto out ;
653
656
}
@@ -748,7 +751,8 @@ common_timer_get(struct k_itimer *timr, struct itimerspec *cur_setting)
748
751
*/
749
752
if (iv .tv64 && (timr -> it_requeue_pending & REQUEUE_PENDING ||
750
753
(timr -> it_sigev_notify & ~SIGEV_THREAD_ID ) == SIGEV_NONE ))
751
- timr -> it_overrun += (unsigned int ) hrtimer_forward (timer , now , iv );
754
+ timr -> it_overrun += (unsigned int ) hrtimer_forward (timer , now ,
755
+ iv );
752
756
753
757
remaining = ktime_sub (hrtimer_get_expires (timer ), now );
754
758
/* Return 0 only, when the timer is expired and not pending */
@@ -785,7 +789,7 @@ SYSCALL_DEFINE2(timer_gettime, timer_t, timer_id,
785
789
786
790
unlock_timer (timr , flags );
787
791
788
- if (!ret && copy_to_user (setting , & cur_setting , sizeof (cur_setting )))
792
+ if (!ret && copy_to_user (setting , & cur_setting , sizeof (cur_setting )))
789
793
return - EFAULT ;
790
794
791
795
return ret ;
@@ -837,7 +841,7 @@ common_timer_set(struct k_itimer *timr, int flags,
837
841
if (hrtimer_try_to_cancel (timer ) < 0 )
838
842
return TIMER_RETRY ;
839
843
840
- timr -> it_requeue_pending = (timr -> it_requeue_pending + 2 ) &
844
+ timr -> it_requeue_pending = (timr -> it_requeue_pending + 2 ) &
841
845
~REQUEUE_PENDING ;
842
846
timr -> it_overrun_last = 0 ;
843
847
@@ -857,9 +861,8 @@ common_timer_set(struct k_itimer *timr, int flags,
857
861
/* SIGEV_NONE timers are not queued ! See common_timer_get */
858
862
if (((timr -> it_sigev_notify & ~SIGEV_THREAD_ID ) == SIGEV_NONE )) {
859
863
/* Setup correct expiry time for relative timers */
860
- if (mode == HRTIMER_MODE_REL ) {
864
+ if (mode == HRTIMER_MODE_REL )
861
865
hrtimer_add_expires (timer , timer -> base -> get_time ());
862
- }
863
866
return 0 ;
864
867
}
865
868
@@ -882,7 +885,7 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
882
885
if (!new_setting )
883
886
return - EINVAL ;
884
887
885
- if (copy_from_user (& new_spec , new_setting , sizeof (new_spec )))
888
+ if (copy_from_user (& new_spec , new_setting , sizeof (new_spec )))
886
889
return - EFAULT ;
887
890
888
891
if (!timespec_valid (& new_spec .it_interval ) ||
@@ -901,12 +904,12 @@ SYSCALL_DEFINE4(timer_settime, timer_t, timer_id, int, flags,
901
904
902
905
unlock_timer (timr , flag );
903
906
if (error == TIMER_RETRY ) {
904
- rtn = NULL ; // We already got the old time...
907
+ rtn = NULL ; /* We already got the old time... */
905
908
goto retry ;
906
909
}
907
910
908
911
if (old_setting && !error &&
909
- copy_to_user (old_setting , & old_spec , sizeof (old_spec )))
912
+ copy_to_user (old_setting , & old_spec , sizeof (old_spec )))
910
913
error = - EFAULT ;
911
914
912
915
return error ;
@@ -1008,14 +1011,14 @@ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock,
1008
1011
if (!kc || !kc -> clock_set )
1009
1012
return - EINVAL ;
1010
1013
1011
- if (copy_from_user (& new_tp , tp , sizeof (* tp )))
1014
+ if (copy_from_user (& new_tp , tp , sizeof (* tp )))
1012
1015
return - EFAULT ;
1013
1016
1014
1017
return kc -> clock_set (which_clock , & new_tp );
1015
1018
}
1016
1019
1017
1020
SYSCALL_DEFINE2 (clock_gettime , const clockid_t , which_clock ,
1018
- struct timespec __user * ,tp )
1021
+ struct timespec __user * , tp )
1019
1022
{
1020
1023
struct k_clock * kc = clockid_to_kclock (which_clock );
1021
1024
struct timespec kernel_tp ;
@@ -1026,7 +1029,7 @@ SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock,
1026
1029
1027
1030
error = kc -> clock_get (which_clock , & kernel_tp );
1028
1031
1029
- if (!error && copy_to_user (tp , & kernel_tp , sizeof (kernel_tp )))
1032
+ if (!error && copy_to_user (tp , & kernel_tp , sizeof (kernel_tp )))
1030
1033
error = - EFAULT ;
1031
1034
1032
1035
return error ;
@@ -1067,7 +1070,7 @@ SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock,
1067
1070
1068
1071
error = kc -> clock_getres (which_clock , & rtn_tp );
1069
1072
1070
- if (!error && tp && copy_to_user (tp , & rtn_tp , sizeof (rtn_tp )))
1073
+ if (!error && tp && copy_to_user (tp , & rtn_tp , sizeof (rtn_tp )))
1071
1074
error = - EFAULT ;
1072
1075
1073
1076
return error ;
@@ -1096,7 +1099,7 @@ SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags,
1096
1099
if (!kc -> nsleep )
1097
1100
return - ENANOSLEEP_NOTSUP ;
1098
1101
1099
- if (copy_from_user (& t , rqtp , sizeof (struct timespec )))
1102
+ if (copy_from_user (& t , rqtp , sizeof (struct timespec )))
1100
1103
return - EFAULT ;
1101
1104
1102
1105
if (!timespec_valid (& t ))
0 commit comments