diff mbox series

[next] Bluetooth: btintel_pcie: Remove structually deadcode

Message ID 20241014163001.4537-1-everestkc@everestkc.com.np (mailing list archive)
State Superseded
Headers show
Series [next] Bluetooth: btintel_pcie: Remove structually deadcode | expand

Checks

Context Check Description
tedd_an/pre-ci_am success Success
tedd_an/CheckPatch warning WARNING: Prefer a maximum 75 chars per line (possible unwrapped commit description?) #102: https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600709 total: 0 errors, 1 warnings, 7 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /github/workspace/src/src/13835314.patch has style problems, please review. NOTE: Ignored message types: UNKNOWN_COMMIT_ID NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS.
tedd_an/GitLint success Gitlint PASS
tedd_an/SubjectPrefix success Gitlint PASS
tedd_an/BuildKernel success BuildKernel PASS
tedd_an/CheckAllWarning success CheckAllWarning PASS
tedd_an/CheckSparse success CheckSparse PASS

Commit Message

Everest K.C. Oct. 14, 2024, 4:30 p.m. UTC
The switch case statement has a default branch. Thus, the return
statement at the end of the function can never be reached.
Fixing it by removing the return statement at the end of the
function.

This issue was reported by Coverity Scan.
https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600709

Fixes: 5ea625845b0f ("Bluetooth: btintel_pcie: Add handshake between driver and firmware")
Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
---
 drivers/bluetooth/btintel_pcie.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Shuah Khan Oct. 15, 2024, 12:02 a.m. UTC | #1
On 10/14/24 10:30, Everest K.C. wrote:
> The switch case statement has a default branch. Thus, the return
> statement at the end of the function can never be reached.
> Fixing it by removing the return statement at the end of the

Change "Fixing" to "Fix it"

> function.
> 
> This issue was reported by Coverity Scan.
> https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600709

Please include the output from the scan. People can't see this report
without logging in.

> 
> Fixes: 5ea625845b0f ("Bluetooth: btintel_pcie: Add handshake between driver and firmware")
> Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
> ---
>   drivers/bluetooth/btintel_pcie.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
> index e4ae8c898dfd..660496e55276 100644
> --- a/drivers/bluetooth/btintel_pcie.c
> +++ b/drivers/bluetooth/btintel_pcie.c
> @@ -391,7 +391,6 @@ static inline char *btintel_pcie_alivectxt_state2str(u32 alive_intr_ctxt)
>   	default:
>   		return "unknown";
>   	}
> -	return "null";

What happens when you build your patch with -Werror?
Do you see any build errors?

>   }
>   
>   /* This function handles the MSI-X interrupt for gp0 cause (bit 0 in

thanks,
-- Shuah
Everest K.C. Oct. 15, 2024, 4:52 a.m. UTC | #2
On Mon, Oct 14, 2024 at 6:02 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>
> On 10/14/24 10:30, Everest K.C. wrote:
> > The switch case statement has a default branch. Thus, the return
> > statement at the end of the function can never be reached.
> > Fixing it by removing the return statement at the end of the
>
> Change "Fixing" to "Fix it"
Will fix it in V2.
> > function.
> >
> > This issue was reported by Coverity Scan.
> > https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600709
>
> Please include the output from the scan. People can't see this report
> without logging in.
The issue is no longer visible in Coverity. Though the code is still
the same. The issue hasn't
been fixed. Should I remove the link too ?
> >
> > Fixes: 5ea625845b0f ("Bluetooth: btintel_pcie: Add handshake between driver and firmware")
> > Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
> > ---
> >   drivers/bluetooth/btintel_pcie.c | 1 -
> >   1 file changed, 1 deletion(-)
> >
> > diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
> > index e4ae8c898dfd..660496e55276 100644
> > --- a/drivers/bluetooth/btintel_pcie.c
> > +++ b/drivers/bluetooth/btintel_pcie.c
> > @@ -391,7 +391,6 @@ static inline char *btintel_pcie_alivectxt_state2str(u32 alive_intr_ctxt)
> >       default:
> >               return "unknown";
> >       }
> > -     return "null";
>
> What happens when you build your patch with -Werror?
> Do you see any build errors?
I compiled the intel bluetooth module without error. Will mention that
in V2 patch too.
> >   }
> >
> >   /* This function handles the MSI-X interrupt for gp0 cause (bit 0 in
>
> thanks,
> -- Shuah
Shuah Khan Oct. 15, 2024, 3:44 p.m. UTC | #3
On 10/14/24 22:52, Everest K.C. wrote:
> On Mon, Oct 14, 2024 at 6:02 PM Shuah Khan <skhan@linuxfoundation.org> wrote:
>>
>> On 10/14/24 10:30, Everest K.C. wrote:
>>> The switch case statement has a default branch. Thus, the return
>>> statement at the end of the function can never be reached.
>>> Fixing it by removing the return statement at the end of the
>>
>> Change "Fixing" to "Fix it"
> Will fix it in V2.
>>> function.
>>>
>>> This issue was reported by Coverity Scan.
>>> https://scan7.scan.coverity.com/#/project-view/51525/11354?selectedIssue=1600709
>>
>> Please include the output from the scan. People can't see this report
>> without logging in.
> The issue is no longer visible in Coverity. Though the code is still
> the same. The issue hasn't
> been fixed. Should I remove the link too ?

What's the use of including a link that don't show the problem?

>>>
>>> Fixes: 5ea625845b0f ("Bluetooth: btintel_pcie: Add handshake between driver and firmware")
>>> Signed-off-by: Everest K.C. <everestkc@everestkc.com.np>
>>> ---
>>>    drivers/bluetooth/btintel_pcie.c | 1 -
>>>    1 file changed, 1 deletion(-)
>>>
>>> diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
>>> index e4ae8c898dfd..660496e55276 100644
>>> --- a/drivers/bluetooth/btintel_pcie.c
>>> +++ b/drivers/bluetooth/btintel_pcie.c
>>> @@ -391,7 +391,6 @@ static inline char *btintel_pcie_alivectxt_state2str(u32 alive_intr_ctxt)
>>>        default:
>>>                return "unknown";
>>>        }
>>> -     return "null";
>>
>> What happens when you build your patch with -Werror?
>> Do you see any build errors?
> I compiled the intel bluetooth module without error. Will mention that
> in V2 patch too.

Okay.

>>>    }
>>>
>>>    /* This function handles the MSI-X interrupt for gp0 cause (bit 0 in
>>

thanks,
-- Shuah
diff mbox series

Patch

diff --git a/drivers/bluetooth/btintel_pcie.c b/drivers/bluetooth/btintel_pcie.c
index e4ae8c898dfd..660496e55276 100644
--- a/drivers/bluetooth/btintel_pcie.c
+++ b/drivers/bluetooth/btintel_pcie.c
@@ -391,7 +391,6 @@  static inline char *btintel_pcie_alivectxt_state2str(u32 alive_intr_ctxt)
 	default:
 		return "unknown";
 	}
-	return "null";
 }
 
 /* This function handles the MSI-X interrupt for gp0 cause (bit 0 in