linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] misc: cxl: sysfs.c:  Remove unused function
@ 2014-12-20 16:13 Rickard Strandqvist
  2014-12-21  4:05 ` Michael Neuling
  0 siblings, 1 reply; 4+ messages in thread
From: Rickard Strandqvist @ 2014-12-20 16:13 UTC (permalink / raw)
  To: Ian Munsie, Michael Neuling
  Cc: linuxppc-dev, linux-kernel, Rickard Strandqvist

Remove the function mmio_size_show() 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>
---
 drivers/misc/cxl/sysfs.c |   11 -----------
 1 file changed, 11 deletions(-)

diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
index ce7ec06..0431ec3 100644
--- a/drivers/misc/cxl/sysfs.c
+++ b/drivers/misc/cxl/sysfs.c
@@ -102,17 +102,6 @@ static struct device_attribute afu_master_attrs[] = {
 
 /*********  AFU attributes  **************************************************/
 
-static ssize_t mmio_size_show(struct device *device,
-			      struct device_attribute *attr,
-			      char *buf)
-{
-	struct cxl_afu *afu = to_cxl_afu(device);
-
-	if (afu->pp_size)
-		return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size);
-	return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size);
-}
-
 static ssize_t reset_store_afu(struct device *device,
 			       struct device_attribute *attr,
 			       const char *buf, size_t count)
-- 
1.7.10.4

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

* Re: [PATCH] misc: cxl: sysfs.c:  Remove unused function
  2014-12-20 16:13 [PATCH] misc: cxl: sysfs.c: Remove unused function Rickard Strandqvist
@ 2014-12-21  4:05 ` Michael Neuling
  2014-12-21 12:46   ` Rickard Strandqvist
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Neuling @ 2014-12-21  4:05 UTC (permalink / raw)
  To: Rickard Strandqvist; +Cc: linuxppc-dev, Ian Munsie, linux-kernel

> Remove the function mmio_size_show() that is not used anywhere.

Did you compile check this patch?

  drivers/misc/cxl/sysfs.c:291:74: error: =E2=80=98mmio_size_show=E2=80=99 =
undeclared here (not in a function)

It's used here:
        static struct device_attribute afu_attrs[] =3D {
        	__ATTR_RO(mmio_size),

> This was partially found by using a static code analysis program called c=
ppcheck.

Thanks for letting me know which tool to avoid :-)

Mikey


>=20
> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.s=
e>
> ---
>  drivers/misc/cxl/sysfs.c |   11 -----------
>  1 file changed, 11 deletions(-)
>=20
> diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
> index ce7ec06..0431ec3 100644
> --- a/drivers/misc/cxl/sysfs.c
> +++ b/drivers/misc/cxl/sysfs.c
> @@ -102,17 +102,6 @@ static struct device_attribute afu_master_attrs[] =
=3D {
> =20
>  /*********  AFU attributes  ********************************************=
******/
> =20
> -static ssize_t mmio_size_show(struct device *device,
> -			      struct device_attribute *attr,
> -			      char *buf)
> -{
> -	struct cxl_afu *afu =3D to_cxl_afu(device);
> -
> -	if (afu->pp_size)
> -		return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size);
> -	return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size);
> -}
> -
>  static ssize_t reset_store_afu(struct device *device,
>  			       struct device_attribute *attr,
>  			       const char *buf, size_t count)

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

* Re: [PATCH] misc: cxl: sysfs.c: Remove unused function
  2014-12-21  4:05 ` Michael Neuling
@ 2014-12-21 12:46   ` Rickard Strandqvist
  2014-12-22  3:55     ` Michael Ellerman
  0 siblings, 1 reply; 4+ messages in thread
From: Rickard Strandqvist @ 2014-12-21 12:46 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev, Ian Munsie, linux-kernel@vger.kernel.org

2014-12-21 5:05 GMT+01:00 Michael Neuling <mikey@neuling.org>:
>> Remove the function mmio_size_show() that is not used anywhere.
>
> Did you compile check this patch?
>
>   drivers/misc/cxl/sysfs.c:291:74: error: =E2=80=98mmio_size_show=E2=80=
=99 undeclared here (not in a function)
>
> It's used here:
>         static struct device_attribute afu_attrs[] =3D {
>                 __ATTR_RO(mmio_size),
>
>> This was partially found by using a static code analysis program called =
cppcheck.
>
> Thanks for letting me know which tool to avoid :-)
>
> Mikey
>
>
>>
>> Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.=
se>
>> ---
>>  drivers/misc/cxl/sysfs.c |   11 -----------
>>  1 file changed, 11 deletions(-)
>>
>> diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
>> index ce7ec06..0431ec3 100644
>> --- a/drivers/misc/cxl/sysfs.c
>> +++ b/drivers/misc/cxl/sysfs.c
>> @@ -102,17 +102,6 @@ static struct device_attribute afu_master_attrs[] =
=3D {
>>
>>  /*********  AFU attributes  *******************************************=
*******/
>>
>> -static ssize_t mmio_size_show(struct device *device,
>> -                           struct device_attribute *attr,
>> -                           char *buf)
>> -{
>> -     struct cxl_afu *afu =3D to_cxl_afu(device);
>> -
>> -     if (afu->pp_size)
>> -             return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->pp_size);
>> -     return scnprintf(buf, PAGE_SIZE, "%llu\n", afu->adapter->ps_size);
>> -}
>> -
>>  static ssize_t reset_store_afu(struct device *device,
>>                              struct device_attribute *attr,
>>                              const char *buf, size_t count)
>


Hi

Sorry about that.

Strange because I compile everything as allyesconfig, allmodconfig and
allnoconfig.

Kind regards
Rickard Strandqvist

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

* Re: [PATCH] misc: cxl: sysfs.c: Remove unused function
  2014-12-21 12:46   ` Rickard Strandqvist
@ 2014-12-22  3:55     ` Michael Ellerman
  0 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2014-12-22  3:55 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Michael Neuling, linuxppc-dev, Ian Munsie,
	linux-kernel@vger.kernel.org

On Sun, 2014-12-21 at 13:46 +0100, Rickard Strandqvist wrote:
> 2014-12-21 5:05 GMT+01:00 Michael Neuling <mikey@neuling.org>:
> >> Remove the function mmio_size_show() that is not used anywhere.
> >
> > Did you compile check this patch?
> >
> >   drivers/misc/cxl/sysfs.c:291:74: error: ‘mmio_size_show’ undeclared here (not in a function)
> >
> > It's used here:
> >         static struct device_attribute afu_attrs[] = {
> >                 __ATTR_RO(mmio_size),
> 
> Hi
> 
> Sorry about that.
> 
> Strange because I compile everything as allyesconfig, allmodconfig and
> allnoconfig.

The allyes should have picked it up, so you must have done something wrong.

Please be more careful with these attribute routines, they are not visible with
grep.

cheers

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

end of thread, other threads:[~2014-12-22  3:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-20 16:13 [PATCH] misc: cxl: sysfs.c: Remove unused function Rickard Strandqvist
2014-12-21  4:05 ` Michael Neuling
2014-12-21 12:46   ` Rickard Strandqvist
2014-12-22  3:55     ` 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).