Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

powerpc/pseries: Add failure related checks for h_get_mpp and h_get_ppp

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

authored by

Shrikanth Hegde and committed by
Michael Ellerman
6d434163 9c74ecfd

+7 -7
+1 -1
arch/powerpc/include/asm/hvcall.h
··· 570 570 unsigned long backing_mem; 571 571 }; 572 572 573 - int h_get_mpp(struct hvcall_mpp_data *); 573 + long h_get_mpp(struct hvcall_mpp_data *mpp_data); 574 574 575 575 struct hvcall_mpp_x_data { 576 576 unsigned long coalesced_bytes;
+3 -3
arch/powerpc/platforms/pseries/lpar.c
··· 1886 1886 * h_get_mpp 1887 1887 * H_GET_MPP hcall returns info in 7 parms 1888 1888 */ 1889 - int h_get_mpp(struct hvcall_mpp_data *mpp_data) 1889 + long h_get_mpp(struct hvcall_mpp_data *mpp_data) 1890 1890 { 1891 - int rc; 1892 - unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; 1891 + unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0}; 1892 + long rc; 1893 1893 1894 1894 rc = plpar_hcall9(H_GET_MPP, retbuf); 1895 1895
+3 -3
arch/powerpc/platforms/pseries/lparcfg.c
··· 113 113 */ 114 114 static unsigned int h_get_ppp(struct hvcall_ppp_data *ppp_data) 115 115 { 116 - unsigned long rc; 117 - unsigned long retbuf[PLPAR_HCALL9_BUFSIZE]; 116 + unsigned long retbuf[PLPAR_HCALL9_BUFSIZE] = {0}; 117 + long rc; 118 118 119 119 rc = plpar_hcall9(H_GET_PPP, retbuf); 120 120 ··· 197 197 struct hvcall_ppp_data ppp_data; 198 198 struct device_node *root; 199 199 const __be32 *perf_level; 200 - int rc; 200 + long rc; 201 201 202 202 rc = h_get_ppp(&ppp_data); 203 203 if (rc)