Files
linux/drivers/net/ethernet/intel/libie/adminq.c
Jacob Keller b7e32ae666 libie: fix string names for AQ error codes
The LIBIE_AQ_STR macro() introduced by commit 5feaa7a07b ("libie: add
adminq helper for converting err to str") is used in order to generate
strings for printing human readable error codes. Its definition is missing
the separating underscore ('_') character which makes the resulting strings
difficult to read. Additionally, the string won't match the source code,
preventing search tools from working properly.

Add the missing underscore character, fixing the error string names.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Fixes: 5feaa7a07b ("libie: add adminq helper for converting err to str")
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Link: https://patch.msgid.link/20250923205657.846759-1-anthony.l.nguyen@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-09-24 16:58:54 -07:00

53 lines
1.3 KiB
C

// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (C) 2025 Intel Corporation */
#include <linux/module.h>
#include <linux/net/intel/libie/adminq.h>
static const char * const libie_aq_str_arr[] = {
#define LIBIE_AQ_STR(x) \
[LIBIE_AQ_RC_##x] = "LIBIE_AQ_RC_" #x
LIBIE_AQ_STR(OK),
LIBIE_AQ_STR(EPERM),
LIBIE_AQ_STR(ENOENT),
LIBIE_AQ_STR(ESRCH),
LIBIE_AQ_STR(EIO),
LIBIE_AQ_STR(EAGAIN),
LIBIE_AQ_STR(ENOMEM),
LIBIE_AQ_STR(EACCES),
LIBIE_AQ_STR(EBUSY),
LIBIE_AQ_STR(EEXIST),
LIBIE_AQ_STR(EINVAL),
LIBIE_AQ_STR(ENOSPC),
LIBIE_AQ_STR(ENOSYS),
LIBIE_AQ_STR(EMODE),
LIBIE_AQ_STR(ENOSEC),
LIBIE_AQ_STR(EBADSIG),
LIBIE_AQ_STR(ESVN),
LIBIE_AQ_STR(EBADMAN),
LIBIE_AQ_STR(EBADBUF),
#undef LIBIE_AQ_STR
"LIBIE_AQ_RC_UNKNOWN",
};
#define __LIBIE_AQ_STR_NUM (ARRAY_SIZE(libie_aq_str_arr) - 1)
/**
* libie_aq_str - get error string based on aq error
* @err: admin queue error type
*
* Return: error string for passed error code
*/
const char *libie_aq_str(enum libie_aq_err err)
{
if (err >= ARRAY_SIZE(libie_aq_str_arr) ||
!libie_aq_str_arr[err])
err = __LIBIE_AQ_STR_NUM;
return libie_aq_str_arr[err];
}
EXPORT_SYMBOL_NS_GPL(libie_aq_str, "LIBIE_ADMINQ");
MODULE_DESCRIPTION("Intel(R) Ethernet common library - adminq helpers");
MODULE_LICENSE("GPL");