linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/5] powerpc: Remove five unused variables
@ 2019-11-19  6:14 zhengbin
  2019-11-19  6:14 ` [PATCH 1/5] powerpc/fadump: Remove set but not used variable 'elf' zhengbin
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zhengbin @ 2019-11-19  6:14 UTC (permalink / raw)
  To: benh, paulus, mpe, linuxppc-dev; +Cc: zhengbin13

zhengbin (5):
  powerpc/fadump: Remove set but not used variable 'elf'
  powerpc/perf: Remove set but not used variable 'target'
  powerpc/powernv: Remove set but not used variable 'total_vfs'
  powerpc/powernv: Remove set but not used variable 'pdn'
  powerpc/powernv: Remove set but not used variable 'parent'

 arch/powerpc/kernel/fadump.c              |  2 --
 arch/powerpc/perf/imc-pmu.c               |  3 ---
 arch/powerpc/platforms/powernv/pci-ioda.c | 12 ------------
 3 files changed, 17 deletions(-)

--
2.7.4


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/5] powerpc/fadump: Remove set but not used variable 'elf'
  2019-11-19  6:14 [PATCH 0/5] powerpc: Remove five unused variables zhengbin
@ 2019-11-19  6:14 ` zhengbin
  2019-11-19  6:14 ` [PATCH 2/5] powerpc/perf: Remove set but not used variable 'target' zhengbin
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zhengbin @ 2019-11-19  6:14 UTC (permalink / raw)
  To: benh, paulus, mpe, linuxppc-dev; +Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

arch/powerpc/kernel/fadump.c: In function fadump_update_elfcore_header:
arch/powerpc/kernel/fadump.c:790:17: warning: variable elf set but not used [-Wunused-but-set-variable]

It is introduced by commit ebaeb5ae2437 ("fadump:
Convert firmware-assisted cpu state dump data into elf notes."),
but never used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 arch/powerpc/kernel/fadump.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/kernel/fadump.c b/arch/powerpc/kernel/fadump.c
index ff0114a..66f6bf0 100644
--- a/arch/powerpc/kernel/fadump.c
+++ b/arch/powerpc/kernel/fadump.c
@@ -654,10 +654,8 @@ u32 *fadump_regs_to_elf_notes(u32 *buf, struct pt_regs *regs)

 void fadump_update_elfcore_header(char *bufp)
 {
-	struct elfhdr *elf;
 	struct elf_phdr *phdr;

-	elf = (struct elfhdr *)bufp;
 	bufp += sizeof(struct elfhdr);

 	/* First note is a place holder for cpu notes info. */
--
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/5] powerpc/perf: Remove set but not used variable 'target'
  2019-11-19  6:14 [PATCH 0/5] powerpc: Remove five unused variables zhengbin
  2019-11-19  6:14 ` [PATCH 1/5] powerpc/fadump: Remove set but not used variable 'elf' zhengbin
@ 2019-11-19  6:14 ` zhengbin
  2019-11-19  6:14 ` [PATCH 3/5] powerpc/powernv: Remove set but not used variable 'total_vfs' zhengbin
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zhengbin @ 2019-11-19  6:14 UTC (permalink / raw)
  To: benh, paulus, mpe, linuxppc-dev; +Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

arch/powerpc/perf/imc-pmu.c: In function trace_imc_event_init:
arch/powerpc/perf/imc-pmu.c:1292:22: warning: variable target set but not used [-Wunused-but-set-variable]

It is introduced by commit 012ae244845f ("powerpc/perf:
Trace imc PMU functions"), but never used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 arch/powerpc/perf/imc-pmu.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/powerpc/perf/imc-pmu.c b/arch/powerpc/perf/imc-pmu.c
index cb50a9e..83f0908 100644
--- a/arch/powerpc/perf/imc-pmu.c
+++ b/arch/powerpc/perf/imc-pmu.c
@@ -1302,8 +1302,6 @@ static void trace_imc_event_del(struct perf_event *event, int flags)

 static int trace_imc_event_init(struct perf_event *event)
 {
-	struct task_struct *target;
-
 	if (event->attr.type != event->pmu->type)
 		return -ENOENT;

@@ -1315,7 +1313,6 @@ static int trace_imc_event_init(struct perf_event *event)
 		return -ENOENT;

 	event->hw.idx = -1;
-	target = event->hw.target;

 	event->pmu->task_ctx_nr = perf_hw_context;
 	return 0;
--
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/5] powerpc/powernv: Remove set but not used variable 'total_vfs'
  2019-11-19  6:14 [PATCH 0/5] powerpc: Remove five unused variables zhengbin
  2019-11-19  6:14 ` [PATCH 1/5] powerpc/fadump: Remove set but not used variable 'elf' zhengbin
  2019-11-19  6:14 ` [PATCH 2/5] powerpc/perf: Remove set but not used variable 'target' zhengbin
@ 2019-11-19  6:14 ` zhengbin
  2019-11-19  6:14 ` [PATCH 4/5] powerpc/powernv: Remove set but not used variable 'pdn' zhengbin
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zhengbin @ 2019-11-19  6:14 UTC (permalink / raw)
  To: benh, paulus, mpe, linuxppc-dev; +Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

arch/powerpc/platforms/powernv/pci-ioda.c: In function pnv_pci_vf_assign_m64:
arch/powerpc/platforms/powernv/pci-ioda.c:1346:25: warning: variable total_vfs set but not used [-Wunused-but-set-variable]

It is introduced by commit 02639b0e1326 ("powerpc/powernv:
Group VF PE when IOV BAR is big on PHB3"), but never used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index da1068a..846843b 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1341,7 +1341,6 @@ static int pnv_pci_vf_assign_m64(struct pci_dev *pdev, u16 num_vfs)
 	struct resource       *res;
 	int                    i, j;
 	int64_t                rc;
-	int                    total_vfs;
 	resource_size_t        size, start;
 	int                    pe_num;
 	int                    m64_bars;
@@ -1350,7 +1349,6 @@ static int pnv_pci_vf_assign_m64(struct pci_dev *pdev, u16 num_vfs)
 	hose = pci_bus_to_host(bus);
 	phb = hose->private_data;
 	pdn = pci_get_pdn(pdev);
-	total_vfs = pci_sriov_get_totalvfs(pdev);

 	if (pdn->m64_single_mode)
 		m64_bars = num_vfs;
--
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/5] powerpc/powernv: Remove set but not used variable 'pdn'
  2019-11-19  6:14 [PATCH 0/5] powerpc: Remove five unused variables zhengbin
                   ` (2 preceding siblings ...)
  2019-11-19  6:14 ` [PATCH 3/5] powerpc/powernv: Remove set but not used variable 'total_vfs' zhengbin
@ 2019-11-19  6:14 ` zhengbin
  2019-11-19  6:14 ` [PATCH 5/5] powerpc/powernv: Remove set but not used variable 'parent' zhengbin
  2020-09-09 13:37 ` [PATCH 0/5] powerpc: Remove five unused variables Michael Ellerman
  5 siblings, 0 replies; 7+ messages in thread
From: zhengbin @ 2019-11-19  6:14 UTC (permalink / raw)
  To: benh, paulus, mpe, linuxppc-dev; +Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

arch/powerpc/platforms/powernv/pci-ioda.c: In function pnv_ioda_release_vf_PE:
arch/powerpc/platforms/powernv/pci-ioda.c:1468:25: warning: variable pdn set but not used [-Wunused-but-set-variable]

It is introduced by commit 781a868f3136 ("powerpc/powernv:
Shift VF resource with an offset"), but never used, so remove it.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 846843b..47ed443 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -1461,12 +1461,10 @@ static void pnv_ioda_release_vf_PE(struct pci_dev *pdev)
 	struct pci_controller *hose;
 	struct pnv_phb        *phb;
 	struct pnv_ioda_pe    *pe, *pe_n;
-	struct pci_dn         *pdn;

 	bus = pdev->bus;
 	hose = pci_bus_to_host(bus);
 	phb = hose->private_data;
-	pdn = pci_get_pdn(pdev);

 	if (!pdev->is_physfn)
 		return;
--
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/5] powerpc/powernv: Remove set but not used variable 'parent'
  2019-11-19  6:14 [PATCH 0/5] powerpc: Remove five unused variables zhengbin
                   ` (3 preceding siblings ...)
  2019-11-19  6:14 ` [PATCH 4/5] powerpc/powernv: Remove set but not used variable 'pdn' zhengbin
@ 2019-11-19  6:14 ` zhengbin
  2020-09-09 13:37 ` [PATCH 0/5] powerpc: Remove five unused variables Michael Ellerman
  5 siblings, 0 replies; 7+ messages in thread
From: zhengbin @ 2019-11-19  6:14 UTC (permalink / raw)
  To: benh, paulus, mpe, linuxppc-dev; +Cc: zhengbin13

Fixes gcc '-Wunused-but-set-variable' warning:

arch/powerpc/platforms/powernv/pci-ioda.c: In function pnv_ioda_configure_pe:
arch/powerpc/platforms/powernv/pci-ioda.c:867:18: warning: variable parent set but not used [-Wunused-but-set-variable]

It is not used since commit b131a8425c34 ("powerpc/powernv:
Set PELTV for compound PEs")

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 arch/powerpc/platforms/powernv/pci-ioda.c | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c
index 47ed443..ae2db65 100644
--- a/arch/powerpc/platforms/powernv/pci-ioda.c
+++ b/arch/powerpc/platforms/powernv/pci-ioda.c
@@ -862,7 +862,6 @@ static int pnv_ioda_deconfigure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)

 static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
 {
-	struct pci_dev *parent;
 	uint8_t bcomp, dcomp, fcomp;
 	long rc, rid_end, rid;

@@ -872,7 +871,6 @@ static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)

 		dcomp = OPAL_IGNORE_RID_DEVICE_NUMBER;
 		fcomp = OPAL_IGNORE_RID_FUNCTION_NUMBER;
-		parent = pe->pbus->self;
 		if (pe->flags & PNV_IODA_PE_BUS_ALL)
 			count = pe->pbus->busn_res.end - pe->pbus->busn_res.start + 1;
 		else
@@ -893,12 +891,6 @@ static int pnv_ioda_configure_pe(struct pnv_phb *phb, struct pnv_ioda_pe *pe)
 		}
 		rid_end = pe->rid + (count << 8);
 	} else {
-#ifdef CONFIG_PCI_IOV
-		if (pe->flags & PNV_IODA_PE_VF)
-			parent = pe->parent_dev;
-		else
-#endif /* CONFIG_PCI_IOV */
-			parent = pe->pdev->bus->self;
 		bcomp = OpalPciBusAll;
 		dcomp = OPAL_COMPARE_RID_DEVICE_NUMBER;
 		fcomp = OPAL_COMPARE_RID_FUNCTION_NUMBER;
--
2.7.4


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/5] powerpc: Remove five unused variables
  2019-11-19  6:14 [PATCH 0/5] powerpc: Remove five unused variables zhengbin
                   ` (4 preceding siblings ...)
  2019-11-19  6:14 ` [PATCH 5/5] powerpc/powernv: Remove set but not used variable 'parent' zhengbin
@ 2020-09-09 13:37 ` Michael Ellerman
  5 siblings, 0 replies; 7+ messages in thread
From: Michael Ellerman @ 2020-09-09 13:37 UTC (permalink / raw)
  To: mpe, zhengbin, linuxppc-dev, benh, paulus

On Tue, 19 Nov 2019 14:14:29 +0800, zhengbin wrote:
> zhengbin (5):
>   powerpc/fadump: Remove set but not used variable 'elf'
>   powerpc/perf: Remove set but not used variable 'target'
>   powerpc/powernv: Remove set but not used variable 'total_vfs'
>   powerpc/powernv: Remove set but not used variable 'pdn'
>   powerpc/powernv: Remove set but not used variable 'parent'
> 
> [...]

Patches 1, 2 & 5 applied to powerpc/next.

[1/5] powerpc/fadump: Remove set but not used variable 'elf'
      https://git.kernel.org/powerpc/c/738e6cad0ace88edec8f4ffa082749ad5df26409
[2/5] powerpc/perf: Remove set but not used variable 'target'
      https://git.kernel.org/powerpc/c/ef23cf9a89a7aec19a29d548d1e219d436b23b6e
[5/5] powerpc/powernv: Remove set but not used variable 'parent'
      https://git.kernel.org/powerpc/c/18102e4bcc47f5b5ac70e2e4461d022c1ee6df24

cheers

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-09-09 15:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19  6:14 [PATCH 0/5] powerpc: Remove five unused variables zhengbin
2019-11-19  6:14 ` [PATCH 1/5] powerpc/fadump: Remove set but not used variable 'elf' zhengbin
2019-11-19  6:14 ` [PATCH 2/5] powerpc/perf: Remove set but not used variable 'target' zhengbin
2019-11-19  6:14 ` [PATCH 3/5] powerpc/powernv: Remove set but not used variable 'total_vfs' zhengbin
2019-11-19  6:14 ` [PATCH 4/5] powerpc/powernv: Remove set but not used variable 'pdn' zhengbin
2019-11-19  6:14 ` [PATCH 5/5] powerpc/powernv: Remove set but not used variable 'parent' zhengbin
2020-09-09 13:37 ` [PATCH 0/5] powerpc: Remove five unused variables Michael Ellerman

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).