* [PATCH] staging: xgifb: vb_init: Removed variables that is never used
@ 2015-01-31 15:20 Rickard Strandqvist
2015-02-01 4:19 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Rickard Strandqvist @ 2015-01-31 15:20 UTC (permalink / raw)
To: Arnaud Patard, Greg Kroah-Hartman
Cc: Rickard Strandqvist, Aaro Koskinen, Thomas Gummerer, Vitor Braga,
devel, linux-kernel
Variable was assigned a value that was never used.
I have also removed all the code that thereby serves no purpose.
This was found using a static code analysis program called cppcheck
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
drivers/staging/xgifb/vb_init.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 2b233af..6384077 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -1187,7 +1187,7 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
struct xgi_hw_device_info *HwDeviceExtension = &xgifb_info->hw_info;
struct vb_device_info VBINF;
struct vb_device_info *pVBInfo = &VBINF;
- unsigned char i, temp = 0, temp1;
+ unsigned char i, temp = 0;
pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
@@ -1286,8 +1286,6 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
/* disable VideoCapture */
xgifb_reg_and_or(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00);
xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00);
- /* chk if BCLK>=100MHz */
- temp1 = xgifb_reg_get(pVBInfo->P3d4, 0x7B);
xgifb_reg_set(pVBInfo->Part1Port,
0x02, XGI330_CRT2Data_1_2);
--
1.7.10.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] staging: xgifb: vb_init: Removed variables that is never used
2015-01-31 15:20 [PATCH] staging: xgifb: vb_init: Removed variables that is never used Rickard Strandqvist
@ 2015-02-01 4:19 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2015-02-01 4:19 UTC (permalink / raw)
To: Rickard Strandqvist
Cc: Arnaud Patard, devel, Aaro Koskinen, linux-kernel, Vitor Braga,
Thomas Gummerer
On Sat, Jan 31, 2015 at 04:20:48PM +0100, Rickard Strandqvist wrote:
> Variable was assigned a value that was never used.
> I have also removed all the code that thereby serves no purpose.
>
> This was found using a static code analysis program called cppcheck
>
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
> ---
> drivers/staging/xgifb/vb_init.c | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
> index 2b233af..6384077 100644
> --- a/drivers/staging/xgifb/vb_init.c
> +++ b/drivers/staging/xgifb/vb_init.c
> @@ -1187,7 +1187,7 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
> struct xgi_hw_device_info *HwDeviceExtension = &xgifb_info->hw_info;
> struct vb_device_info VBINF;
> struct vb_device_info *pVBInfo = &VBINF;
> - unsigned char i, temp = 0, temp1;
> + unsigned char i, temp = 0;
>
> pVBInfo->FBAddr = HwDeviceExtension->pjVideoMemoryAddress;
>
> @@ -1286,8 +1286,6 @@ unsigned char XGIInitNew(struct pci_dev *pdev)
> /* disable VideoCapture */
> xgifb_reg_and_or(pVBInfo->Part0Port, 0x3F, 0xEF, 0x00);
> xgifb_reg_set(pVBInfo->Part1Port, 0x00, 0x00);
> - /* chk if BCLK>=100MHz */
> - temp1 = xgifb_reg_get(pVBInfo->P3d4, 0x7B);
With hardware, you can't just remove all 'read' calls and expect things
to work because a static code checker things something is not right.
I'm going to drop _all_ of the patches you sent me in the past few days
as I really think they all are wrong. Please be more careful and work
on fixing real problems, not just ones that random tools think might be
wrong. Weeding out false-positives should not be my job, that's not
scalable at all.
sorry,
greg k-h
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-02-01 4:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-31 15:20 [PATCH] staging: xgifb: vb_init: Removed variables that is never used Rickard Strandqvist
2015-02-01 4:19 ` Greg Kroah-Hartman
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.