From: Jani Nikula <jani.nikula@linux.intel.com>
To: Damien Lespiau <damien.lespiau@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Make intel_dsi_init() return void
Date: Tue, 03 Jun 2014 15:05:14 +0300 [thread overview]
Message-ID: <87zjhufbb9.fsf@intel.com> (raw)
In-Reply-To: <1401276656-28377-1-git-send-email-damien.lespiau@intel.com>
On Wed, 28 May 2014, Damien Lespiau <damien.lespiau@intel.com> wrote:
> Functions that can't fail are such a bliss to work with, it'd be shame
> to miss the occasion. The "failure" mode is the DSI connector not being
> created, the rest of the initialization can carry on happily.
>
> We weren't even checking that value anyway.
>
> Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Suggested-by: Shobhit Kumar <shobhit.kumar@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Shobhit Kumar <shobhit.kumar@intel.com>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
> drivers/gpu/drm/i915/intel_drv.h | 2 +-
> drivers/gpu/drm/i915/intel_dsi.c | 12 ++++++------
> 2 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index edecf89..62686b2 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -831,7 +831,7 @@ void intel_edp_psr_update(struct drm_device *dev);
> void intel_dp_set_drrs_state(struct drm_device *dev, int refresh_rate);
>
> /* intel_dsi.c */
> -bool intel_dsi_init(struct drm_device *dev);
> +void intel_dsi_init(struct drm_device *dev);
>
>
> /* intel_dvo.c */
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index e73bec6..4dbd160 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -646,7 +646,7 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
> .fill_modes = drm_helper_probe_single_connector_modes,
> };
>
> -bool intel_dsi_init(struct drm_device *dev)
> +void intel_dsi_init(struct drm_device *dev)
> {
> struct intel_dsi *intel_dsi;
> struct intel_encoder *intel_encoder;
> @@ -662,12 +662,12 @@ bool intel_dsi_init(struct drm_device *dev)
>
> intel_dsi = kzalloc(sizeof(*intel_dsi), GFP_KERNEL);
> if (!intel_dsi)
> - return false;
> + return;
>
> intel_connector = kzalloc(sizeof(*intel_connector), GFP_KERNEL);
> if (!intel_connector) {
> kfree(intel_dsi);
> - return false;
> + return;
> }
>
> intel_encoder = &intel_dsi->base;
> @@ -678,7 +678,7 @@ bool intel_dsi_init(struct drm_device *dev)
> dev_priv->mipi_mmio_base = VLV_MIPI_BASE;
> } else {
> DRM_ERROR("Unsupported Mipi device to reg base");
> - return false;
> + return;
> }
>
> connector = &intel_connector->base;
> @@ -738,12 +738,12 @@ bool intel_dsi_init(struct drm_device *dev)
> fixed_mode->type |= DRM_MODE_TYPE_PREFERRED;
> intel_panel_init(&intel_connector->panel, fixed_mode, NULL);
>
> - return true;
> + return;
>
> err:
> drm_encoder_cleanup(&intel_encoder->base);
> kfree(intel_dsi);
> kfree(intel_connector);
>
> - return false;
> + return;
Okay this went in already, but I find return statements at the end of
void functions like that a bit silly...
...but hey, you can send a fix removing that! ;)
BR,
Jani.
> }
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2014-06-03 12:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-28 11:30 [PATCH] drm/i915: Make intel_dsi_init() return void Damien Lespiau
2014-05-28 13:00 ` Daniel Vetter
2014-06-03 12:05 ` Jani Nikula [this message]
2014-06-03 12:50 ` Damien Lespiau
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=87zjhufbb9.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=damien.lespiau@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
/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.