aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJosh Triplett <josh@kernel.org>2007-05-08 03:33:20 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:17 -0400
commitc8e5b163101c5d716f08e90b686da620baa022f1 (patch)
treea159b2452edd86187663fc603139ceb9b9f58d61 /kernel
parent788e770eb2d17212eafaeedde0be56e3444c6b9a (diff)
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/rcutorture.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/kernel/rcutorture.c b/kernel/rcutorture.c
index 7d20d764b847..17cba7a6b224 100644
--- a/kernel/rcutorture.c
+++ b/kernel/rcutorture.c
@@ -534,7 +534,7 @@ rcu_torture_writer(void *arg)
534 rp->rtort_mbtest = 1; 534 rp->rtort_mbtest = 1;
535 rcu_assign_pointer(rcu_torture_current, rp); 535 rcu_assign_pointer(rcu_torture_current, rp);
536 smp_wmb(); 536 smp_wmb();
537 if (old_rp != NULL) { 537 if (old_rp) {
538 i = old_rp->rtort_pipe_count; 538 i = old_rp->rtort_pipe_count;
539 if (i > RCU_TORTURE_PIPE_LEN) 539 if (i > RCU_TORTURE_PIPE_LEN)
540 i = RCU_TORTURE_PIPE_LEN; 540 i = RCU_TORTURE_PIPE_LEN;
@@ -685,7 +685,7 @@ rcu_torture_printk(char *page)
685 atomic_read(&rcu_torture_wcount[i])); 685 atomic_read(&rcu_torture_wcount[i]));
686 } 686 }
687 cnt += sprintf(&page[cnt], "\n"); 687 cnt += sprintf(&page[cnt], "\n");
688 if (cur_ops->stats != NULL) 688 if (cur_ops->stats)
689 cnt += cur_ops->stats(&page[cnt]); 689 cnt += cur_ops->stats(&page[cnt]);
690 return cnt; 690 return cnt;
691} 691}
@@ -749,13 +749,13 @@ static void rcu_torture_shuffle_tasks(void)
749 749
750 set_cpus_allowed(current, tmp_mask); 750 set_cpus_allowed(current, tmp_mask);
751 751
752 if (reader_tasks != NULL) { 752 if (reader_tasks) {
753 for (i = 0; i < nrealreaders; i++) 753 for (i = 0; i < nrealreaders; i++)
754 if (reader_tasks[i]) 754 if (reader_tasks[i])
755 set_cpus_allowed(reader_tasks[i], tmp_mask); 755 set_cpus_allowed(reader_tasks[i], tmp_mask);
756 } 756 }
757 757
758 if (fakewriter_tasks != NULL) { 758 if (fakewriter_tasks) {
759 for (i = 0; i < nfakewriters; i++) 759 for (i = 0; i < nfakewriters; i++)
760 if (fakewriter_tasks[i]) 760 if (fakewriter_tasks[i])
761 set_cpus_allowed(fakewriter_tasks[i], tmp_mask); 761 set_cpus_allowed(fakewriter_tasks[i], tmp_mask);
@@ -808,21 +808,21 @@ rcu_torture_cleanup(void)
808 int i; 808 int i;
809 809
810 fullstop = 1; 810 fullstop = 1;
811 if (shuffler_task != NULL) { 811 if (shuffler_task) {
812 VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task"); 812 VERBOSE_PRINTK_STRING("Stopping rcu_torture_shuffle task");
813 kthread_stop(shuffler_task); 813 kthread_stop(shuffler_task);
814 } 814 }
815 shuffler_task = NULL; 815 shuffler_task = NULL;
816 816
817 if (writer_task != NULL) { 817 if (writer_task) {
818 VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task"); 818 VERBOSE_PRINTK_STRING("Stopping rcu_torture_writer task");
819 kthread_stop(writer_task); 819 kthread_stop(writer_task);
820 } 820 }
821 writer_task = NULL; 821 writer_task = NULL;
822 822
823 if (reader_tasks != NULL) { 823 if (reader_tasks) {
824 for (i = 0; i < nrealreaders; i++) { 824 for (i = 0; i < nrealreaders; i++) {
825 if (reader_tasks[i] != NULL) { 825 if (reader_tasks[i]) {
826 VERBOSE_PRINTK_STRING( 826 VERBOSE_PRINTK_STRING(
827 "Stopping rcu_torture_reader task"); 827 "Stopping rcu_torture_reader task");
828 kthread_stop(reader_tasks[i]); 828 kthread_stop(reader_tasks[i]);
@@ -834,9 +834,9 @@ rcu_torture_cleanup(void)
834 } 834 }
835 rcu_torture_current = NULL; 835 rcu_torture_current = NULL;
836 836
837 if (fakewriter_tasks != NULL) { 837 if (fakewriter_tasks) {
838 for (i = 0; i < nfakewriters; i++) { 838 for (i = 0; i < nfakewriters; i++) {
839 if (fakewriter_tasks[i] != NULL) { 839 if (fakewriter_tasks[i]) {
840 VERBOSE_PRINTK_STRING( 840 VERBOSE_PRINTK_STRING(
841 "Stopping rcu_torture_fakewriter task"); 841 "Stopping rcu_torture_fakewriter task");
842 kthread_stop(fakewriter_tasks[i]); 842 kthread_stop(fakewriter_tasks[i]);
@@ -847,7 +847,7 @@ rcu_torture_cleanup(void)
847 fakewriter_tasks = NULL; 847 fakewriter_tasks = NULL;
848 } 848 }
849 849
850 if (stats_task != NULL) { 850 if (stats_task) {
851 VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task"); 851 VERBOSE_PRINTK_STRING("Stopping rcu_torture_stats task");
852 kthread_stop(stats_task); 852 kthread_stop(stats_task);
853 } 853 }
@@ -858,7 +858,7 @@ rcu_torture_cleanup(void)
858 858
859 rcu_torture_stats_print(); /* -After- the stats thread is stopped! */ 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 cur_ops->cleanup(); 862 cur_ops->cleanup();
863 if (atomic_read(&n_rcu_torture_error)) 863 if (atomic_read(&n_rcu_torture_error))
864 rcu_torture_print_module_parms("End of test: FAILURE"); 864 rcu_torture_print_module_parms("End of test: FAILURE");
@@ -875,7 +875,7 @@ rcu_torture_init(void)
875 875
876 /* Process args and tell the world that the torturer is on the job. */ 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 cur_ops = torture_ops[i]; 879 cur_ops = torture_ops[i];
880 if (strcmp(torture_type, cur_ops->name) == 0) { 880 if (strcmp(torture_type, cur_ops->name) == 0) {
881 break; 881 break;
@@ -886,7 +886,7 @@ rcu_torture_init(void)
886 torture_type); 886 torture_type);
887 return (-EINVAL); 887 return (-EINVAL);
888 } 888 }
889 if (cur_ops->init != NULL) 889 if (cur_ops->init)
890 cur_ops->init(); /* no "goto unwind" prior to this point!!! */ 890 cur_ops->init(); /* no "goto unwind" prior to this point!!! */
891 891
892 if (nreaders >= 0) 892 if (nreaders >= 0)