From: Colin Ian King <colin.king@canonical.com>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>,
Lee Jones <lee.jones@linaro.org>,
Linux Fbdev development list <linux-fbdev@vger.kernel.org>
Subject: re: video: fbdev: sis: Fix set but not used warnings in init.c
Date: Tue, 1 Dec 2020 12:24:37 +0000 [thread overview]
Message-ID: <575ea853-5a18-0a7c-a84b-0136ecf2cc90@canonical.com> (raw)
Hi,
Static analysis on linux-next with Coverity had detected a minor issue
in the following commit:
commit 2a74e8682a39d00e04ca278459ae7d7ecbdfb394
Author: Sam Ravnborg <sam@ravnborg.org>
Date: Sat Nov 28 23:40:55 2020 +0100
video: fbdev: sis: Fix set but not used warnings in init.c
The analysis is as follows:
2659 if(SiS_Pr->UseCustomMode) {
2660 infoflag = SiS_Pr->CInfoFlag;
2661 } else {
Useless call (USELESS_CALL) side_effect_free: Calling
SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex) is only useful for its
return value, which is ignored.
2662 SiS_GetResInfo(SiS_Pr, ModeNo, ModeIdIndex);
2663 if(ModeNo > 0x13) {
2664 infoflag = SiS_Pr->SiS_RefIndex[RRTI].Ext_InfoFlag;
2665 }
2666 }
.. SiSGetResInfo() just returns an unsigned short and this returns a
values is not being used. The function does not side effect anything, so
it does look like a redundant call. Is this intentional?
3044 unsigned short
3045 SiS_GetResInfo(struct SiS_Private *SiS_Pr, unsigned short ModeNo,
unsigned short ModeIdIndex)
3046 {
3047 if(ModeNo <= 0x13)
3048 return ((unsigned
short)SiS_Pr->SiS_SModeIDTable[ModeIdIndex].St_ResInfo);
3049 else
3050 return ((unsigned
short)SiS_Pr->SiS_EModeIDTable[ModeIdIndex].Ext_RESINFO);
3051 }
Colin
reply other threads:[~2020-12-01 12:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=575ea853-5a18-0a7c-a84b-0136ecf2cc90@canonical.com \
--to=colin.king@canonical.com \
--cc=lee.jones@linaro.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).