linux-staging.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Philipp Hortmann <philipp.g.hortmann@gmail.com>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/5] staging: rtl8192e: Remove unused local variable irq_line
Date: Thu, 6 Apr 2023 22:06:31 +0200	[thread overview]
Message-ID: <ZC8mR9OjVlEdDMV-@kroah.com> (raw)
In-Reply-To: <6ec702e12cb30501fc81693a71a96b238bf09ea0.1680729716.git.philipp.g.hortmann@gmail.com>

On Wed, Apr 05, 2023 at 11:48:20PM +0200, Philipp Hortmann wrote:
> Remove unused local variable irq_line.
> 
> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
> ---
>  drivers/staging/rtl8192e/rtl8192e/rtl_pci.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
> index 0bc3e013001e..1c3ccd2aabc3 100644
> --- a/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
> +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_pci.c
> @@ -33,11 +33,9 @@ bool rtl92e_check_adapter(struct pci_dev *pdev, struct net_device *dev)
>  	struct r8192_priv *priv = (struct r8192_priv *)rtllib_priv(dev);
>  	u16 device_id;
>  	u8  revision_id;
> -	u16 irq_line;
>  
>  	device_id = pdev->device;
>  	revision_id = pdev->revision;
> -	pci_read_config_word(pdev, 0x3C, &irq_line);

As was pointed out, that might not be "unused".

When doing a PCI write, the only way to know it has completed is to
issue a read.  Are you sure this isn't a read that is flushing out a
pending write?  Look at who calls this function and verify that this
read really is safe to remove and then document that really really well
in the changelog text when doing so.

Be careful about removing seemingly-unused PCI read/writes, they often
times are actually needed.

thanks,

greg k-h

  parent reply	other threads:[~2023-04-06 20:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-05 21:47 [PATCH 0/5] staging: rtl8192e: Remove unused code for hardware rtl8192se Philipp Hortmann
2023-04-05 21:48 ` [PATCH 1/5] staging: rtl8192e: Remove macro IS_HARDWARE_TYPE_8192SE Philipp Hortmann
2023-04-05 21:48 ` [PATCH 2/5] staging: rtl8192e: Remove unused function _rtl92e_dm_init_wa_broadcom_iot Philipp Hortmann
2023-04-05 21:48 ` [PATCH 3/5] staging: rtl8192e: Remove one of two checks for hardware RTL8192SE Philipp Hortmann
2023-04-05 21:48 ` [PATCH 4/5] staging: rtl8192e: Remove unused local variable irq_line Philipp Hortmann
2023-04-06 19:54   ` Alison Schofield
2023-04-06 20:06   ` Greg Kroah-Hartman [this message]
2023-04-07  8:08     ` Philipp Hortmann
2023-04-07  8:20       ` Greg Kroah-Hartman
2023-04-05 21:48 ` [PATCH 5/5] staging: rtl8192e: Remove unused variable RF_Type Philipp Hortmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZC8mR9OjVlEdDMV-@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=philipp.g.hortmann@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).