public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Tomas Winkler <tomas.winkler@intel.com>
Cc: Alexander Usyskin <alexander.usyskin@intel.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [char-misc-next 3/3] mei: me: use an index instead of a pointer for private data
Date: Tue, 13 Jun 2017 15:46:07 +0200	[thread overview]
Message-ID: <20170613134607.GA5042@kroah.com> (raw)
In-Reply-To: <20170612091557.30287-3-tomas.winkler@intel.com>

On Mon, Jun 12, 2017 at 12:15:57PM +0300, Tomas Winkler wrote:
> +static const struct mei_cfg *const mei_cfg_list[] = {
> +	NULL,
> +	&mei_me_legacy_cfg,
> +	&mei_me_ich_cfg,
> +	&mei_me_pch_cfg,
> +	&mei_me_pch_cpt_pbg_cfg,
> +	&mei_me_pch8_cfg,
> +	&mei_me_pch8_sps_cfg,
> +};

Does this structure have to keep in sync with:

> +enum mei_cfg_idx {
> +	MEI_ME_UNDEF_CFG,
> +	MEI_ME_LEGACY_CFG,
> +	MEI_ME_ICH_CFG,
> +	MEI_ME_PCH_CFG,
> +	MEI_ME_PCH_CPT_PBG_CFG,
> +	MEI_ME_PCH8_CFG,
> +	MEI_ME_PCH8_SPS_CFG,
> +	MEI_ME_NUM_CFG,
> +};

That value?

If so, why not make it automatic and have the array use the enum values?
That way you know you get it right.

At the very least, document the heck out of this...

thanks,

greg k-h

  reply	other threads:[~2017-06-13 13:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12  9:15 [char-misc-next 1/3] mei: validate the message header only in first fragment Tomas Winkler
2017-06-12  9:15 ` [char-misc-next 2/3] mei: drop unreachable code in mei_start Tomas Winkler
2017-06-12  9:15 ` [char-misc-next 3/3] mei: me: use an index instead of a pointer for private data Tomas Winkler
2017-06-13 13:46   ` Greg Kroah-Hartman [this message]
2017-06-13 14:33     ` Winkler, Tomas

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=20170613134607.GA5042@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.usyskin@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomas.winkler@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox