From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Thompson <daniel.thompson@linaro.org>,
Meghana Madhyastha <meghana.madhyastha@gmail.com>,
daniel@ffwll.ch, noralf@tronnes.org,
outreachy-kernel@googlegroups.com,
dri-devel@lists.freedesktop.org, Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH v7 1/3] backlight: Add IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
Date: Mon, 02 Oct 2017 12:00:54 +0300 [thread overview]
Message-ID: <87o9pp6i0p.fsf@intel.com> (raw)
In-Reply-To: <527a54b8-d67a-651c-3326-4780b9f3cfc4@linaro.org>
On Mon, 02 Oct 2017, Daniel Thompson <daniel.thompson@linaro.org> wrote:
> So I'm coming to this patchset cold but can you explain *why* something
> wants to call of_find_backlight_by_node() when there is no backlight
> support enabled. Why isn't the code that called is conditional on
> BACKLIGHT_CLASS_DEVICE?
>
> The undefined symbol issue is a pain but to be honest I'd rather solve
> the use of undefined symbols by avoiding declaring them; this making
> them into compile errors rather than link errors.
Typically the kernel header files define static inline stubs of the
functions when the actual functions aren't configured/built. The code
using the functions looks the same regardless of the config option, and
handles the -ENODEV or NULL or whatever returns from the stubs
gracefully. With the inlines, the compiler can usually throw out much of
the code anyway.
In this regard, the backlight interface is an exception, forcing the
callers to wrap the code around IS_ENABLED(BACKLIGHT_CLASS_DEVICE), not
the rule.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
WARNING: multiple messages have this Message-ID (diff)
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Daniel Thompson <daniel.thompson@linaro.org>,
Meghana Madhyastha <meghana.madhyastha@gmail.com>,
daniel@ffwll.ch, noralf@tronnes.org,
outreachy-kernel@googlegroups.com,
dri-devel@lists.freedesktop.org, Lee Jones <lee.jones@linaro.org>
Subject: Re: [PATCH v7 1/3] backlight: Add IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
Date: Mon, 02 Oct 2017 12:00:54 +0300 [thread overview]
Message-ID: <87o9pp6i0p.fsf@intel.com> (raw)
In-Reply-To: <527a54b8-d67a-651c-3326-4780b9f3cfc4@linaro.org>
On Mon, 02 Oct 2017, Daniel Thompson <daniel.thompson@linaro.org> wrote:
> So I'm coming to this patchset cold but can you explain *why* something
> wants to call of_find_backlight_by_node() when there is no backlight
> support enabled. Why isn't the code that called is conditional on
> BACKLIGHT_CLASS_DEVICE?
>
> The undefined symbol issue is a pain but to be honest I'd rather solve
> the use of undefined symbols by avoiding declaring them; this making
> them into compile errors rather than link errors.
Typically the kernel header files define static inline stubs of the
functions when the actual functions aren't configured/built. The code
using the functions looks the same regardless of the config option, and
handles the -ENODEV or NULL or whatever returns from the stubs
gracefully. With the inlines, the compiler can usually throw out much of
the code anyway.
In this regard, the backlight interface is an exception, forcing the
callers to wrap the code around IS_ENABLED(BACKLIGHT_CLASS_DEVICE), not
the rule.
BR,
Jani.
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2017-10-02 9:01 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-01 17:24 [PATCH v7 0/3] drm/tinydrm: drm_of_find_backlight helper Meghana Madhyastha
2017-10-01 17:24 ` Meghana Madhyastha
2017-10-01 17:26 ` [PATCH v7 1/3] backlight: Add IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE) Meghana Madhyastha
2017-10-01 17:26 ` Meghana Madhyastha
2017-10-02 5:58 ` Daniel Thompson
2017-10-02 5:58 ` Daniel Thompson
2017-10-02 5:59 ` Daniel Thompson
2017-10-02 5:59 ` Daniel Thompson
2017-10-02 8:49 ` Jani Nikula
2017-10-02 8:49 ` Jani Nikula
2017-10-02 9:36 ` Daniel Thompson
2017-10-02 9:36 ` Daniel Thompson
2017-10-02 9:46 ` Jani Nikula
2017-10-02 9:46 ` Jani Nikula
2017-10-02 9:00 ` Jani Nikula [this message]
2017-10-02 9:00 ` Jani Nikula
2017-10-03 8:03 ` Daniel Vetter
2017-10-03 8:03 ` Daniel Vetter
2017-10-03 8:51 ` Daniel Thompson
2017-10-03 8:51 ` Daniel Thompson
2017-10-03 9:04 ` Daniel Vetter
2017-10-03 9:04 ` Daniel Vetter
2017-10-06 18:01 ` Noralf Trønnes
2017-10-06 18:01 ` Noralf Trønnes
2017-10-09 9:06 ` Daniel Thompson
2017-10-09 9:06 ` Daniel Thompson
2017-10-09 15:35 ` Noralf Trønnes
2017-10-09 15:35 ` Noralf Trønnes
2017-10-01 17:28 ` [PATCH v7 2/3] drm/tinydrm: Move tinydrm_of_find_backlight into drm_of.c Meghana Madhyastha
2017-10-01 17:28 ` Meghana Madhyastha
2017-10-01 17:29 ` [PATCH v7 3/3] drm/tinydrm: Add devres versions of drm_of_find_backlight Meghana Madhyastha
2017-10-01 17:29 ` Meghana Madhyastha
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o9pp6i0p.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=daniel.thompson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=lee.jones@linaro.org \
--cc=meghana.madhyastha@gmail.com \
--cc=noralf@tronnes.org \
--cc=outreachy-kernel@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.