naming conventions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Are there naming conventions that are preferred for functions?  I'm seeing
somethings named foo_free, free_foo, foo_init, init_foo, etc.

Consistency provides names that are easy to guess/learn.

examples from: linux/kernel/fork.c
####################################
static void free_thread_stack(struct task_struct *tsk)
{
        kmem_cache_free(thread_stack_cache, tsk->stack);                              
}

void thread_stack_cache_init(void)
{
        thread_stack_cache = kmem_cache_create("thread_stack", THREAD_SIZE,
                                              THREAD_SIZE, 0, NULL);                  
        BUG_ON(thread_stack_cache == NULL);                                           
}

if (init_new_context(p, mm))

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux