From 04c589f35bc57d2f2495fc065ad2ac0ee271ce93 Mon Sep 17 00:00:00 2001 From: yu kuai Date: Fri, 3 Jan 2020 20:17:10 +0800 Subject: PNP: isapnp: remove set but not used variable 'checksum' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes gcc '-Wunused-but-set-variable' warning: drivers/pnp/isapnp/core.c: In function ‘isapnp_build_device_list’: drivers/pnp/isapnp/core.c:777:27: warning: variable ‘checksum’ set but not used [-Wunused-but-set-variable] It is never used, and so can be removed. Signed-off-by: yu kuai Signed-off-by: Rafael J. Wysocki --- drivers/pnp/isapnp/core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/pnp/isapnp/core.c b/drivers/pnp/isapnp/core.c index 179b737280e1..e39d49bceae0 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -774,7 +774,7 @@ static unsigned char __init isapnp_checksum(unsigned char *data) static int __init isapnp_build_device_list(void) { int csn; - unsigned char header[9], checksum; + unsigned char header[9]; struct pnp_card *card; u32 eisa_id; char id[8]; @@ -784,7 +784,6 @@ static int __init isapnp_build_device_list(void) for (csn = 1; csn <= isapnp_csn_count; csn++) { isapnp_wake(csn); isapnp_peek(header, 9); - checksum = isapnp_checksum(header); eisa_id = header[0] | header[1] << 8 | header[2] << 16 | header[3] << 24; pnp_eisa_id_to_string(eisa_id, id); -- cgit v1.2.3 From 786c87cd312ad2ec774bc4606834b06844dada6c Mon Sep 17 00:00:00 2001 From: yu kuai Date: Mon, 20 Jan 2020 09:23:31 +0800 Subject: PNP: isapnp: remove defined but not used function 'isapnp_checksum' 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 Signed-off-by: Rafael J. Wysocki --- 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 e39d49bceae0..c43d8ad02529 100644 --- a/drivers/pnp/isapnp/core.c +++ b/drivers/pnp/isapnp/core.c @@ -746,28 +746,6 @@ __skip: } } -/* - * 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. */ -- cgit v1.2.3