mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-11 20:05:22 +02:00
powerpc/pseries: Add failure related checks for h_get_mpp and h_get_ppp
[ Upstream commit 6d43416385
]
Couple of Minor fixes:
- hcall return values are long. Fix that for h_get_mpp, h_get_ppp and
parse_ppp_data
- If hcall fails, values set should be at-least zero. It shouldn't be
uninitialized values. Fix that for h_get_mpp and h_get_ppp
Signed-off-by: Shrikanth Hegde <sshegde@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20240412092047.455483-3-sshegde@linux.ibm.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
3d50e4cef2
commit
adb1c558c6
|
@ -540,7 +540,7 @@ struct hvcall_mpp_data {
|
||||||
unsigned long backing_mem;
|
unsigned long backing_mem;
|
||||||
};
|
};
|
||||||
|
|
||||||
int h_get_mpp(struct hvcall_mpp_data *);
|
long h_get_mpp(struct hvcall_mpp_data *mpp_data);
|
||||||
|
|
||||||
struct hvcall_mpp_x_data {
|
struct hvcall_mpp_x_data {
|
||||||
unsigned long coalesced_bytes;
|
unsigned long coalesced_bytes;
|
||||||
|
|
|
@ -1886,10 +1886,10 @@ out:
|
||||||
* h_get_mpp
|
* h_get_mpp
|
||||||
* H_GET_MPP hcall returns info in 7 parms
|
* H_GET_MPP hcall returns info in 7 parms
|
||||||
*/
|
*/
|
||||||
int h_get_mpp(struct hvcall_mpp_data *mpp_data)
|
long h_get_mpp(struct hvcall_mpp_data *mpp_data)
|
||||||
{
|
{
|
||||||
int rc;
|
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
|
||||||
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
|
long rc;
|
||||||
|
|
||||||
rc = plpar_hcall9(H_GET_MPP, retbuf);
|
rc = plpar_hcall9(H_GET_MPP, retbuf);
|
||||||
|
|
||||||
|
|
|
@ -113,8 +113,8 @@ struct hvcall_ppp_data {
|
||||||
*/
|
*/
|
||||||
static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
|
static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data)
|
||||||
{
|
{
|
||||||
unsigned long rc;
|
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0};
|
||||||
unsigned long retbuf[PLPAR_HCALL9_BUFSIZE];
|
long rc;
|
||||||
|
|
||||||
rc = plpar_hcall9(H_GET_PPP, retbuf);
|
rc = plpar_hcall9(H_GET_PPP, retbuf);
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ static void parse_ppp_data(struct seq_file *m)
|
||||||
struct hvcall_ppp_data ppp_data;
|
struct hvcall_ppp_data ppp_data;
|
||||||
struct device_node *root;
|
struct device_node *root;
|
||||||
const __be32 *perf_level;
|
const __be32 *perf_level;
|
||||||
int rc;
|
long rc;
|
||||||
|
|
||||||
rc = h_get_ppp(&ppp_data);
|
rc = h_get_ppp(&ppp_data);
|
||||||
if (rc)
|
if (rc)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user