Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1609167 > unrolled thread

[PATCH 0/6] hpet: misc fix

Started byCorentin Labbe <clabbe.montjoie@gmail.com>
First post2017-03-25 15:50 +0100
Last post2017-03-25 15:50 +0100
Articles 7 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/6] hpet: misc fix Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-25 15:50 +0100
    [PATCH 2/6] hpet: remove unused writeq/readq function definitions Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-25 15:50 +0100
      Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions kbuild test robot <lkp@intel.com> - 2017-03-27 02:00 +0200
        Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-27 10:00 +0200
          Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions Clemens Ladisch <clemens@ladisch.de> - 2017-03-27 10:10 +0200
            Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-27 11:00 +0200
    [PATCH 1/6] hpet: remove unused variable hpet in hpet_ioctl_common Corentin Labbe <clabbe.montjoie@gmail.com> - 2017-03-25 15:50 +0100

#1609167 — [PATCH 0/6] hpet: misc fix

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-03-25 15:50 +0100
Subject[PATCH 0/6] hpet: misc fix
Message-ID<toVaW-2cv-3@gated-at.bofh.it>
The original intent was to remove two build warnings, but finaly took
the opportunity to fix some style issues.
compile-tested for both x86/ia64.

Corentin Labbe (6):
  hpet: remove unused variable hpet in hpet_ioctl_common
  hpet: remove unused writeq/readq function definitons
  hpet: fix checkpatch complains about spaces
  hpet: replace printk by their pr_xxx counterparts
  hpet: removing unused variable m in hpet_interrupt
  hpet: fix style issue about braces and alignment

 drivers/char/hpet.c | 56 +++++++++++++++++------------------------------------
 1 file changed, 18 insertions(+), 38 deletions(-)

-- 
2.10.2

[toc] | [next] | [standalone]


#1609168 — [PATCH 2/6] hpet: remove unused writeq/readq function definitions

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-03-25 15:50 +0100
Subject[PATCH 2/6] hpet: remove unused writeq/readq function definitions
Message-ID<toVaW-2cv-15@gated-at.bofh.it>
In reply to#1609167
hpet is availlable only on x86/ia64 and thoses arch both provides
readq/writeq functions.
So this patch remove unused writeq/readq function definitions in hpet.c

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/char/hpet.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index f0e6427..a22543d 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -123,22 +123,6 @@ static struct hpets *hpets;
 #define	HPET_PERIODIC		0x0004
 #define	HPET_SHARED_IRQ		0x0008
 
-
-#ifndef readq
-static inline unsigned long long readq(void __iomem *addr)
-{
-	return readl(addr) | (((unsigned long long)readl(addr + 4)) << 32LL);
-}
-#endif
-
-#ifndef writeq
-static inline void writeq(unsigned long long v, void __iomem *addr)
-{
-	writel(v & 0xffffffff, addr);
-	writel(v >> 32, addr + 4);
-}
-#endif
-
 static irqreturn_t hpet_interrupt(int irq, void *data)
 {
 	struct hpet_dev *devp;
-- 
2.10.2

[toc] | [prev] | [next] | [standalone]


#1609419 — Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions

Fromkbuild test robot <lkp@intel.com>
Date2017-03-27 02:00 +0200
SubjectRe: [PATCH 2/6] hpet: remove unused writeq/readq function definitions
Message-ID<tpqeJ-7qW-7@gated-at.bofh.it>
In reply to#1609168

[Multipart message — attachments visible in raw view] — view raw

Hi Corentin,

[auto build test ERROR on char-misc/char-misc-testing]
[also build test ERROR on v4.11-rc4 next-20170324]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Corentin-Labbe/hpet-misc-fix/20170327-070101
config: i386-randconfig-x017-201713 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers//char/hpet.c: In function 'hpet_timer_set_irq':
>> drivers//char/hpet.c:207:7: error: implicit declaration of function 'readq' [-Werror=implicit-function-declaration]
     v = (readq(&timer->hpet_config) & Tn_INT_ROUTE_CAP_MASK) >>
          ^~~~~
   drivers//char/hpet.c: In function 'hpet_release':
>> drivers//char/hpet.c:413:2: error: implicit declaration of function 'writeq' [-Werror=implicit-function-declaration]
     writeq((readq(&timer->hpet_config) & ~Tn_INT_ENB_CNF_MASK),
     ^~~~~~
   cc1: some warnings being treated as errors

vim +/readq +207 drivers//char/hpet.c

70ef6d59 Kevin Hao 2008-05-29  191  	spin_lock_irq(&hpet_lock);
70ef6d59 Kevin Hao 2008-05-29  192  	if (devp->hd_hdwirq) {
70ef6d59 Kevin Hao 2008-05-29  193  		spin_unlock_irq(&hpet_lock);
70ef6d59 Kevin Hao 2008-05-29  194  		return;
70ef6d59 Kevin Hao 2008-05-29  195  	}
70ef6d59 Kevin Hao 2008-05-29  196  
70ef6d59 Kevin Hao 2008-05-29  197  	timer = devp->hd_timer;
70ef6d59 Kevin Hao 2008-05-29  198  
70ef6d59 Kevin Hao 2008-05-29  199  	/* we prefer level triggered mode */
70ef6d59 Kevin Hao 2008-05-29  200  	v = readl(&timer->hpet_config);
70ef6d59 Kevin Hao 2008-05-29  201  	if (!(v & Tn_INT_TYPE_CNF_MASK)) {
70ef6d59 Kevin Hao 2008-05-29  202  		v |= Tn_INT_TYPE_CNF_MASK;
70ef6d59 Kevin Hao 2008-05-29  203  		writel(v, &timer->hpet_config);
70ef6d59 Kevin Hao 2008-05-29  204  	}
70ef6d59 Kevin Hao 2008-05-29  205  	spin_unlock_irq(&hpet_lock);
70ef6d59 Kevin Hao 2008-05-29  206  
70ef6d59 Kevin Hao 2008-05-29 @207  	v = (readq(&timer->hpet_config) & Tn_INT_ROUTE_CAP_MASK) >>
70ef6d59 Kevin Hao 2008-05-29  208  				 Tn_INT_ROUTE_CAP_SHIFT;
70ef6d59 Kevin Hao 2008-05-29  209  
70ef6d59 Kevin Hao 2008-05-29  210  	/*
70ef6d59 Kevin Hao 2008-05-29  211  	 * In PIC mode, skip IRQ0-4, IRQ6-9, IRQ12-15 which is always used by
70ef6d59 Kevin Hao 2008-05-29  212  	 * legacy device. In IO APIC mode, we skip all the legacy IRQS.
70ef6d59 Kevin Hao 2008-05-29  213  	 */
70ef6d59 Kevin Hao 2008-05-29  214  	if (acpi_irq_model == ACPI_IRQ_MODEL_PIC)
70ef6d59 Kevin Hao 2008-05-29  215  		v &= ~0xf3df;

:::::: The code at line 207 was first introduced by commit
:::::: 70ef6d595b6e51618a0cbe44b848d8c9db11a010 x86: get irq for hpet timer

:::::: TO: Kevin Hao <kexin.hao@windriver.com>
:::::: CC: Ingo Molnar <mingo@elte.hu>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[toc] | [prev] | [next] | [standalone]


#1609543 — Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-03-27 10:00 +0200
SubjectRe: [PATCH 2/6] hpet: remove unused writeq/readq function definitions
Message-ID<tpxJg-4EH-25@gated-at.bofh.it>
In reply to#1609419
On Mon, Mar 27, 2017 at 07:49:34AM +0800, kbuild test robot wrote:
> Hi Corentin,
> 
> [auto build test ERROR on char-misc/char-misc-testing]
> [also build test ERROR on v4.11-rc4 next-20170324]
> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
> 
> url:    https://github.com/0day-ci/linux/commits/Corentin-Labbe/hpet-misc-fix/20170327-070101
> config: i386-randconfig-x017-201713 (attached as .config)
> compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
> reproduce:
>         # save the attached .config to linux build tree
>         make ARCH=i386 
> 
> All errors (new ones prefixed by >>):
> 
>    drivers//char/hpet.c: In function 'hpet_timer_set_irq':
> >> drivers//char/hpet.c:207:7: error: implicit declaration of function 'readq' [-Werror=implicit-function-declaration]
>      v = (readq(&timer->hpet_config) & Tn_INT_ROUTE_CAP_MASK) >>
>           ^~~~~
>    drivers//char/hpet.c: In function 'hpet_release':
> >> drivers//char/hpet.c:413:2: error: implicit declaration of function 'writeq' [-Werror=implicit-function-declaration]
>      writeq((readq(&timer->hpet_config) & ~Tn_INT_ENB_CNF_MASK),
>      ^~~~~~
>    cc1: some warnings being treated as errors
> 
> vim +/readq +207 drivers//char/hpet.c
> 
> 70ef6d59 Kevin Hao 2008-05-29  191  	spin_lock_irq(&hpet_lock);
> 70ef6d59 Kevin Hao 2008-05-29  192  	if (devp->hd_hdwirq) {
> 70ef6d59 Kevin Hao 2008-05-29  193  		spin_unlock_irq(&hpet_lock);
> 70ef6d59 Kevin Hao 2008-05-29  194  		return;
> 70ef6d59 Kevin Hao 2008-05-29  195  	}
> 70ef6d59 Kevin Hao 2008-05-29  196  
> 70ef6d59 Kevin Hao 2008-05-29  197  	timer = devp->hd_timer;
> 70ef6d59 Kevin Hao 2008-05-29  198  
> 70ef6d59 Kevin Hao 2008-05-29  199  	/* we prefer level triggered mode */
> 70ef6d59 Kevin Hao 2008-05-29  200  	v = readl(&timer->hpet_config);
> 70ef6d59 Kevin Hao 2008-05-29  201  	if (!(v & Tn_INT_TYPE_CNF_MASK)) {
> 70ef6d59 Kevin Hao 2008-05-29  202  		v |= Tn_INT_TYPE_CNF_MASK;
> 70ef6d59 Kevin Hao 2008-05-29  203  		writel(v, &timer->hpet_config);
> 70ef6d59 Kevin Hao 2008-05-29  204  	}
> 70ef6d59 Kevin Hao 2008-05-29  205  	spin_unlock_irq(&hpet_lock);
> 70ef6d59 Kevin Hao 2008-05-29  206  
> 70ef6d59 Kevin Hao 2008-05-29 @207  	v = (readq(&timer->hpet_config) & Tn_INT_ROUTE_CAP_MASK) >>
> 70ef6d59 Kevin Hao 2008-05-29  208  				 Tn_INT_ROUTE_CAP_SHIFT;
> 70ef6d59 Kevin Hao 2008-05-29  209  
> 70ef6d59 Kevin Hao 2008-05-29  210  	/*
> 70ef6d59 Kevin Hao 2008-05-29  211  	 * In PIC mode, skip IRQ0-4, IRQ6-9, IRQ12-15 which is always used by
> 70ef6d59 Kevin Hao 2008-05-29  212  	 * legacy device. In IO APIC mode, we skip all the legacy IRQS.
> 70ef6d59 Kevin Hao 2008-05-29  213  	 */
> 70ef6d59 Kevin Hao 2008-05-29  214  	if (acpi_irq_model == ACPI_IRQ_MODEL_PIC)
> 70ef6d59 Kevin Hao 2008-05-29  215  		v &= ~0xf3df;
> 
> :::::: The code at line 207 was first introduced by commit
> :::::: 70ef6d595b6e51618a0cbe44b848d8c9db11a010 x86: get irq for hpet timer
> 
> :::::: TO: Kevin Hao <kexin.hao@windriver.com>
> :::::: CC: Ingo Molnar <mingo@elte.hu>
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Wrongly believed that x86 and x86_64 shared writeq/readq.
Sorry, I will drop this patch

Since the writeq/readq redefined is present in lots of other file, perhaps adding it to i386 could be done.

Regards

[toc] | [prev] | [next] | [standalone]


#1609556 — Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions

FromClemens Ladisch <clemens@ladisch.de>
Date2017-03-27 10:10 +0200
SubjectRe: [PATCH 2/6] hpet: remove unused writeq/readq function definitions
Message-ID<tpxSW-4Xx-23@gated-at.bofh.it>
In reply to#1609543
Corentin Labbe wrote:
> On Mon, Mar 27, 2017 at 07:49:34AM +0800, kbuild test robot wrote:
>>    drivers//char/hpet.c: In function 'hpet_timer_set_irq':
>>>> drivers//char/hpet.c:207:7: error: implicit declaration of function 'readq' [-Werror=implicit-function-declaration]
>
> Wrongly believed that x86 and x86_64 shared writeq/readq.
> Sorry, I will drop this patch
>
> Since the writeq/readq redefined is present in lots of other file, perhaps adding it to i386 could be done.

Just use <linux/io-64-nonatomic-lo-hi.h> instead.


Regards,
Clemens

[toc] | [prev] | [next] | [standalone]


#1609592 — Re: [PATCH 2/6] hpet: remove unused writeq/readq function definitions

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-03-27 11:00 +0200
SubjectRe: [PATCH 2/6] hpet: remove unused writeq/readq function definitions
Message-ID<tpyFk-5la-33@gated-at.bofh.it>
In reply to#1609556
On Mon, Mar 27, 2017 at 09:51:23AM +0200, Clemens Ladisch wrote:
> Corentin Labbe wrote:
> > On Mon, Mar 27, 2017 at 07:49:34AM +0800, kbuild test robot wrote:
> >>    drivers//char/hpet.c: In function 'hpet_timer_set_irq':
> >>>> drivers//char/hpet.c:207:7: error: implicit declaration of function 'readq' [-Werror=implicit-function-declaration]
> >
> > Wrongly believed that x86 and x86_64 shared writeq/readq.
> > Sorry, I will drop this patch
> >
> > Since the writeq/readq redefined is present in lots of other file, perhaps adding it to i386 could be done.
> 
> Just use <linux/io-64-nonatomic-lo-hi.h> instead.
> 

Thanks, much easier than add writeq/readq to whole x86

Regards

[toc] | [prev] | [next] | [standalone]


#1609170 — [PATCH 1/6] hpet: remove unused variable hpet in hpet_ioctl_common

FromCorentin Labbe <clabbe.montjoie@gmail.com>
Date2017-03-25 15:50 +0100
Subject[PATCH 1/6] hpet: remove unused variable hpet in hpet_ioctl_common
Message-ID<toVaW-2cv-21@gated-at.bofh.it>
In reply to#1609167
This patch fix the following warning:
drivers/char/hpet.c:582:23: attention : variable ‘hpet’ set but not used [-Wunused-but-set-variable]
by removing the unused variable hpet in hpet_ioctl_common

Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
---
 drivers/char/hpet.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index b941e6d..f0e6427 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
@@ -579,7 +579,6 @@ hpet_ioctl_common(struct hpet_dev *devp, unsigned int cmd, unsigned long arg,
 		  struct hpet_info *info)
 {
 	struct hpet_timer __iomem *timer;
-	struct hpet __iomem *hpet;
 	struct hpets *hpetp;
 	int err;
 	unsigned long v;
@@ -591,7 +590,6 @@ hpet_ioctl_common(struct hpet_dev *devp, unsigned int cmd, unsigned long arg,
 	case HPET_DPI:
 	case HPET_IRQFREQ:
 		timer = devp->hd_timer;
-		hpet = devp->hd_hpet;
 		hpetp = devp->hd_hpets;
 		break;
 	case HPET_IE_ON:
-- 
2.10.2

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web