2014-12-20 14:57:16

by Rickard Strandqvist

[permalink] [raw]
Subject: [PATCH] arch: powerpc: platforms: ps3: repository.c: Remove unused function

Remove the function ps3_repository_write_highmem_info() that is not used anywhere.

This was partially found by using a static code analysis program called cppcheck.

Signed-off-by: Rickard Strandqvist <[email protected]>
---
arch/powerpc/platforms/ps3/platform.h | 2 --
arch/powerpc/platforms/ps3/repository.c | 10 ----------
2 files changed, 12 deletions(-)

diff --git a/arch/powerpc/platforms/ps3/platform.h b/arch/powerpc/platforms/ps3/platform.h
index d71329a..f15507c 100644
--- a/arch/powerpc/platforms/ps3/platform.h
+++ b/arch/powerpc/platforms/ps3/platform.h
@@ -201,8 +201,6 @@ int ps3_repository_write_highmem_base(unsigned int region_index,
u64 highmem_base);
int ps3_repository_write_highmem_size(unsigned int region_index,
u64 highmem_size);
-int ps3_repository_write_highmem_info(unsigned int region_index,
- u64 highmem_base, u64 highmem_size);
int ps3_repository_delete_highmem_info(unsigned int region_index);

/* repository pme info */
diff --git a/arch/powerpc/platforms/ps3/repository.c b/arch/powerpc/platforms/ps3/repository.c
index bfccdc7..2d5e56a 100644
--- a/arch/powerpc/platforms/ps3/repository.c
+++ b/arch/powerpc/platforms/ps3/repository.c
@@ -1160,16 +1160,6 @@ int ps3_repository_write_highmem_size(unsigned int region_index,
highmem_size, 0);
}

-int ps3_repository_write_highmem_info(unsigned int region_index,
- u64 highmem_base, u64 highmem_size)
-{
- int result;
-
- result = ps3_repository_write_highmem_base(region_index, highmem_base);
- return result ? result
- : ps3_repository_write_highmem_size(region_index, highmem_size);
-}
-
static int ps3_repository_delete_highmem_base(unsigned int region_index)
{
return delete_node(
--
1.7.10.4


2014-12-22 05:02:26

by Michael Ellerman

[permalink] [raw]
Subject: Re: arch: powerpc: platforms: ps3: repository.c: Remove unused function

On Sat, 2014-20-12 at 15:00:01 UTC, Rickard Strandqvist wrote:
> Remove the function ps3_repository_write_highmem_info() that is not used anywhere.
>
> This was partially found by using a static code analysis program called cppcheck.

Actually it looks like everything under CONFIG_PS3_REPOSITORY_WRITE is unused,
and never was used.

We appreciate these sort of patches, but if you can dig a little deeper and
also work out why the code is unused that would be much more useful.

cheers

2014-12-22 17:26:14

by Geoff Levand

[permalink] [raw]
Subject: Re: [PATCH] arch: powerpc: platforms: ps3: repository.c: Remove unused function

On Sat, 2014-12-20 at 16:00 +0100, Rickard Strandqvist wrote:
> Remove the function ps3_repository_write_highmem_info() that is not used anywhere.

NAK

ps3_repository_write_highmem_info() is needed by otheros++. What we
need is a kernel patch to add the highmem info to the repository once it
is known.

These ps3_repository_write_highmem routines are also the only
documentation the freeBSD port has as to how the highmem info is (should
be) saved in the repository.

-Geoff

2014-12-22 17:50:30

by Nathan Whitehorn

[permalink] [raw]
Subject: Re: [PATCH] arch: powerpc: platforms: ps3: repository.c: Remove unused function


On 12/22/14 09:26, Geoff Levand wrote:
> On Sat, 2014-12-20 at 16:00 +0100, Rickard Strandqvist wrote:
>> Remove the function ps3_repository_write_highmem_info() that is not used anywhere.
> NAK
>
> ps3_repository_write_highmem_info() is needed by otheros++. What we
> need is a kernel patch to add the highmem info to the repository once it
> is known.
>
> These ps3_repository_write_highmem routines are also the only
> documentation the freeBSD port has as to how the highmem info is (should
> be) saved in the repository.
>
> -Geoff
>
>

Yes, we really need this for FreeBSD since that port uses the repository
directly instead of FDT. Thanks for noticing this. We could adapt
FreeBSD to use FDT (this is the only non-device-tree PowerPC port), but
there hasn't been any reason to do that thus far given the availability
of the repository information.
-Nathan

2014-12-22 22:11:48

by Rickard Strandqvist

[permalink] [raw]
Subject: Re: [PATCH] arch: powerpc: platforms: ps3: repository.c: Remove unused function

2014-12-22 18:36 GMT+01:00 Nathan Whitehorn <[email protected]>:
>
> On 12/22/14 09:26, Geoff Levand wrote:
>>
>> On Sat, 2014-12-20 at 16:00 +0100, Rickard Strandqvist wrote:
>>>
>>> Remove the function ps3_repository_write_highmem_info() that is not used
>>> anywhere.
>>
>> NAK
>>
>> ps3_repository_write_highmem_info() is needed by otheros++. What we
>> need is a kernel patch to add the highmem info to the repository once it
>> is known.
>>
>> These ps3_repository_write_highmem routines are also the only
>> documentation the freeBSD port has as to how the highmem info is (should
>> be) saved in the repository.
>>
>> -Geoff
>>
>>
>
> Yes, we really need this for FreeBSD since that port uses the repository
> directly instead of FDT. Thanks for noticing this. We could adapt FreeBSD to
> use FDT (this is the only non-device-tree PowerPC port), but there hasn't
> been any reason to do that thus far given the availability of the repository
> information.
> -Nathan



Hi

Too bad that did not have the benefit of the patch, but it looks like
something good come because of it anyhow.

Kind regards
Rickard Strandqvist

2014-12-23 00:26:23

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] arch: powerpc: platforms: ps3: repository.c: Remove unused function

On Mon, 2014-12-22 at 09:26 -0800, Geoff Levand wrote:
> On Sat, 2014-12-20 at 16:00 +0100, Rickard Strandqvist wrote:
> > Remove the function ps3_repository_write_highmem_info() that is not used anywhere.
>
> NAK
>
> ps3_repository_write_highmem_info() is needed by otheros++. What we
> need is a kernel patch to add the highmem info to the repository once it
> is known.

OK so where's that patch?

> These ps3_repository_write_highmem routines are also the only
> documentation the freeBSD port has as to how the highmem info is (should
> be) saved in the repository.

We don't carry dead code as documentation for BSD.

cheers

2014-12-23 02:44:48

by Geoff Levand

[permalink] [raw]
Subject: Re: [PATCH] arch: powerpc: platforms: ps3: repository.c: Remove unused function

Hi Michael,

On Tue, 2014-12-23 at 11:26 +1100, Michael Ellerman wrote:
> On Mon, 2014-12-22 at 09:26 -0800, Geoff Levand wrote:
> > ps3_repository_write_highmem_info() is needed by otheros++. What we
> > need is a kernel patch to add the highmem info to the repository once it
> > is known.
>
> OK so where's that patch?

I put one in my ps3-linux repo. I'll post it after I do some more
testing.

-Geoff

2014-12-23 05:52:28

by Michael Ellerman

[permalink] [raw]
Subject: Re: [PATCH] arch: powerpc: platforms: ps3: repository.c: Remove unused function

On Mon, 2014-12-22 at 18:44 -0800, Geoff Levand wrote:
> Hi Michael,
>
> On Tue, 2014-12-23 at 11:26 +1100, Michael Ellerman wrote:
> > On Mon, 2014-12-22 at 09:26 -0800, Geoff Levand wrote:
> > > ps3_repository_write_highmem_info() is needed by otheros++. What we
> > > need is a kernel patch to add the highmem info to the repository once it
> > > is known.
> >
> > OK so where's that patch?
>
> I put one in my ps3-linux repo. I'll post it after I do some more
> testing.

Great, thanks.

cheers