* [PATCH] char/mwave: turn tp3780I_InitializeBoardData() into void function
@ 2021-03-10 8:46 Yang Li
2021-03-10 8:52 ` Greg KH
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-03-10 8:46 UTC (permalink / raw)
To: arnd; +Cc: gregkh, linux-kernel, Yang Li
This function always return '0' and no callers use the return value.
So make it a void function.
This eliminates the following coccicheck warning:
./drivers/char/mwave/tp3780i.c:182:5-11: Unneeded variable: "retval".
Return "0" on line 187
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
drivers/char/mwave/tp3780i.c | 6 +-----
drivers/char/mwave/tp3780i.h | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c
index 5e1618a..8588b51 100644
--- a/drivers/char/mwave/tp3780i.c
+++ b/drivers/char/mwave/tp3780i.c
@@ -177,14 +177,10 @@ int tp3780I_InitializeBoardData(THINKPAD_BD_DATA * pBDData)
return retval;
}
-int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData)
+void tp3780I_Cleanup(THINKPAD_BD_DATA *pBDData)
{
- int retval = 0;
-
PRINTK_2(TRACE_TP3780I,
"tp3780i::tp3780I_Cleanup entry and exit pBDData %p\n", pBDData);
-
- return retval;
}
int tp3780I_CalcResources(THINKPAD_BD_DATA * pBDData)
diff --git a/drivers/char/mwave/tp3780i.h b/drivers/char/mwave/tp3780i.h
index 07685b6..8bd976d 100644
--- a/drivers/char/mwave/tp3780i.h
+++ b/drivers/char/mwave/tp3780i.h
@@ -91,7 +91,7 @@
int tp3780I_ResetDSP(THINKPAD_BD_DATA * pBDData);
int tp3780I_StartDSP(THINKPAD_BD_DATA * pBDData);
int tp3780I_QueryAbilities(THINKPAD_BD_DATA * pBDData, MW_ABILITIES * pAbilities);
-int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData);
+void tp3780I_Cleanup(THINKPAD_BD_DATA *pBDData);
int tp3780I_ReadWriteDspDStore(THINKPAD_BD_DATA * pBDData, unsigned int uOpcode,
void __user *pvBuffer, unsigned int uCount,
unsigned long ulDSPAddr);
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] char/mwave: turn tp3780I_InitializeBoardData() into void function
2021-03-10 8:46 [PATCH] char/mwave: turn tp3780I_InitializeBoardData() into void function Yang Li
@ 2021-03-10 8:52 ` Greg KH
0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2021-03-10 8:52 UTC (permalink / raw)
To: Yang Li; +Cc: arnd, linux-kernel
On Wed, Mar 10, 2021 at 04:46:03PM +0800, Yang Li wrote:
> This function always return '0' and no callers use the return value.
> So make it a void function.
>
> This eliminates the following coccicheck warning:
> ./drivers/char/mwave/tp3780i.c:182:5-11: Unneeded variable: "retval".
> Return "0" on line 187
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
> drivers/char/mwave/tp3780i.c | 6 +-----
> drivers/char/mwave/tp3780i.h | 2 +-
> 2 files changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/char/mwave/tp3780i.c b/drivers/char/mwave/tp3780i.c
> index 5e1618a..8588b51 100644
> --- a/drivers/char/mwave/tp3780i.c
> +++ b/drivers/char/mwave/tp3780i.c
> @@ -177,14 +177,10 @@ int tp3780I_InitializeBoardData(THINKPAD_BD_DATA * pBDData)
> return retval;
> }
>
> -int tp3780I_Cleanup(THINKPAD_BD_DATA * pBDData)
> +void tp3780I_Cleanup(THINKPAD_BD_DATA *pBDData)
Your subject line does not match what the patch does :(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-10 8:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-10 8:46 [PATCH] char/mwave: turn tp3780I_InitializeBoardData() into void function Yang Li
2021-03-10 8:52 ` Greg KH
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox