LKML Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] PNP: isapnp: remove set but not used variable 'checksum'
@ 2020-01-03 12:17 yu kuai
  2020-01-15 10:56 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: yu kuai @ 2020-01-03 12:17 UTC (permalink / raw)
  To: perex, rafael.j.wysocki; +Cc: linux-kernel, yukuai3, yi.zhang, zhengbin13

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 <yukuai3@huawei.com>
---
 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);
-- 
2.17.2


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

* Re: [PATCH] PNP: isapnp: remove set but not used variable 'checksum'
  2020-01-03 12:17 [PATCH] PNP: isapnp: remove set but not used variable 'checksum' yu kuai
@ 2020-01-15 10:56 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2020-01-15 10:56 UTC (permalink / raw)
  To: yu kuai; +Cc: perex, linux-kernel, yi.zhang, zhengbin13, linux-acpi

On 1/3/2020 1:17 PM, yu kuai wrote:
> 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 <yukuai3@huawei.com>
> ---
>   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);

Applied as 5.6 material, thanks!

Note that it is recommended to CC patches that touch the PNP code to 
linux-acpi@vger.kernel.org



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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-03 12:17 [PATCH] PNP: isapnp: remove set but not used variable 'checksum' yu kuai
2020-01-15 10:56 ` Rafael J. Wysocki

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git
	git clone --mirror https://lore.kernel.org/lkml/7 lkml/git/7.git
	git clone --mirror https://lore.kernel.org/lkml/8 lkml/git/8.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org
	public-inbox-index lkml

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git