From: Oded Gabbay <ogabbay@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: kernel test robot <lkp@intel.com>
Subject: [PATCH 8/8] habanalabs: move common function out of debugfs.c
Date: Sun, 31 Jul 2022 13:50:37 +0300 [thread overview]
Message-ID: <20220731105037.545106-8-ogabbay@kernel.org> (raw)
In-Reply-To: <20220731105037.545106-1-ogabbay@kernel.org>
A common function that is called from multiple places can't be
located in degugfs.c because that file is only compiled if
debugfs is enabled in the kernel config file.
This can lead to undefined symbol compilation error.
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
---
drivers/misc/habanalabs/common/debugfs.c | 25 ------------------------
drivers/misc/habanalabs/common/device.c | 24 +++++++++++++++++++++++
2 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/drivers/misc/habanalabs/common/debugfs.c b/drivers/misc/habanalabs/common/debugfs.c
index c297248748d3..69fd3ed7680a 100644
--- a/drivers/misc/habanalabs/common/debugfs.c
+++ b/drivers/misc/habanalabs/common/debugfs.c
@@ -586,31 +586,6 @@ static ssize_t mmu_ack_error_value_write(struct file *file,
return -EINVAL;
}
-void hl_engine_data_sprintf(struct engines_data *e, const char *fmt, ...)
-{
- va_list args;
- int str_size;
-
- va_start(args, fmt);
- /* Calculate formatted string length. Assuming each string is null terminated, hence
- * increment result by 1
- */
- str_size = vsnprintf(NULL, 0, fmt, args) + 1;
- va_end(args);
-
- if ((e->actual_size + str_size) < e->allocated_buf_size) {
- va_start(args, fmt);
- vsnprintf(e->buf + e->actual_size, str_size, fmt, args);
- va_end(args);
- }
-
- /* Need to update the size even when not updating destination buffer to get the exact size
- * of all input strings
- */
- e->actual_size += str_size;
-
-}
-
static int engines_show(struct seq_file *s, void *data)
{
struct hl_debugfs_entry *entry = s->private;
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 6a98aae90f49..ab2497b6d164 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -267,6 +267,30 @@ int hl_access_dev_mem(struct hl_device *hdev, enum pci_region region_type,
return 0;
}
+void hl_engine_data_sprintf(struct engines_data *e, const char *fmt, ...)
+{
+ va_list args;
+ int str_size;
+
+ va_start(args, fmt);
+ /* Calculate formatted string length. Assuming each string is null terminated, hence
+ * increment result by 1
+ */
+ str_size = vsnprintf(NULL, 0, fmt, args) + 1;
+ va_end(args);
+
+ if ((e->actual_size + str_size) < e->allocated_buf_size) {
+ va_start(args, fmt);
+ vsnprintf(e->buf + e->actual_size, str_size, fmt, args);
+ va_end(args);
+ }
+
+ /* Need to update the size even when not updating destination buffer to get the exact size
+ * of all input strings
+ */
+ e->actual_size += str_size;
+}
+
enum hl_device_status hl_device_status(struct hl_device *hdev)
{
enum hl_device_status status;
--
2.25.1
prev parent reply other threads:[~2022-07-31 10:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-31 10:50 [PATCH 1/8] habanalabs/gaudi: fix print format for div_sel Oded Gabbay
2022-07-31 10:50 ` [PATCH 2/8] habanalabs/gaudi: read div_sel value from firmware Oded Gabbay
2022-07-31 10:50 ` [PATCH 3/8] habanalabs: fix command submission sanity check Oded Gabbay
2022-07-31 10:50 ` [PATCH 4/8] habanalabs: avoid returning a valid handle if map_block() fails Oded Gabbay
2022-07-31 10:50 ` [PATCH 5/8] habanalabs: fix vma fields assignments order in hl_hw_block_mmap() Oded Gabbay
2022-07-31 10:50 ` [PATCH 6/8] habanalabs: add a missing lock for in_reset indication Oded Gabbay
2022-07-31 10:50 ` [PATCH 7/8] habanalabs/uapi: move defines to better place inside file Oded Gabbay
2022-07-31 10:50 ` Oded Gabbay [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=20220731105037.545106-8-ogabbay@kernel.org \
--to=ogabbay@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@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
Powered by JetHome