Re: [PATCH v2] bus: ti-sysc: sysc_check_one_child(): Change return type to void
From: Roger Quadros
Date: Tue Aug 13 2019 - 03:43:31 EST
On 13/08/2019 10:37, Nishka Dasgupta wrote:
> On 13/08/19 12:58 PM, Roger Quadros wrote:
>>
>>
>> On 13/08/2019 10:17, Nishka Dasgupta wrote:
>>> Change return type of function sysc_check_one_child() from int to void
>>> as it always returns 0. Accordingly, at its callsite, delete the
>>> variable that previously stored the return value.
>>>
>>> Signed-off-by: Nishka Dasgupta <nishkadg.linux@xxxxxxxxx>
>>> ---
>>> Changes in v2:
>>> - Remove error variable entirely.
>>> - Change return type of sysc_check_one_child().
>>>
>>> Â drivers/bus/ti-sysc.c | 9 +++------
>>> Â 1 file changed, 3 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
>>> index e6deabd8305d..1c30fa58d70c 100644
>>> --- a/drivers/bus/ti-sysc.c
>>> +++ b/drivers/bus/ti-sysc.c
>>> @@ -615,8 +615,8 @@ static void sysc_check_quirk_stdout(struct sysc *ddata,
>>> ÂÂ * node but children have "ti,hwmods". These belong to the interconnect
>>> ÂÂ * target node and are managed by this driver.
>>> ÂÂ */
>>> -static int sysc_check_one_child(struct sysc *ddata,
>>> -ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ struct device_node *np)
>>> +static void sysc_check_one_child(struct sysc *ddata,
>>> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ struct device_node *np)
>>> Â {
>>> ÂÂÂÂÂ const char *name;
>>> Â
>>
>> You didn't remove the "return 0" at end of this function.
>> Doesn't it complain during build?
>>
>>> @@ -633,12 +633,9 @@ static int sysc_check_one_child(struct sysc *ddata,
>>> Â static int sysc_check_children(struct sysc *ddata)
>>> Â {
>>
>> This could return void as well.
>
> Okay. Sorry for the errors; I'll fix-up and resend.
>
> However, while building it, I'm running into a compilation problem:
> on line 764 (function sysc_ioremap) there is apparently an "undeclared variable", "SZ_1K". Is it a problem with the architecture? What arch should I compile it with?
make ARCH=arm omap2plus_defconfig
make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf-
>
> Thanking you,
> Nishka
>
>>
>>> ÂÂÂÂÂ struct device_node *child;
>>> -ÂÂÂ int error;
>>> Â ÂÂÂÂÂ for_each_child_of_node(ddata->dev->of_node, child) {
>>> -ÂÂÂÂÂÂÂ error = sysc_check_one_child(ddata, child);
>>> -ÂÂÂÂÂÂÂ if (error)
>>> -ÂÂÂÂÂÂÂÂÂÂÂ return error;
>>> +ÂÂÂÂÂÂÂ sysc_check_one_child(ddata, child);
>>> ÂÂÂÂÂ }
>>
>> You don't need the braces { }.
>>
>> Please run ./scripts/checkpatch.pl --strict on your patch and fix any
>> issues.
>>
>>> Â ÂÂÂÂÂ return 0;
>>>
>>
>> return not required.
>>
>> You will also need to fix all instances using sysc_check_children()
>>
cheers,
-roger
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki