All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Srivatsa, Anusha" <anusha.srivatsa@intel.com>
To: "Wajdeczko, Michal" <Michal.Wajdeczko@intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/5] drm/i915/uc: Move intel_uc_fw_status_repr() to intel_uc.c
Date: Tue, 28 Mar 2017 16:21:30 +0000	[thread overview]
Message-ID: <83F5C7385F545743AD4FB2A62F75B073019A8073@ORSMSX108.amr.corp.intel.com> (raw)
In-Reply-To: <20170328125119.GD131976@mwajdecz-MOBL1.ger.corp.intel.com>



>-----Original Message-----
>From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of
>Michal Wajdeczko
>Sent: Tuesday, March 28, 2017 5:51 AM
>To: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>Cc: intel-gfx@lists.freedesktop.org
>Subject: Re: [Intel-gfx] [PATCH 1/5] drm/i915/uc: Move intel_uc_fw_status_repr()
>to intel_uc.c
>
>On Tue, Mar 28, 2017 at 10:27:28AM +0200, Michal Wajdeczko wrote:
>> On Tue, Mar 28, 2017 at 10:05:31AM +0300, Joonas Lahtinen wrote:
>> > On ma, 2017-03-27 at 17:19 +0000, Michal Wajdeczko wrote:
>> > > The file fits better. Also use "<invalid>" for invalid case.
>> > >
>> > > Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> > > Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
>> > > Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> >
>> > <SNIP>
>> >
>> > > @@ -26,6 +26,24 @@
>> > >  #include "intel_uc.h"
>> > >  #include <linux/firmware.h>
>> > >
>> > > +
>> > > +/* User-friendly representation of an enum */ const char
>> > > +*intel_uc_fw_status_repr(enum intel_uc_fw_status status)
>> >
>> > This could be static inline in the .h too.
>> >
>> > > +{
>> > > +	switch (status) {
>> > > +	case INTEL_UC_FIRMWARE_FAIL:
>> > > +		return "FAIL";
>> > > +	case INTEL_UC_FIRMWARE_NONE:
>> > > +		return "NONE";
>> > > +	case INTEL_UC_FIRMWARE_PENDING:
>> > > +		return "PENDING";
>> > > +	case INTEL_UC_FIRMWARE_SUCCESS:
>> > > +		return "SUCCESS";
>> > > +	default:
>> >
>> > Add MISSING_CASE(status); here.
>>
>> This will require another patch that will move definition of
>> MISSING_CASE macro from i915_drv.h to i915_utils.h as intel_uc.h is
>> included now ahead of MISSING_CASE definition... stay tuned ;)
>>
>
>There is also other option: we can drop "default" case and then rely on the
>compiler to complain at build time when we miss any enum.

But wont having a default option make it more readable and friendly? Just a thought.... I like it the way it is now.....

Anusha 
>-Michal
>
>_______________________________________________
>Intel-gfx mailing list
>Intel-gfx@lists.freedesktop.org
>https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

      reply	other threads:[~2017-03-28 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27 17:19 [PATCH 1/5] drm/i915/uc: Move intel_uc_fw_status_repr() to intel_uc.c Michal Wajdeczko
2017-03-28  7:05 ` Joonas Lahtinen
2017-03-28  8:27   ` Michal Wajdeczko
2017-03-28 12:51     ` Michal Wajdeczko
2017-03-28 16:21       ` Srivatsa, Anusha [this message]

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=83F5C7385F545743AD4FB2A62F75B073019A8073@ORSMSX108.amr.corp.intel.com \
    --to=anusha.srivatsa@intel.com \
    --cc=Michal.Wajdeczko@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=joonas.lahtinen@linux.intel.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.