Unverified Commit c8e916a3 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5524 [OLK-6.6] fix 0day bugs reported by CI robot for Mont-TSSE

Merge Pull Request from: @carriercai 
 
fix 0day comments bugs reported by CI robot 
 
Link:https://gitee.com/openeuler/kernel/pulls/5524

 

Reviewed-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parents f0732647 44524821
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -115,7 +115,8 @@ static int tsse_sriov_configure(struct pci_dev *pdev, int num_vfs_param)
}

/**
 * This function will be called when user writes string to /sys/bus/pci/devices/.../tsse_image_load.
 * tsse_image_load_store() - This function will be called when user
 * writes string to /sys/bus/pci/devices/.../tsse_image_load.
 * Driver will always loads /lib/firmware/tsse_firmware.bin.
 * @dev: device
 * @attr: device attribute
+5 −4
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ static int fw_send_msg(struct tsse_ipc *tsseipc, struct ipc_msg *msg)
}

/**
 * Get version information from firmware
 * get_firmware_version() - Get version information from firmware
 * @fw: firmware pointer
 * @fw_version_out: firmware version string output
 * Return: 0 on success, error code otherwise
@@ -103,9 +103,10 @@ int get_firmware_version(const struct firmware *fw, char *fw_version_out)
}

/**
 * Firmware service to handle IPC message from mainCPU.
 * fw_service() - Firmware service to handle IPC message from mainCPU.
 * It will write init or manual load firmware to PCIe BAR and send message back.
 * No return value.
 * @tsseipc_t: pointer to a structure used for IPC
 * @msg_t: pointer to IPC message
*/
void fw_service(void *tsseipc_t, void *msg_t)
{
@@ -152,7 +153,7 @@ void fw_service(void *tsseipc_t, void *msg_t)
}

/**
 * Load firmware from /lib/firmware
 * tsse_fw_load() - Load firmware from /lib/firmware
 * @pdev: pci device
 * @name: firmware file name
 * @fw: pointer to firmware pointer
+6 −3
Original line number Diff line number Diff line
@@ -15,8 +15,10 @@
#include "tsse_service.h"

/**
 * Create ipc_msg and read message from BAR.
 * get_msginf() - Create ipc_msg and read message from BAR.
 * Return the pointer to ipc_msg, the caller is responsible for free it.
 * @d2h: device2host memory pointer
 * Return: new ipc_msg pointer, which points to message read from device
*/
static struct ipc_msg *get_msginf(void __iomem *d2h)
{
@@ -80,8 +82,9 @@ void notify_device(struct tsse_ipc *tsseipc)
}

/**
 * Enable main2host interrupt, cleanup interrupt set value in host2main and main2host.
 * No return value.
 * ipc_hw_init()- Enable main2host interrupt, cleanup interrupt
 * set value in host2main and main2host.
 * @hw_ipc: pointer to a structure used for IPC
*/
static void ipc_hw_init(struct tsse_ipc *hw_ipc)
{