[tip:efi/core] efi/capsule: Remove NULL test on kmap()

2017-06-05 Thread tip-bot for Fabian Frederick
Commit-ID:  171fd0222957abe28e6d78de667f457376f45cf1
Gitweb: http://git.kernel.org/tip/171fd0222957abe28e6d78de667f457376f45cf1
Author: Fabian Frederick 
AuthorDate: Fri, 2 Jun 2017 13:52:01 +
Committer:  Ingo Molnar 
CommitDate: Mon, 5 Jun 2017 17:50:40 +0200

efi/capsule: Remove NULL test on kmap()

kmap() can't fail.

Signed-off-by: Fabian Frederick 
Signed-off-by: Matt Fleming 
Signed-off-by: Ard Biesheuvel 
Cc: Kweh Hock Leong 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: linux-...@vger.kernel.org
Link: http://lkml.kernel.org/r/20170602135207.21708-8-ard.biesheu...@linaro.org
Signed-off-by: Ingo Molnar 
---
 drivers/firmware/efi/capsule-loader.c | 4 
 drivers/firmware/efi/capsule.c| 4 
 2 files changed, 8 deletions(-)

diff --git a/drivers/firmware/efi/capsule-loader.c 
b/drivers/firmware/efi/capsule-loader.c
index 5b012a4..2357bcd 100644
--- a/drivers/firmware/efi/capsule-loader.c
+++ b/drivers/firmware/efi/capsule-loader.c
@@ -170,10 +170,6 @@ static ssize_t efi_capsule_write(struct file *file, const 
char __user *buff,
page = cap_info->pages[cap_info->index - 1];
 
kbuff = kmap(page);
-   if (!kbuff) {
-   ret = -ENOMEM;
-   goto failed;
-   }
kbuff += PAGE_SIZE - cap_info->page_bytes_remain;
 
/* Copy capsule binary data from user space to kernel space buffer */
diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c
index 6eedff4..e603ccf 100644
--- a/drivers/firmware/efi/capsule.c
+++ b/drivers/firmware/efi/capsule.c
@@ -247,10 +247,6 @@ int efi_capsule_update(efi_capsule_header_t *capsule, 
struct page **pages)
efi_capsule_block_desc_t *sglist;
 
sglist = kmap(sg_pages[i]);
-   if (!sglist) {
-   rv = -ENOMEM;
-   goto out;
-   }
 
for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) {
u64 sz = min_t(u64, imagesize, PAGE_SIZE);


[tip:efi/core] efi/capsule: Remove NULL test on kmap()

2017-06-05 Thread tip-bot for Fabian Frederick
Commit-ID:  171fd0222957abe28e6d78de667f457376f45cf1
Gitweb: http://git.kernel.org/tip/171fd0222957abe28e6d78de667f457376f45cf1
Author: Fabian Frederick 
AuthorDate: Fri, 2 Jun 2017 13:52:01 +
Committer:  Ingo Molnar 
CommitDate: Mon, 5 Jun 2017 17:50:40 +0200

efi/capsule: Remove NULL test on kmap()

kmap() can't fail.

Signed-off-by: Fabian Frederick 
Signed-off-by: Matt Fleming 
Signed-off-by: Ard Biesheuvel 
Cc: Kweh Hock Leong 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: linux-...@vger.kernel.org
Link: http://lkml.kernel.org/r/20170602135207.21708-8-ard.biesheu...@linaro.org
Signed-off-by: Ingo Molnar 
---
 drivers/firmware/efi/capsule-loader.c | 4 
 drivers/firmware/efi/capsule.c| 4 
 2 files changed, 8 deletions(-)

diff --git a/drivers/firmware/efi/capsule-loader.c 
b/drivers/firmware/efi/capsule-loader.c
index 5b012a4..2357bcd 100644
--- a/drivers/firmware/efi/capsule-loader.c
+++ b/drivers/firmware/efi/capsule-loader.c
@@ -170,10 +170,6 @@ static ssize_t efi_capsule_write(struct file *file, const 
char __user *buff,
page = cap_info->pages[cap_info->index - 1];
 
kbuff = kmap(page);
-   if (!kbuff) {
-   ret = -ENOMEM;
-   goto failed;
-   }
kbuff += PAGE_SIZE - cap_info->page_bytes_remain;
 
/* Copy capsule binary data from user space to kernel space buffer */
diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c
index 6eedff4..e603ccf 100644
--- a/drivers/firmware/efi/capsule.c
+++ b/drivers/firmware/efi/capsule.c
@@ -247,10 +247,6 @@ int efi_capsule_update(efi_capsule_header_t *capsule, 
struct page **pages)
efi_capsule_block_desc_t *sglist;
 
sglist = kmap(sg_pages[i]);
-   if (!sglist) {
-   rv = -ENOMEM;
-   goto out;
-   }
 
for (j = 0; j < SGLIST_PER_PAGE && count > 0; j++) {
u64 sz = min_t(u64, imagesize, PAGE_SIZE);


[tip:x86/cleanups] x86, msr: Use seek definitions instead of hard-coded values

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  03452d27c6cd9cebb59a6bb0fb6bd8557916c263
Gitweb: http://git.kernel.org/tip/03452d27c6cd9cebb59a6bb0fb6bd8557916c263
Author: Fabian Frederick 
AuthorDate: Fri, 17 Oct 2014 22:01:59 +0200
Committer:  H. Peter Anvin 
CommitDate: Fri, 17 Oct 2014 13:40:55 -0700

x86, msr: Use seek definitions instead of hard-coded values

Replace 0/1 by SEEK_SET/SEEK_CUR.

Signed-off-by: Fabian Frederick 
Link: http://lkml.kernel.org/r/1413576120-27147-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin 
---
 arch/x86/kernel/msr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 826c8b0..113e707 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -52,11 +52,11 @@ static loff_t msr_seek(struct file *file, loff_t offset, 
int orig)
 
mutex_lock(>i_mutex);
switch (orig) {
-   case 0:
+   case SEEK_SET:
file->f_pos = offset;
ret = file->f_pos;
break;
-   case 1:
+   case SEEK_CUR:
file->f_pos += offset;
ret = file->f_pos;
break;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86, msr: Convert printk to pr_foo()

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  951a18c6fee5d2f6f5d7b5118776bf787bf9c351
Gitweb: http://git.kernel.org/tip/951a18c6fee5d2f6f5d7b5118776bf787bf9c351
Author: Fabian Frederick 
AuthorDate: Fri, 17 Oct 2014 22:01:50 +0200
Committer:  H. Peter Anvin 
CommitDate: Fri, 17 Oct 2014 13:40:54 -0700

x86, msr: Convert printk to pr_foo()

Also define pr_fmt.

Signed-off-by: Fabian Frederick 
Link: http://lkml.kernel.org/r/1413576110-27103-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin 
---
 arch/x86/kernel/msr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 6e4f77f..826c8b0 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -22,6 +22,8 @@
  * an SMP box will direct the access to CPU %d.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include 
 
 #include 
@@ -248,8 +250,7 @@ static int __init msr_init(void)
i = 0;
 
if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, "cpu/msr", _fops)) {
-   printk(KERN_ERR "msr: unable to get major %d for msr\n",
-  MSR_MAJOR);
+   pr_err("unable to get major %d for msr\n", MSR_MAJOR);
err = -EBUSY;
goto out;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86, msr: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  cba0fdbcff8b54c206c8e18898a55456959ed51a
Gitweb: http://git.kernel.org/tip/cba0fdbcff8b54c206c8e18898a55456959ed51a
Author: Fabian Frederick 
AuthorDate: Fri, 17 Oct 2014 22:01:38 +0200
Committer:  H. Peter Anvin 
CommitDate: Fri, 17 Oct 2014 13:40:53 -0700

x86, msr: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick 
Link: http://lkml.kernel.org/r/1413576099-27059-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin 
---
 arch/x86/kernel/msr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index c9603ac..6e4f77f 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -206,7 +206,7 @@ static int msr_device_create(int cpu)
 
dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL,
"msr%d", cpu);
-   return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+   return PTR_ERR_OR_ZERO(dev);
 }
 
 static void msr_device_destroy(int cpu)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86/simplefb: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  76ef0db72f8b74bb92e24775d9d7f5ab26352bec
Gitweb: http://git.kernel.org/tip/76ef0db72f8b74bb92e24775d9d7f5ab26352bec
Author: Fabian Frederick 
AuthorDate: Fri, 17 Oct 2014 22:01:05 +0200
Committer:  H. Peter Anvin 
CommitDate: Fri, 17 Oct 2014 13:40:52 -0700

x86/simplefb: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick 
Link: http://lkml.kernel.org/r/1413576066-26925-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin 
---
 arch/x86/kernel/sysfb_simplefb.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c
index 86179d4..764a29f 100644
--- a/arch/x86/kernel/sysfb_simplefb.c
+++ b/arch/x86/kernel/sysfb_simplefb.c
@@ -88,8 +88,5 @@ __init int create_simplefb(const struct screen_info *si,
 
pd = platform_device_register_resndata(NULL, "simple-framebuffer", 0,
   , 1, mode, sizeof(*mode));
-   if (IS_ERR(pd))
-   return PTR_ERR(pd);
-
-   return 0;
+   return PTR_ERR_OR_ZERO(pd);
 }
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86/sysfb: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  e8d95ce9705c6683f57dc146b8c726c4d2242a52
Gitweb: http://git.kernel.org/tip/e8d95ce9705c6683f57dc146b8c726c4d2242a52
Author: Fabian Frederick 
AuthorDate: Fri, 17 Oct 2014 22:00:53 +0200
Committer:  H. Peter Anvin 
CommitDate: Fri, 17 Oct 2014 13:40:52 -0700

x86/sysfb: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick 
Link: http://lkml.kernel.org/r/1413576053-26761-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin 
---
 arch/x86/kernel/sysfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/sysfb.c b/arch/x86/kernel/sysfb.c
index 193ec2c..160386e 100644
--- a/arch/x86/kernel/sysfb.c
+++ b/arch/x86/kernel/sysfb.c
@@ -67,7 +67,7 @@ static __init int sysfb_init(void)
 
pd = platform_device_register_resndata(NULL, name, 0,
   NULL, 0, si, sizeof(*si));
-   return IS_ERR(pd) ? PTR_ERR(pd) : 0;
+   return PTR_ERR_OR_ZERO(pd);
 }
 
 /* must execute after PCI subsystem for EFI quirks */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86, cpuid: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  cbda45a2d4798912637b5b792c1c7a97c8d8b080
Gitweb: http://git.kernel.org/tip/cbda45a2d4798912637b5b792c1c7a97c8d8b080
Author: Fabian Frederick 
AuthorDate: Fri, 17 Oct 2014 22:01:17 +0200
Committer:  H. Peter Anvin 
CommitDate: Fri, 17 Oct 2014 13:40:51 -0700

x86, cpuid: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick 
Link: http://lkml.kernel.org/r/1413576077-26969-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin 
---
 arch/x86/kernel/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 3225ae6c..83741a7 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -143,7 +143,7 @@ static int cpuid_device_create(int cpu)
 
dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL,
"cpu%d", cpu);
-   return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+   return PTR_ERR_OR_ZERO(dev);
 }
 
 static void cpuid_device_destroy(int cpu)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86, cpuid: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  cbda45a2d4798912637b5b792c1c7a97c8d8b080
Gitweb: http://git.kernel.org/tip/cbda45a2d4798912637b5b792c1c7a97c8d8b080
Author: Fabian Frederick f...@skynet.be
AuthorDate: Fri, 17 Oct 2014 22:01:17 +0200
Committer:  H. Peter Anvin h...@linux.intel.com
CommitDate: Fri, 17 Oct 2014 13:40:51 -0700

x86, cpuid: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick f...@skynet.be
Link: http://lkml.kernel.org/r/1413576077-26969-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin h...@linux.intel.com
---
 arch/x86/kernel/cpuid.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpuid.c b/arch/x86/kernel/cpuid.c
index 3225ae6c..83741a7 100644
--- a/arch/x86/kernel/cpuid.c
+++ b/arch/x86/kernel/cpuid.c
@@ -143,7 +143,7 @@ static int cpuid_device_create(int cpu)
 
dev = device_create(cpuid_class, NULL, MKDEV(CPUID_MAJOR, cpu), NULL,
cpu%d, cpu);
-   return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+   return PTR_ERR_OR_ZERO(dev);
 }
 
 static void cpuid_device_destroy(int cpu)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86/sysfb: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  e8d95ce9705c6683f57dc146b8c726c4d2242a52
Gitweb: http://git.kernel.org/tip/e8d95ce9705c6683f57dc146b8c726c4d2242a52
Author: Fabian Frederick f...@skynet.be
AuthorDate: Fri, 17 Oct 2014 22:00:53 +0200
Committer:  H. Peter Anvin h...@linux.intel.com
CommitDate: Fri, 17 Oct 2014 13:40:52 -0700

x86/sysfb: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick f...@skynet.be
Link: http://lkml.kernel.org/r/1413576053-26761-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin h...@linux.intel.com
---
 arch/x86/kernel/sysfb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/sysfb.c b/arch/x86/kernel/sysfb.c
index 193ec2c..160386e 100644
--- a/arch/x86/kernel/sysfb.c
+++ b/arch/x86/kernel/sysfb.c
@@ -67,7 +67,7 @@ static __init int sysfb_init(void)
 
pd = platform_device_register_resndata(NULL, name, 0,
   NULL, 0, si, sizeof(*si));
-   return IS_ERR(pd) ? PTR_ERR(pd) : 0;
+   return PTR_ERR_OR_ZERO(pd);
 }
 
 /* must execute after PCI subsystem for EFI quirks */
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86/simplefb: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  76ef0db72f8b74bb92e24775d9d7f5ab26352bec
Gitweb: http://git.kernel.org/tip/76ef0db72f8b74bb92e24775d9d7f5ab26352bec
Author: Fabian Frederick f...@skynet.be
AuthorDate: Fri, 17 Oct 2014 22:01:05 +0200
Committer:  H. Peter Anvin h...@linux.intel.com
CommitDate: Fri, 17 Oct 2014 13:40:52 -0700

x86/simplefb: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick f...@skynet.be
Link: http://lkml.kernel.org/r/1413576066-26925-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin h...@linux.intel.com
---
 arch/x86/kernel/sysfb_simplefb.c | 5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/x86/kernel/sysfb_simplefb.c b/arch/x86/kernel/sysfb_simplefb.c
index 86179d4..764a29f 100644
--- a/arch/x86/kernel/sysfb_simplefb.c
+++ b/arch/x86/kernel/sysfb_simplefb.c
@@ -88,8 +88,5 @@ __init int create_simplefb(const struct screen_info *si,
 
pd = platform_device_register_resndata(NULL, simple-framebuffer, 0,
   res, 1, mode, sizeof(*mode));
-   if (IS_ERR(pd))
-   return PTR_ERR(pd);
-
-   return 0;
+   return PTR_ERR_OR_ZERO(pd);
 }
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86, msr: Use PTR_ERR_OR_ZERO

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  cba0fdbcff8b54c206c8e18898a55456959ed51a
Gitweb: http://git.kernel.org/tip/cba0fdbcff8b54c206c8e18898a55456959ed51a
Author: Fabian Frederick f...@skynet.be
AuthorDate: Fri, 17 Oct 2014 22:01:38 +0200
Committer:  H. Peter Anvin h...@linux.intel.com
CommitDate: Fri, 17 Oct 2014 13:40:53 -0700

x86, msr: Use PTR_ERR_OR_ZERO

Replace IS_ERR/PTR_ERR

Signed-off-by: Fabian Frederick f...@skynet.be
Link: http://lkml.kernel.org/r/1413576099-27059-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin h...@linux.intel.com
---
 arch/x86/kernel/msr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index c9603ac..6e4f77f 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -206,7 +206,7 @@ static int msr_device_create(int cpu)
 
dev = device_create(msr_class, NULL, MKDEV(MSR_MAJOR, cpu), NULL,
msr%d, cpu);
-   return IS_ERR(dev) ? PTR_ERR(dev) : 0;
+   return PTR_ERR_OR_ZERO(dev);
 }
 
 static void msr_device_destroy(int cpu)
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86, msr: Convert printk to pr_foo()

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  951a18c6fee5d2f6f5d7b5118776bf787bf9c351
Gitweb: http://git.kernel.org/tip/951a18c6fee5d2f6f5d7b5118776bf787bf9c351
Author: Fabian Frederick f...@skynet.be
AuthorDate: Fri, 17 Oct 2014 22:01:50 +0200
Committer:  H. Peter Anvin h...@linux.intel.com
CommitDate: Fri, 17 Oct 2014 13:40:54 -0700

x86, msr: Convert printk to pr_foo()

Also define pr_fmt.

Signed-off-by: Fabian Frederick f...@skynet.be
Link: http://lkml.kernel.org/r/1413576110-27103-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin h...@linux.intel.com
---
 arch/x86/kernel/msr.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 6e4f77f..826c8b0 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -22,6 +22,8 @@
  * an SMP box will direct the access to CPU %d.
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME :  fmt
+
 #include linux/module.h
 
 #include linux/types.h
@@ -248,8 +250,7 @@ static int __init msr_init(void)
i = 0;
 
if (__register_chrdev(MSR_MAJOR, 0, NR_CPUS, cpu/msr, msr_fops)) {
-   printk(KERN_ERR msr: unable to get major %d for msr\n,
-  MSR_MAJOR);
+   pr_err(unable to get major %d for msr\n, MSR_MAJOR);
err = -EBUSY;
goto out;
}
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[tip:x86/cleanups] x86, msr: Use seek definitions instead of hard-coded values

2014-10-17 Thread tip-bot for Fabian Frederick
Commit-ID:  03452d27c6cd9cebb59a6bb0fb6bd8557916c263
Gitweb: http://git.kernel.org/tip/03452d27c6cd9cebb59a6bb0fb6bd8557916c263
Author: Fabian Frederick f...@skynet.be
AuthorDate: Fri, 17 Oct 2014 22:01:59 +0200
Committer:  H. Peter Anvin h...@linux.intel.com
CommitDate: Fri, 17 Oct 2014 13:40:55 -0700

x86, msr: Use seek definitions instead of hard-coded values

Replace 0/1 by SEEK_SET/SEEK_CUR.

Signed-off-by: Fabian Frederick f...@skynet.be
Link: http://lkml.kernel.org/r/1413576120-27147-1-git-send-email-f...@skynet.be
Signed-off-by: H. Peter Anvin h...@linux.intel.com
---
 arch/x86/kernel/msr.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/msr.c b/arch/x86/kernel/msr.c
index 826c8b0..113e707 100644
--- a/arch/x86/kernel/msr.c
+++ b/arch/x86/kernel/msr.c
@@ -52,11 +52,11 @@ static loff_t msr_seek(struct file *file, loff_t offset, 
int orig)
 
mutex_lock(inode-i_mutex);
switch (orig) {
-   case 0:
+   case SEEK_SET:
file-f_pos = offset;
ret = file-f_pos;
break;
-   case 1:
+   case SEEK_CUR:
file-f_pos += offset;
ret = file-f_pos;
break;
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/