linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PNP: isapnp: remove defined but not used function 'isapnp_checksum'
@ 2020-01-20  1:23 yu kuai
  2020-01-22 23:28 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: yu kuai @ 2020-01-20  1:23 UTC (permalink / raw)
  To: perex, rafael.j.wysocki
  Cc: linux-acpi, linux-kernel, yukuai3, yi.zhang, zhengbin13

Fix gcc '-Wunused-function' warnning:

drivers/pnp/isapnp/core.c:752:29: warning: 'isapnp_checksum' defined but
not used [-Wunused-function]
752 | static unsigned char __init isapnp_checksum(unsigned char *data)

Commit 04c589f35bc5 ("PNP: isapnp: remove set but not used variable
'checksum'") removes the last caller of the function. It is never used
and so can be removed.

Fixes: 04c589f35bc5 ("PNP: isapnp: remove set but not used variable 'checksum'")
Signed-off-by: yu kuai <yukuai3@huawei.com>
---
 drivers/pnp/isapnp/core.c | 22 ----------------------
 1 file changed, 22 deletions(-)

diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
index 179b737280e1..6c457006e84b 100644
--- a/drivers/pnp/isapnp/core.c
+++ b/drivers/pnp/isapnp/core.c
@@ -746,28 +746,6 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card)
 	}
 }
 
-/*
- *  Compute ISA PnP checksum for first eight bytes.
- */
-static unsigned char __init isapnp_checksum(unsigned char *data)
-{
-	int i, j;
-	unsigned char checksum = 0x6a, bit, b;
-
-	for (i = 0; i < 8; i++) {
-		b = data[i];
-		for (j = 0; j < 8; j++) {
-			bit = 0;
-			if (b & (1 << j))
-				bit = 1;
-			checksum =
-			    ((((checksum ^ (checksum >> 1)) & 0x01) ^ bit) << 7)
-			    | (checksum >> 1);
-		}
-	}
-	return checksum;
-}
-
 /*
  *  Build device list for all present ISA PnP devices.
  */
-- 
2.17.2


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

* Re: [PATCH] PNP: isapnp: remove defined but not used function 'isapnp_checksum'
  2020-01-20  1:23 [PATCH] PNP: isapnp: remove defined but not used function 'isapnp_checksum' yu kuai
@ 2020-01-22 23:28 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-01-22 23:28 UTC (permalink / raw)
  To: yu kuai
  Cc: Jaroslav Kysela, Rafael Wysocki, ACPI Devel Maling List,
	Linux Kernel Mailing List, yi.zhang, zhengbin13

On Mon, Jan 20, 2020 at 2:24 AM yu kuai <yukuai3@huawei.com> wrote:
>
> Fix gcc '-Wunused-function' warnning:
>
> drivers/pnp/isapnp/core.c:752:29: warning: 'isapnp_checksum' defined but
> not used [-Wunused-function]
> 752 | static unsigned char __init isapnp_checksum(unsigned char *data)
>
> Commit 04c589f35bc5 ("PNP: isapnp: remove set but not used variable
> 'checksum'") removes the last caller of the function. It is never used
> and so can be removed.
>
> Fixes: 04c589f35bc5 ("PNP: isapnp: remove set but not used variable 'checksum'")
> Signed-off-by: yu kuai <yukuai3@huawei.com>
> ---
>  drivers/pnp/isapnp/core.c | 22 ----------------------
>  1 file changed, 22 deletions(-)
>
> diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c
> index 179b737280e1..6c457006e84b 100644
> --- a/drivers/pnp/isapnp/core.c
> +++ b/drivers/pnp/isapnp/core.c
> @@ -746,28 +746,6 @@ static void __init isapnp_parse_resource_map(struct pnp_card *card)
>         }
>  }
>
> -/*
> - *  Compute ISA PnP checksum for first eight bytes.
> - */
> -static unsigned char __init isapnp_checksum(unsigned char *data)
> -{
> -       int i, j;
> -       unsigned char checksum = 0x6a, bit, b;
> -
> -       for (i = 0; i < 8; i++) {
> -               b = data[i];
> -               for (j = 0; j < 8; j++) {
> -                       bit = 0;
> -                       if (b & (1 << j))
> -                               bit = 1;
> -                       checksum =
> -                           ((((checksum ^ (checksum >> 1)) & 0x01) ^ bit) << 7)
> -                           | (checksum >> 1);
> -               }
> -       }
> -       return checksum;
> -}
> -
>  /*
>   *  Build device list for all present ISA PnP devices.
>   */
> --

Applied, thanks!

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

end of thread, other threads:[~2020-01-22 23:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20  1:23 [PATCH] PNP: isapnp: remove defined but not used function 'isapnp_checksum' yu kuai
2020-01-22 23:28 ` Rafael J. Wysocki

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