kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* coding style: "obj-y" versus "obj-$(CONFIG_FOO)"?
@ 2016-06-20 12:54 Robert P. J. Day
  0 siblings, 0 replies; only message in thread
From: Robert P. J. Day @ 2016-06-20 12:54 UTC (permalink / raw)
  To: kernelnewbies


  a bit more pedantry ... in init/Makefile, i see this test:

    ifneq ($(CONFIG_BLK_DEV_INITRD),y)
    obj-y                          += noinitramfs.o
    else
    obj-$(CONFIG_BLK_DEV_INITRD)   += initramfs.o
    endif

which is perfectly correct, but since BLK_DEV_INITRD is defined as a
boolean, it can be assigned only yes or no, so is there any reason
that second assignment wasn't written simply as:

    obj-y                          += initramfs.o

  sure, it's picky, but whenever i see Makefile content of the form:

    obj-$(CONFIG_FOO)

i take into account that that could be a tristate setting. if it
isn't, it just makes more sense aesthetically to me to use "obj-y" for
clarity.

  is there a coding style note about this sort of thing?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-06-20 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-20 12:54 coding style: "obj-y" versus "obj-$(CONFIG_FOO)"? Robert P. J. Day

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).