diff mbox

arch: powerpc: platforms: ps3: repository.c: Remove unused function

Message ID 1419087601-4889-1-git-send-email-rickard_strandqvist@spectrumdigital.se (mailing list archive)
State Rejected
Delegated to: Michael Ellerman
Headers show

Commit Message

Rickard Strandqvist Dec. 20, 2014, 3 p.m. UTC
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 <rickard_strandqvist@spectrumdigital.se>
---
 arch/powerpc/platforms/ps3/platform.h   |    2 --
 arch/powerpc/platforms/ps3/repository.c |   10 ----------
 2 files changed, 12 deletions(-)

Comments

Michael Ellerman Dec. 22, 2014, 5:02 a.m. UTC | #1
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
Geoff Levand Dec. 22, 2014, 5:26 p.m. UTC | #2
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
Nathan Whitehorn Dec. 22, 2014, 5:36 p.m. UTC | #3
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
Rickard Strandqvist Dec. 22, 2014, 10:11 p.m. UTC | #4
2014-12-22 18:36 GMT+01:00 Nathan Whitehorn <nwhitehorn@freebsd.org>:
>
> 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
Michael Ellerman Dec. 23, 2014, 12:26 a.m. UTC | #5
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
Geoff Levand Dec. 23, 2014, 2:44 a.m. UTC | #6
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
Michael Ellerman Dec. 23, 2014, 5:52 a.m. UTC | #7
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
diff mbox

Patch

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(