Skip to content

Commit

Permalink
PNP: isapnp: remove defined but not used function 'isapnp_checksum'
Browse files Browse the repository at this point in the history
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 04c589f ("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: 04c589f ("PNP: isapnp: remove set but not used variable 'checksum'")
Signed-off-by: yu kuai <[email protected]>
Signed-off-by: Rafael J. Wysocki <[email protected]>
  • Loading branch information
yu kuai authored and rafaeljw committed Jan 22, 2020
1 parent 04c589f commit 786c87c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions drivers/pnp/isapnp/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down

0 comments on commit 786c87c

Please sign in to comment.