From: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
To: intel-wired-lan@lists.osuosl.org
Cc: apw@canonical.com, joe@perches.com, dwaipayanray1@gmail.com,
lukas.bulwahn@gmail.com, akpm@linux-foundation.org,
willemb@google.com, edumazet@google.com,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
Przemek Kitszel <przemyslaw.kitszel@intel.com>,
Wojciech Drewek <wojciech.drewek@intel.com>,
Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Subject: [Intel-wired-lan] [PATCH iwl-next v1 2/6] devlink: add devlink_fmsg_put() macro
Date: Wed, 3 Jul 2024 08:59:18 -0400 [thread overview]
Message-ID: <20240703125922.5625-3-mateusz.polchlopek@intel.com> (raw)
In-Reply-To: <20240703125922.5625-1-mateusz.polchlopek@intel.com>
From: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Add devlink_fmsg_put() that dispatches based on the type
of the value to put, example: bool -> devlink_fmsg_bool_pair_put().
Signed-off-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Wojciech Drewek <wojciech.drewek@intel.com>
Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
---
include/net/devlink.h | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/include/net/devlink.h b/include/net/devlink.h
index db5eff6cb60f..85739bb731c1 100644
--- a/include/net/devlink.h
+++ b/include/net/devlink.h
@@ -1261,6 +1261,17 @@ enum devlink_trap_group_generic_id {
.min_burst = _min_burst, \
}
+#define devlink_fmsg_put(fmsg, name, value) ( \
+ _Generic((value), \
+ bool : devlink_fmsg_bool_pair_put, \
+ u8 : devlink_fmsg_u8_pair_put, \
+ u16 : devlink_fmsg_u32_pair_put, \
+ u32 : devlink_fmsg_u32_pair_put, \
+ u64 : devlink_fmsg_u64_pair_put, \
+ char * : devlink_fmsg_string_pair_put, \
+ const char * : devlink_fmsg_string_pair_put) \
+ (fmsg, name, (value)))
+
enum {
/* device supports reload operations */
DEVLINK_F_RELOAD = 1UL << 0,
--
2.38.1
next prev parent reply other threads:[~2024-07-03 13:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-03 12:59 [Intel-wired-lan] [PATCH iwl-next v1 0/6] Add support for devlink health events Mateusz Polchlopek
2024-07-03 12:59 ` [Intel-wired-lan] [PATCH iwl-next v1 1/6] checkpatch: don't complain on _Generic() use Mateusz Polchlopek
2024-07-08 12:41 ` Simon Horman
2024-07-03 12:59 ` Mateusz Polchlopek [this message]
2024-07-08 12:41 ` [Intel-wired-lan] [PATCH iwl-next v1 2/6] devlink: add devlink_fmsg_put() macro Simon Horman
2024-07-03 12:59 ` [Intel-wired-lan] [PATCH iwl-next v1 3/6] ice: add Tx hang devlink health reporter Mateusz Polchlopek
2024-07-05 0:23 ` kernel test robot
2024-07-08 12:40 ` Simon Horman
2024-07-10 13:59 ` Przemek Kitszel
2024-07-03 12:59 ` [Intel-wired-lan] [PATCH iwl-next v1 4/6] ice: print ethtool stats as part of " Mateusz Polchlopek
2024-07-08 12:41 ` Simon Horman
2024-07-03 12:59 ` [Intel-wired-lan] [PATCH iwl-next v1 5/6] ice: Add MDD logging via devlink health Mateusz Polchlopek
2024-07-08 12:42 ` Simon Horman
2024-07-03 12:59 ` [Intel-wired-lan] [PATCH iwl-next v1 6/6] ice: devlink health: dump also skb on Tx hang Mateusz Polchlopek
2024-07-08 12:42 ` Simon Horman
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=20240703125922.5625-3-mateusz.polchlopek@intel.com \
--to=mateusz.polchlopek@intel.com \
--cc=akpm@linux-foundation.org \
--cc=apw@canonical.com \
--cc=dwaipayanray1@gmail.com \
--cc=edumazet@google.com \
--cc=intel-wired-lan@lists.osuosl.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lukas.bulwahn@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=przemyslaw.kitszel@intel.com \
--cc=willemb@google.com \
--cc=wojciech.drewek@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
all inboxes | Powered by JetHome®