mirror of
https://git.proxmox.com/git/mirror_ubuntu-kernels.git
synced 2025-11-16 02:04:43 +00:00
The majority of callers to qmp_send() composes the message dynamically using some form of sprintf(), resulting in unnecessary complication and stack usage. By changing the interface of qmp_send() to take a format string and arguments, the duplicated composition of the commands can be moved to a single location. Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <quic_bjorande@quicinc.com> Link: https://lore.kernel.org/r/20230811205839.727373-4-quic_bjorande@quicinc.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
39 lines
638 B
C
39 lines
638 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
|
|
*/
|
|
|
|
#ifndef __QCOM_AOSS_H__
|
|
#define __QCOM_AOSS_H__
|
|
|
|
#include <linux/err.h>
|
|
#include <linux/device.h>
|
|
|
|
struct qmp;
|
|
|
|
#if IS_ENABLED(CONFIG_QCOM_AOSS_QMP)
|
|
|
|
int qmp_send(struct qmp *qmp, const char *fmt, ...);
|
|
struct qmp *qmp_get(struct device *dev);
|
|
void qmp_put(struct qmp *qmp);
|
|
|
|
#else
|
|
|
|
static inline int qmp_send(struct qmp *qmp, const char *fmt, ...)
|
|
{
|
|
return -ENODEV;
|
|
}
|
|
|
|
static inline struct qmp *qmp_get(struct device *dev)
|
|
{
|
|
return ERR_PTR(-ENODEV);
|
|
}
|
|
|
|
static inline void qmp_put(struct qmp *qmp)
|
|
{
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|