Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rcutorture: style cleanup: avoid != NULL in boolean tests

Signed-off-by: Josh Triplett <josh@kernel.org>
Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Josh Triplett and committed by
Linus Torvalds
c8e5b163 788e770e

+14 -14
+14 -14
kernel/rcutorture.c
··· 534 534 rp->rtort_mbtest = 1; 535 535 rcu_assign_pointer(rcu_torture_current, rp); 536 536 smp_wmb(); 537 - if (old_rp != NULL) { 537 + if (old_rp) { 538 538 i = old_rp->rtort_pipe_count; 539 539 if (i > RCU_TORTURE_PIPE_LEN) 540 540 i = RCU_TORTURE_PIPE_LEN; ··· 685 685 atomic_read(&rcu_torture_wcount[i])); 686 686 } 687 687 cnt += sprintf(&page[cnt], "\n"); 688 - if (cur_ops->stats != NULL) 688 + if (cur_ops->stats) 689 689 cnt += cur_ops->stats(&page[cnt]); 690 690 return cnt; 691 691 } ··· 749 749 750 750 set_cpus_allowed(current, tmp_mask); 751 751 752 - if (reader_tasks != NULL) { 752 + if (reader_tasks) { 753 753 for (i = 0; i < nrealreaders; i++) 754 754 if (reader_tasks[i]) 755 755 set_cpus_allowed(reader_tasks[i], tmp_mask); 756 756 } 757 757 758 - if (fakewriter_tasks != NULL) { 758 + if (fakewriter_tasks) { 759 759 for (i = 0; i < nfakewriters; i++) 760 760 if (fakewriter_tasks[i]) 761 761 set_cpus_allowed(fakewriter_tasks[i], tmp_mask); ··· 808 808 int i; 809 809 810 810 fullstop = 1; 811 - if (shuffler_task != NULL) { 811 + if (shuffler_task) { 812 812 VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task"); 813 813 kthread_stop(shuffler_task); 814 814 } 815 815 shuffler_task = NULL; 816 816 817 - if (writer_task != NULL) { 817 + if (writer_task) { 818 818 VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task"); 819 819 kthread_stop(writer_task); 820 820 } 821 821 writer_task = NULL; 822 822 823 - if (reader_tasks != NULL) { 823 + if (reader_tasks) { 824 824 for (i = 0; i < nrealreaders; i++) { 825 - if (reader_tasks[i] != NULL) { 825 + if (reader_tasks[i]) { 826 826 VERBOSE_PRINTK_STRING( 827 827 "Stopping rcu_torture_reader task"); 828 828 kthread_stop(reader_tasks[i]); ··· 834 834 } 835 835 rcu_torture_current = NULL; 836 836 837 - if (fakewriter_tasks != NULL) { 837 + if (fakewriter_tasks) { 838 838 for (i = 0; i < nfakewriters; i++) { 839 - if (fakewriter_tasks[i] != NULL) { 839 + if (fakewriter_tasks[i]) { 840 840 VERBOSE_PRINTK_STRING( 841 841 "Stopping rcu_torture_fakewriter task"); 842 842 kthread_stop(fakewriter_tasks[i]); ··· 847 847 fakewriter_tasks = NULL; 848 848 } 849 849 850 - if (stats_task != NULL) { 850 + if (stats_task) { 851 851 VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task"); 852 852 kthread_stop(stats_task); 853 853 } ··· 858 858 859 859 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */ 860 860 861 - if (cur_ops->cleanup != NULL) 861 + if (cur_ops->cleanup) 862 862 cur_ops->cleanup(); 863 863 if (atomic_read(&n_rcu_torture_error)) 864 864 rcu_torture_print_module_parms("End of test: FAILURE"); ··· 875 875 876 876 /* Process args and tell the world that the torturer is on the job. */ 877 877 878 - for (i = 0; cur_ops = torture_ops[i], cur_ops != NULL; i++) { 878 + for (i = 0; cur_ops = torture_ops[i], cur_ops; i++) { 879 879 cur_ops = torture_ops[i]; 880 880 if (strcmp(torture_type, cur_ops->name) == 0) { 881 881 break; ··· 886 886 torture_type); 887 887 return (-EINVAL); 888 888 } 889 - if (cur_ops->init != NULL) 889 + if (cur_ops->init) 890 890 cur_ops->init(); /* no "goto unwind" prior to this point!!! */ 891 891 892 892 if (nreaders >= 0)