bus: mhi: core: Fix some error return code
Subsystems (3)
PATCH 1/1 bus: mhi: core: Fix some error return code
Fix to return negative error code from the error handling case instead of 0 in mhi_init_dev_ctxt() and mhi_driver_probe().
--- drivers/bus/mhi/core/init.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/bus/mhi/core/init.c +2 -0
@@ -291,6 +291,7 @@ int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl) }/* Setup cmd context */ + ret = -ENOMEM ; mhi_ctxt->cmd_ctxt = mhi_alloc_coherent(mhi_cntrl, sizeof(*mhi_ctxt->cmd_ctxt) * NR_OF_CMD_RINGS,
@@ -1100,6 +1101,7 @@ static int mhi_driver_probe(struct device *dev) } } + ret = -EINVAL ;if (dl_chan) {/* * If channel supports LPM notifications then status_cb should
Quoted 6 lines · Wei Yongjun
Fix to return negative error code from the error handling case instead of 0 in
mhi_init_dev_ctxt()andmhi_driver_probe().Fixes 3000f85b8f47 ("bus: mhi: core: Add support for basic PM operations")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>
Thanks,
Mani
Quoted 27 lines
--- drivers/bus/mhi/core/init.c | 2 ++ 1 file changed, 2 insertions(+)drivers/bus/mhi/core/init.c +2
-0@@ -291,6 +291,7 @@ int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl) }/* Setup cmd context */ + ret = -ENOMEM ; mhi_ctxt->cmd_ctxt = mhi_alloc_coherent(mhi_cntrl, sizeof(*mhi_ctxt->cmd_ctxt) * NR_OF_CMD_RINGS,@@ -1100,6 +1101,7 @@ static int mhi_driver_probe(struct device *dev) } } + ret = -EINVAL ;if (dl_chan) {/* * If channel supports LPM notifications then status_cb should
Walter Harms
Reviewed-by Manivannan SadhasivamHello guys,
some nitpicking ...
the prefered kernalstyle is:
if (condition)
set error_code
do something
from what i can see it is
set error_code
if (condition)
jm2c
re,
wh
________________________________________
Von: [email protected] <[email protected]> im Auftrag von Manivannan Sadhasivam <[email protected]>
Gesendet: Montag, 11. Mai 2020 12:31:24
An: Wei Yongjun
Cc: Hemant Kumar; Jeffrey Hugo; Greg Kroah-Hartman; Sujeev Dias; Siddartha Mohanadoss; [email protected]; [email protected]; Hulk Robot
Betreff: Re: [PATCH -next] bus: mhi: core: Fix some error return code
Quoted 6 lines · Wei Yongjun
Fix to return negative error code from the error handling case instead of 0 in
mhi_init_dev_ctxt()andmhi_driver_probe().Fixes 3000f85b8f47 ("bus: mhi: core: Add support for basic PM operations")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>
Thanks,
Mani
Quoted 27 lines
--- drivers/bus/mhi/core/init.c | 2 ++ 1 file changed, 2 insertions(+)drivers/bus/mhi/core/init.c +2
-0@@ -291,6 +291,7 @@ int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl) }/* Setup cmd context */ + ret = -ENOMEM ; mhi_ctxt->cmd_ctxt = mhi_alloc_coherent(mhi_cntrl, sizeof(*mhi_ctxt->cmd_ctxt) * NR_OF_CMD_RINGS,@@ -1100,6 +1101,7 @@ static int mhi_driver_probe(struct device *dev) } } + ret = -EINVAL ;if (dl_chan) {/* * If channel supports LPM notifications then status_cb should
Quoted 4 lines · Walter Harms
Hello guys,
some nitpicking ...
the prefered kernalstyle is:
Quoted 9 lines
if (condition)
seterror_code
do somethingfrom what i can see it is
set
error_code
if (condition)
There are multiple error paths which share the same error code. So I don't see any benefit of setting same error code in all the paths.
The recommended style makes perfect sense for an error path which has a unique error code but not for the above.
Thanks,
Mani
Quoted 51 lines
jm2c
re,
wh________________________________________
Von: [email protected] <[email protected]> im Auftrag von Manivannan Sadhasivam <[email protected]>
Gesendet: Montag, 11. Mai 2020 12:31:24
An: Wei Yongjun
Cc: Hemant Kumar; Jeffrey Hugo; Greg Kroah-Hartman; Sujeev Dias; Siddartha Mohanadoss; [email protected]; [email protected]; Hulk Robot
Betreff: Re: [PATCH -next] bus: mhi: core: Fix some error return codeQuoted 6 lines · Wei Yongjun
Fix to return negative error code from the error handling case instead of 0 in
mhi_init_dev_ctxt()andmhi_driver_probe().Fixes 3000f85b8f47 ("bus: mhi: core: Add support for basic PM operations")Reported-by Hulk Robot <[email protected]>Signed-off-by Wei Yongjun <[email protected]>Reviewed-by Manivannan Sadhasivam <[email protected]>Thanks,
ManiQuoted 27 lines
--- drivers/bus/mhi/core/init.c | 2 ++ 1 file changed, 2 insertions(+)drivers/bus/mhi/core/init.c +2
-0@@ -291,6 +291,7 @@ int mhi_init_dev_ctxt(struct mhi_controller *mhi_cntrl) }/* Setup cmd context */ + ret = -ENOMEM ; mhi_ctxt->cmd_ctxt = mhi_alloc_coherent(mhi_cntrl, sizeof(*mhi_ctxt->cmd_ctxt) * NR_OF_CMD_RINGS,@@ -1100,6 +1101,7 @@ static int mhi_driver_probe(struct device *dev) } } + ret = -EINVAL ;if (dl_chan) {/* * If channel supports LPM notifications then status_cb should
Quoted 4 lines · Walter Harms
Hello guys,
some nitpicking ...
the prefered kernalstyle is:
Quoted 8 lines
if (condition)
seterror_code
do somethingfrom what i can see it is
set
error_code
if (condition)
There isn't a prefered style. Both are accepted. Most people have a personal preference, but there isn't an official preference.
regards,
dan carpenter