linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hpet: Drop unused variable 'm' in hpet_interrupt()
@ 2019-07-11 13:32 Kefeng Wang
  2019-07-25 12:34 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 2+ messages in thread
From: Kefeng Wang @ 2019-07-11 13:32 UTC (permalink / raw)
  To: Clemens Ladisch, Arnd Bergmann, Greg Kroah-Hartman, linux-kernel
  Cc: wangkefeng.wang

../drivers/char/hpet.c:159:17: warning: variable ‘m’ set but not used
[-Wunused-but-set-variable]
   unsigned long m, t, mc, base, k;
                 ^
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/char/hpet.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index 9ac6671bb514..039398cb14aa 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -156,12 +156,11 @@ static irqreturn_t hpet_interrupt(int irq, void *data)
 	 * This has the effect of treating non-periodic like periodic.
 	 */
 	if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) {
-		unsigned long m, t, mc, base, k;
+		unsigned long t, mc, base, k;
 		struct hpet __iomem *hpet = devp->hd_hpet;
 		struct hpets *hpetp = devp->hd_hpets;
 
 		t = devp->hd_ireqfreq;
-		m = read_counter(&devp->hd_timer->hpet_compare);
 		mc = read_counter(&hpet->hpet_mc);
 		/* The time for the next interrupt would logically be t + m,
 		 * however, if we are very unlucky and the interrupt is delayed
-- 
2.20.1


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

* Re: [PATCH] hpet: Drop unused variable 'm' in hpet_interrupt()
  2019-07-11 13:32 [PATCH] hpet: Drop unused variable 'm' in hpet_interrupt() Kefeng Wang
@ 2019-07-25 12:34 ` Greg Kroah-Hartman
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-25 12:34 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: Clemens Ladisch, Arnd Bergmann, linux-kernel

On Thu, Jul 11, 2019 at 09:32:38PM +0800, Kefeng Wang wrote:
> ../drivers/char/hpet.c:159:17: warning: variable ‘m’ set but not used
> [-Wunused-but-set-variable]
>    unsigned long m, t, mc, base, k;
>                  ^
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  drivers/char/hpet.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
> index 9ac6671bb514..039398cb14aa 100644
> --- a/drivers/char/hpet.c
> +++ b/drivers/char/hpet.c
> @@ -156,12 +156,11 @@ static irqreturn_t hpet_interrupt(int irq, void *data)
>  	 * This has the effect of treating non-periodic like periodic.
>  	 */
>  	if ((devp->hd_flags & (HPET_IE | HPET_PERIODIC)) == HPET_IE) {
> -		unsigned long m, t, mc, base, k;
> +		unsigned long t, mc, base, k;
>  		struct hpet __iomem *hpet = devp->hd_hpet;
>  		struct hpets *hpetp = devp->hd_hpets;
>  
>  		t = devp->hd_ireqfreq;
> -		m = read_counter(&devp->hd_timer->hpet_compare);

Are you sure this is ok to remove?  You are reading from the hardware
here, and often times that is required in order to achive something
else.

So this function does not "do nothing", be careful and you will have to
test this before I can take it.

thanks,

greg k-h

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

end of thread, other threads:[~2019-07-25 12:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-11 13:32 [PATCH] hpet: Drop unused variable 'm' in hpet_interrupt() Kefeng Wang
2019-07-25 12:34 ` Greg Kroah-Hartman

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