All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Grumbach, Emmanuel" <emmanuel.grumbach@intel.com>
To: Kalle Valo <kvalo@codeaurora.org>,
	Emmanuel Grumbach <egrumbach@gmail.com>
Cc: "Coelho, Luciano" <luciano.coelho@intel.com>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	"Beker, Ayala" <ayala.beker@intel.com>
Subject: RE: [PATCH v3 1/4] iwlwifi: mei: add the driver to allow cooperation with CSME
Date: Sat, 7 Aug 2021 18:38:00 +0000	[thread overview]
Message-ID: <SA0PR11MB4752B06F7330E6C14717E113F2F49@SA0PR11MB4752.namprd11.prod.outlook.com> (raw)
In-Reply-To: <87k0l0c8pa.fsf@codeaurora.org>

> 
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_OPEN !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_OPEN);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_RSNA !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_RSNA);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_RSNA_PSK !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_RSNA_PSK);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_AKM_AUTH_SAE !=
> >> > +                  (u32)SAP_WIFI_AUTH_TYPE_SAE);
> >> > +
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_NONE !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_NONE);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_CCMP !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_CCMP);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_GCMP !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_GCMP);
> >> > +     BUILD_BUG_ON((u32)IWL_MEI_CIPHER_GCMP_256 !=
> >> > +                  (u32)SAP_WIFI_CIPHER_ALG_GCMP_256);
> >>
> >> These look just weird, and suspicious. You are using two different
> >> enums but they have to be same values, or what?
> >
> > Exactly. I don't want the userspace to have to include all the SAP
> > protocol header file. OTOH, I don't want to have to translate between
> > vendor commands attributes values and the SAP values.
> 
> Why not? I assume you would just need a helper function with switch
> statements to "translate" between enums, not much more lines of code but
> a lot cleaner code.
> 

I disagree that it'll give us a cleaner code.
What we'll have is two different enums with two different values and functions
that translate from one value to another. This is very bug prone. When you want
to debug, you get a value, you always need to think of what type of enum you're
dealing with.
I believe your suggestion is not good, but since I am tired arguing I will do it to
make you happy.

  reply	other threads:[~2021-08-07 18:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-23 14:10 [PATCH v3 1/4] iwlwifi: mei: add the driver to allow cooperation with CSME Emmanuel Grumbach
2021-06-23 14:10 ` [PATCH v3 2/4] iwlwifi: integrate with iwlmei Emmanuel Grumbach
2021-06-23 19:49   ` kernel test robot
2021-06-23 19:49   ` [PATCH] iwlwifi: fix semicolon.cocci warnings kernel test robot
2021-06-23 14:10 ` [PATCH v3 3/4] nl80211: vendor-cmd: add Intel vendor commands for iwlmei usage Emmanuel Grumbach
2021-06-24 12:45   ` Johannes Berg
2021-06-24 12:51     ` Emmanuel Grumbach
2021-06-24 17:07   ` Kalle Valo
2021-06-24 19:56     ` Emmanuel Grumbach
2021-08-05 13:25       ` Kalle Valo
2021-08-07 18:32         ` Grumbach, Emmanuel
2021-10-18 11:25           ` Kalle Valo
2021-06-23 14:10 ` [PATCH v3 4/4] iwlwifi: mvm: add vendor commands needed for iwlmei Emmanuel Grumbach
2021-06-24 17:08   ` Kalle Valo
2021-06-24 19:59     ` Emmanuel Grumbach
2021-08-05 13:35       ` Kalle Valo
2021-08-07 18:34         ` Grumbach, Emmanuel
2021-10-18 11:27           ` Kalle Valo
2021-06-24 17:16 ` [PATCH v3 1/4] iwlwifi: mei: add the driver to allow cooperation with CSME Kalle Valo
2021-06-24 20:04   ` Emmanuel Grumbach
2021-08-05 13:38     ` Kalle Valo
2021-08-07 18:38       ` Grumbach, Emmanuel [this message]
2021-08-09  7:49         ` Arend van Spriel
2021-08-09 19:25           ` Grumbach, Emmanuel

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=SA0PR11MB4752B06F7330E6C14717E113F2F49@SA0PR11MB4752.namprd11.prod.outlook.com \
    --to=emmanuel.grumbach@intel.com \
    --cc=ayala.beker@intel.com \
    --cc=egrumbach@gmail.com \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=luciano.coelho@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.