All of lore.kernel.org
 help / color / mirror / Atom feed
* naming conventions
@ 2016-08-26 18:53 Brad Bishop
  2016-08-26 19:18 ` Kenneth Wilke
  0 siblings, 1 reply; 3+ messages in thread
From: Brad Bishop @ 2016-08-26 18:53 UTC (permalink / raw)
  To: OpenBMC Patches

I wanted to take a stab at standardizing our naming conventions a little better.

In general, applications would be (loosely) named after the layer they are associated with.  For example:

phosphor-foo: application that can run on any card running OpenBMC
op-foo: application that can only run on OpenPOWER systems
ibm-foo: application that can only run on IBM systems
palmetto-foo: application specific to the Palmetto system

I chose phosphor-foo rather than obmc-foo to draw attention to the fact that ‘Phosphor’ refers to a reference implementation/distribution (ideally) of OpenBMC (similar to Poky/OpenEmbedded).

When naming things or filling out description fields in recipes, etc, please avoid the overly redundant name or description: obmc-phosphor or “Phosphor OpenBMC”.  Given that Phosphor is the reference for OpenBMC you can just say “Phosphor."

thoughts/feedback?

-brad

^ permalink raw reply	[flat|nested] 3+ messages in thread
* naming conventions
@ 2017-07-23  3:29 John de la Garza
  0 siblings, 0 replies; 3+ messages in thread
From: John de la Garza @ 2017-07-23  3:29 UTC (permalink / raw)
  To: kernelnewbies

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))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-07-23  3:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-26 18:53 naming conventions Brad Bishop
2016-08-26 19:18 ` Kenneth Wilke
  -- strict thread matches above, loose matches on Subject: below --
2017-07-23  3:29 John de la Garza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.