[PATCH 27/32] ASoC: samsung: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Krzysztof Kozlowski 
Cc: Sangbeom Kim 
Cc: Sylwester Nawrocki 
Cc: Jaroslav Kysela 
Cc: Takashi Iwai 
Signed-off-by: Kefeng Wang 
---
 sound/soc/samsung/s3c-i2s-v2.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sound/soc/samsung/s3c-i2s-v2.c b/sound/soc/samsung/s3c-i2s-v2.c
index 7e196b599be1..593be1b668d6 100644
--- a/sound/soc/samsung/s3c-i2s-v2.c
+++ b/sound/soc/samsung/s3c-i2s-v2.c
@@ -672,13 +672,13 @@ static int s3c2412_i2s_suspend(struct snd_soc_dai *dai)
iismod = readl(i2s->regs + S3C2412_IISMOD);
 
if (iismod & S3C2412_IISCON_RXDMA_ACTIVE)
-   pr_warning("%s: RXDMA active?\n", __func__);
+   pr_warn("%s: RXDMA active?\n", __func__);
 
if (iismod & S3C2412_IISCON_TXDMA_ACTIVE)
-   pr_warning("%s: TXDMA active?\n", __func__);
+   pr_warn("%s: TXDMA active?\n", __func__);
 
if (iismod & S3C2412_IISCON_IIS_ACTIVE)
-   pr_warning("%s: IIS active\n", __func__);
+   pr_warn("%s: IIS active\n", __func__);
}
 
return 0;
-- 
2.20.1



[PATCH 20/32] sh/intc: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Yoshinori Sato 
Cc: Rich Felker 
Signed-off-by: Kefeng Wang 
---
 drivers/sh/intc/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c
index 46f0f322d4d8..8485e812d9b2 100644
--- a/drivers/sh/intc/core.c
+++ b/drivers/sh/intc/core.c
@@ -100,8 +100,8 @@ static void __init intc_register_irq(struct intc_desc *desc,
primary = 1;
 
if (!data[0] && !data[1])
-   pr_warning("missing unique irq mask for irq %d (vect 0x%04x)\n",
-  irq, irq2evt(irq));
+   pr_warn("missing unique irq mask for irq %d (vect 0x%04x)\n",
+   irq, irq2evt(irq));
 
data[0] = data[0] ? data[0] : intc_get_mask_handle(desc, d, enum_id, 1);
data[1] = data[1] ? data[1] : intc_get_prio_handle(desc, d, enum_id, 1);
-- 
2.20.1



[PATCH 28/32] printk: Drop pr_warning

2019-09-20 Thread Kefeng Wang
With all pr_warning are removed, saftely drop pr_warning definition.

Cc: Petr Mladek 
Cc: Sergey Senozhatsky 
Cc: Steven Rostedt 
Signed-off-by: Kefeng Wang 
---
 include/linux/printk.h | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/include/linux/printk.h b/include/linux/printk.h
index cefd374c47b1..7071b9948756 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -302,9 +302,8 @@ extern int kptr_restrict;
printk(KERN_CRIT pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_err(fmt, ...) \
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_warning(fmt, ...) \
+#define pr_warn(fmt, ...) \
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
-#define pr_warn pr_warning
 #define pr_notice(fmt, ...) \
printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
 #define pr_info(fmt, ...) \
-- 
2.20.1



[PATCH 08/32] acpi: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: "Rafael J. Wysocki" 
Cc: Len Brown 
Cc: James Morse 
Signed-off-by: Kefeng Wang 
---
 drivers/acpi/apei/apei-base.c | 36 +--
 drivers/acpi/apei/einj.c  |  4 ++--
 drivers/acpi/apei/erst-dbg.c  |  5 ++---
 drivers/acpi/apei/ghes.c  | 25 
 drivers/acpi/apei/hest.c  | 14 +++---
 drivers/acpi/battery.c|  2 +-
 drivers/acpi/resource.c   |  4 ++--
 7 files changed, 44 insertions(+), 46 deletions(-)

diff --git a/drivers/acpi/apei/apei-base.c b/drivers/acpi/apei/apei-base.c
index 131c35ee9ed3..1bb2a94f49a3 100644
--- a/drivers/acpi/apei/apei-base.c
+++ b/drivers/acpi/apei/apei-base.c
@@ -170,7 +170,7 @@ int __apei_exec_run(struct apei_exec_context *ctx, u8 
action,
if (ip == ctx->ip) {
if (entry->instruction >= ctx->instructions ||
!ctx->ins_table[entry->instruction].run) {
-   pr_warning(FW_WARN APEI_PFX
+   pr_warn(FW_WARN APEI_PFX
"Invalid action table, unknown instruction type: %d\n",
   entry->instruction);
return -EINVAL;
@@ -211,7 +211,7 @@ static int apei_exec_for_each_entry(struct 
apei_exec_context *ctx,
if (end)
*end = i;
if (ins >= ctx->instructions || !ins_table[ins].run) {
-   pr_warning(FW_WARN APEI_PFX
+   pr_warn(FW_WARN APEI_PFX
"Invalid action table, unknown instruction type: %d\n",
   ins);
return -EINVAL;
@@ -579,18 +579,18 @@ static int apei_check_gar(struct acpi_generic_address 
*reg, u64 *paddr,
space_id = reg->space_id;
*paddr = get_unaligned(>address);
if (!*paddr) {
-   pr_warning(FW_BUG APEI_PFX
-  "Invalid physical address in GAR 
[0x%llx/%u/%u/%u/%u]\n",
-  *paddr, bit_width, bit_offset, access_size_code,
-  space_id);
+   pr_warn(FW_BUG APEI_PFX
+   "Invalid physical address in GAR 
[0x%llx/%u/%u/%u/%u]\n",
+   *paddr, bit_width, bit_offset, access_size_code,
+   space_id);
return -EINVAL;
}
 
if (access_size_code < 1 || access_size_code > 4) {
-   pr_warning(FW_BUG APEI_PFX
-  "Invalid access size code in GAR 
[0x%llx/%u/%u/%u/%u]\n",
-  *paddr, bit_width, bit_offset, access_size_code,
-  space_id);
+   pr_warn(FW_BUG APEI_PFX
+   "Invalid access size code in GAR 
[0x%llx/%u/%u/%u/%u]\n",
+   *paddr, bit_width, bit_offset, access_size_code,
+   space_id);
return -EINVAL;
}
*access_bit_width = 1UL << (access_size_code + 2);
@@ -604,19 +604,19 @@ static int apei_check_gar(struct acpi_generic_address 
*reg, u64 *paddr,
*access_bit_width = 64;
 
if ((bit_width + bit_offset) > *access_bit_width) {
-   pr_warning(FW_BUG APEI_PFX
-  "Invalid bit width + offset in GAR 
[0x%llx/%u/%u/%u/%u]\n",
-  *paddr, bit_width, bit_offset, access_size_code,
-  space_id);
+   pr_warn(FW_BUG APEI_PFX
+   "Invalid bit width + offset in GAR 
[0x%llx/%u/%u/%u/%u]\n",
+   *paddr, bit_width, bit_offset, access_size_code,
+   space_id);
return -EINVAL;
}
 
if (space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY &&
space_id != ACPI_ADR_SPACE_SYSTEM_IO) {
-   pr_warning(FW_BUG APEI_PFX
-  "Invalid address space type in GAR 
[0x%llx/%u/%u/%u/%u]\n",
-  *paddr, bit_width, bit_offset, access_size_code,
-  space_id);
+   pr_warn(FW_BUG APEI_PFX
+   "Invalid address space type in GAR 
[0x%llx/%u/%u/%u/%u]\n",
+   *paddr, bit_width, bit_offset, access_size_code,
+   space_id);
return -EINVAL;
}
 
diff --git a/drivers/acpi/apei/einj.c b/drivers/acpi/apei/einj.c
index e430cf4caec2..086373f8ccb1 100644
--- a/drivers/acpi/apei/einj.c
+++ b/drivers/acpi/apei/einj.c
@@ -172,7 +172,7 @@ static int einj_get_available_error_type(u32 *type)
 static int einj_timedout(u64 *t)
 {
if ((s64)*t < SPIN_UNIT) {
-   pr_warning(FW_WARN "Firmware does not respond in time\n");
+   

[PATCH 18/32] platform/x86: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Corentin Chary 
Cc: Darren Hart 
Cc: Andy Shevchenko 
Signed-off-by: Kefeng Wang 
---
 drivers/platform/x86/asus-laptop.c|  2 +-
 drivers/platform/x86/eeepc-laptop.c   |  2 +-
 drivers/platform/x86/intel_oaktrail.c | 10 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/platform/x86/asus-laptop.c 
b/drivers/platform/x86/asus-laptop.c
index 472af7edf0af..ca65e1039f92 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -1148,7 +1148,7 @@ static void asus_als_switch(struct asus_laptop *asus, int 
value)
ret = write_acpi_int(asus->handle, METHOD_ALS_CONTROL, value);
}
if (ret)
-   pr_warning("Error setting light sensor switch\n");
+   pr_warn("Error setting light sensor switch\n");
 
asus->light_switch = value;
 }
diff --git a/drivers/platform/x86/eeepc-laptop.c 
b/drivers/platform/x86/eeepc-laptop.c
index f3f74a9c109e..776868d5e458 100644
--- a/drivers/platform/x86/eeepc-laptop.c
+++ b/drivers/platform/x86/eeepc-laptop.c
@@ -578,7 +578,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop 
*eeepc, acpi_handle handle)
 
port = acpi_get_pci_dev(handle);
if (!port) {
-   pr_warning("Unable to find port\n");
+   pr_warn("Unable to find port\n");
goto out_unlock;
}
 
diff --git a/drivers/platform/x86/intel_oaktrail.c 
b/drivers/platform/x86/intel_oaktrail.c
index 3c0438ba385e..1a09a75bd16d 100644
--- a/drivers/platform/x86/intel_oaktrail.c
+++ b/drivers/platform/x86/intel_oaktrail.c
@@ -243,7 +243,7 @@ static int oaktrail_backlight_init(void)
 
if (IS_ERR(bd)) {
oaktrail_bl_device = NULL;
-   pr_warning("Unable to register backlight device\n");
+   pr_warn("Unable to register backlight device\n");
return PTR_ERR(bd);
}
 
@@ -313,20 +313,20 @@ static int __init oaktrail_init(void)
 
ret = platform_driver_register(_driver);
if (ret) {
-   pr_warning("Unable to register platform driver\n");
+   pr_warn("Unable to register platform driver\n");
goto err_driver_reg;
}
 
oaktrail_device = platform_device_alloc(DRIVER_NAME, -1);
if (!oaktrail_device) {
-   pr_warning("Unable to allocate platform device\n");
+   pr_warn("Unable to allocate platform device\n");
ret = -ENOMEM;
goto err_device_alloc;
}
 
ret = platform_device_add(oaktrail_device);
if (ret) {
-   pr_warning("Unable to add platform device\n");
+   pr_warn("Unable to add platform device\n");
goto err_device_add;
}
 
@@ -338,7 +338,7 @@ static int __init oaktrail_init(void)
 
ret = oaktrail_rfkill_init();
if (ret) {
-   pr_warning("Setup rfkill failed\n");
+   pr_warn("Setup rfkill failed\n");
goto err_rfkill;
}
 
-- 
2.20.1



[PATCH 19/32] scsi: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: "James E.J. Bottomley" 
Cc: "Martin K. Petersen" 
Signed-off-by: Kefeng Wang 
---
 drivers/scsi/a3000.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/a3000.c b/drivers/scsi/a3000.c
index 222c77c9621f..b6a0432f305a 100644
--- a/drivers/scsi/a3000.c
+++ b/drivers/scsi/a3000.c
@@ -39,7 +39,7 @@ static irqreturn_t a3000_intr(int irq, void *data)
spin_unlock_irqrestore(instance->host_lock, flags);
return IRQ_HANDLED;
}
-   pr_warning("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
+   pr_warn("Non-serviced A3000 SCSI-interrupt? ISTR = %02x\n", status);
return IRQ_NONE;
 }
 
-- 
2.20.1



[PATCH 26/32] lib: cpu_rmap: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Andrew Morton 
Signed-off-by: Kefeng Wang 
---
 lib/cpu_rmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/cpu_rmap.c b/lib/cpu_rmap.c
index 075f3788bbe4..f08d9c56f712 100644
--- a/lib/cpu_rmap.c
+++ b/lib/cpu_rmap.c
@@ -255,7 +255,7 @@ irq_cpu_rmap_notify(struct irq_affinity_notify *notify, 
const cpumask_t *mask)
 
rc = cpu_rmap_update(glue->rmap, glue->index, mask);
if (rc)
-   pr_warning("irq_cpu_rmap_notify: update failed: %d\n", rc);
+   pr_warn("irq_cpu_rmap_notify: update failed: %d\n", rc);
 }
 
 /**
-- 
2.20.1



[PATCH 23/32] vgacon: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Bartlomiej Zolnierkiewicz 
Cc: linux-fb...@vger.kernel.org
Signed-off-by: Kefeng Wang 
---
 drivers/video/console/vgacon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index c6b3bdbbdbc9..de7b8382aba9 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -113,9 +113,9 @@ static int __init text_mode(char *str)
 {
vgacon_text_mode_force = true;
 
-   pr_warning("You have booted with nomodeset. This means your GPU drivers 
are DISABLED\n");
-   pr_warning("Any video related functionality will be severely degraded, 
and you may not even be able to suspend the system properly\n");
-   pr_warning("Unless you actually understand what nomodeset does, you 
should reboot without enabling it\n");
+   pr_warn("You have booted with nomodeset. This means your GPU drivers 
are DISABLED\n");
+   pr_warn("Any video related functionality will be severely degraded, and 
you may not even be able to suspend the system properly\n");
+   pr_warn("Unless you actually understand what nomodeset does, you should 
reboot without enabling it\n");
 
return 1;
 }
-- 
2.20.1



[PATCH 07/32] x86: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Ingo Molnar 
Cc: Borislav Petkov 
Cc: "H. Peter Anvin" 
Cc: Robert Richter 
Cc: Darren Hart 
Cc: Andy Shevchenko 
Signed-off-by: Kefeng Wang 
---
 arch/x86/kernel/amd_gart_64.c  | 11 ---
 arch/x86/kernel/apic/apic.c| 41 --
 arch/x86/kernel/setup_percpu.c |  4 +--
 arch/x86/kernel/tboot.c| 15 +-
 arch/x86/kernel/tsc_sync.c |  8 ++---
 arch/x86/kernel/umip.c |  6 ++--
 arch/x86/mm/kmmio.c|  7 ++---
 arch/x86/mm/mmio-mod.c |  6 ++--
 arch/x86/mm/numa_emulation.c   |  4 +--
 arch/x86/mm/testmmiotrace.c|  6 ++--
 arch/x86/oprofile/op_x86_model.h   |  6 ++--
 arch/x86/platform/olpc/olpc-xo15-sci.c |  2 +-
 arch/x86/platform/sfi/sfi.c|  3 +-
 arch/x86/xen/setup.c   |  2 +-
 14 files changed, 57 insertions(+), 64 deletions(-)

diff --git a/arch/x86/kernel/amd_gart_64.c b/arch/x86/kernel/amd_gart_64.c
index a585ea6f686a..53545c9c7cad 100644
--- a/arch/x86/kernel/amd_gart_64.c
+++ b/arch/x86/kernel/amd_gart_64.c
@@ -510,10 +510,9 @@ static __init unsigned long check_iommu_size(unsigned long 
aper, u64 aper_size)
iommu_size -= round_up(a, PMD_PAGE_SIZE) - a;
 
if (iommu_size < 64*1024*1024) {
-   pr_warning(
-   "PCI-DMA: Warning: Small IOMMU %luMB."
+   pr_warn("PCI-DMA: Warning: Small IOMMU %luMB."
" Consider increasing the AGP aperture in BIOS\n",
-   iommu_size >> 20);
+   iommu_size >> 20);
}
 
return iommu_size;
@@ -665,7 +664,7 @@ static __init int init_amd_gatt(struct agp_kern_info *info)
 
  nommu:
/* Should not happen anymore */
-   pr_warning("PCI-DMA: More than 4GB of RAM and no IOMMU\n"
+   pr_warn("PCI-DMA: More than 4GB of RAM and no IOMMU\n"
   "falling back to iommu=soft.\n");
return -1;
 }
@@ -730,8 +729,8 @@ int __init gart_iommu_init(void)
!gart_iommu_aperture ||
(no_agp && init_amd_gatt() < 0)) {
if (max_pfn > MAX_DMA32_PFN) {
-   pr_warning("More than 4GB of memory but GART IOMMU not 
available.\n");
-   pr_warning("falling back to iommu=soft.\n");
+   pr_warn("More than 4GB of memory but GART IOMMU not 
available.\n");
+   pr_warn("falling back to iommu=soft.\n");
}
return 0;
}
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
index 9e2dd2b296cd..3570864b8329 100644
--- a/arch/x86/kernel/apic/apic.c
+++ b/arch/x86/kernel/apic/apic.c
@@ -780,8 +780,8 @@ calibrate_by_pmtimer(long deltapm, long *delta, long 
*deltatsc)
 
res = (((u64)deltapm) *  mult) >> 22;
do_div(res, 100);
-   pr_warning("APIC calibration not consistent "
-  "with PM-Timer: %ldms instead of 100ms\n",(long)res);
+   pr_warn("APIC calibration not consistent "
+   "with PM-Timer: %ldms instead of 100ms\n", (long)res);
 
/* Correct the lapic counter value */
res = (((u64)(*delta)) * pm_100ms);
@@ -977,7 +977,7 @@ static int __init calibrate_APIC_clock(void)
 */
if (lapic_timer_period < (100 / HZ)) {
local_irq_enable();
-   pr_warning("APIC frequency too slow, disabling apic timer\n");
+   pr_warn("APIC frequency too slow, disabling apic timer\n");
return -1;
}
 
@@ -1021,7 +1021,7 @@ static int __init calibrate_APIC_clock(void)
local_irq_enable();
 
if (levt->features & CLOCK_EVT_FEAT_DUMMY) {
-   pr_warning("APIC timer disabled due to verification failure\n");
+   pr_warn("APIC timer disabled due to verification failure\n");
return -1;
}
 
@@ -1095,8 +1095,8 @@ static void local_apic_timer_interrupt(void)
 * spurious.
 */
if (!evt->event_handler) {
-   pr_warning("Spurious LAPIC timer interrupt on cpu %d\n",
-  smp_processor_id());
+   pr_warn("Spurious LAPIC timer interrupt on cpu %d\n",
+   smp_processor_id());
/* Switch it off */
lapic_timer_shutdown(evt);
return;
@@ -1809,11 +1809,11 @@ static int __init setup_nox2apic(char *str)
int apicid = native_apic_msr_read(APIC_ID);
 
if (apicid >= 255) {
-   pr_warning("Apicid: %08x, cannot enforce nox2apic\n",
-  apicid);
+   pr_warn("Apicid: %08x, cannot enforce nox2apic\n",
+   

[PATCH 29/32] tools lib api: Renaming pr_warning to pr_warn

2019-09-20 Thread Kefeng Wang
For kernel logging macro, pr_warning is completely removed and
replaced by pr_warn, using pr_warn in tools lib api for symmetry
to kernel logging macro, then we could drop pr_warning in the
whole linux code.

Changing __pr_warning to __pr_warn to be consistent.

Cc: Arnaldo Carvalho de Melo 
Signed-off-by: Kefeng Wang 
---
 tools/lib/api/debug-internal.h | 4 ++--
 tools/lib/api/debug.c  | 4 ++--
 tools/lib/api/fs/fs.c  | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tools/lib/api/debug-internal.h b/tools/lib/api/debug-internal.h
index 80c783497d25..5a5820c11db8 100644
--- a/tools/lib/api/debug-internal.h
+++ b/tools/lib/api/debug-internal.h
@@ -10,11 +10,11 @@ do {\
(func)("libapi: " fmt, ##__VA_ARGS__); \
 } while (0)
 
-extern libapi_print_fn_t __pr_warning;
+extern libapi_print_fn_t __pr_warn;
 extern libapi_print_fn_t __pr_info;
 extern libapi_print_fn_t __pr_debug;
 
-#define pr_warning(fmt, ...)   __pr(__pr_warning, fmt, ##__VA_ARGS__)
+#define pr_warn(fmt, ...)  __pr(__pr_warn, fmt, ##__VA_ARGS__)
 #define pr_info(fmt, ...)  __pr(__pr_info, fmt, ##__VA_ARGS__)
 #define pr_debug(fmt, ...) __pr(__pr_debug, fmt, ##__VA_ARGS__)
 
diff --git a/tools/lib/api/debug.c b/tools/lib/api/debug.c
index 69b1ba3d1ee3..7708f0558e8c 100644
--- a/tools/lib/api/debug.c
+++ b/tools/lib/api/debug.c
@@ -15,7 +15,7 @@ static int __base_pr(const char *format, ...)
return err;
 }
 
-libapi_print_fn_t __pr_warning = __base_pr;
+libapi_print_fn_t __pr_warn= __base_pr;
 libapi_print_fn_t __pr_info= __base_pr;
 libapi_print_fn_t __pr_debug;
 
@@ -23,7 +23,7 @@ void libapi_set_print(libapi_print_fn_t warn,
  libapi_print_fn_t info,
  libapi_print_fn_t debug)
 {
-   __pr_warning = warn;
+   __pr_warn= warn;
__pr_info= info;
__pr_debug   = debug;
 }
diff --git a/tools/lib/api/fs/fs.c b/tools/lib/api/fs/fs.c
index 7aba8243a0e7..11b3885e833e 100644
--- a/tools/lib/api/fs/fs.c
+++ b/tools/lib/api/fs/fs.c
@@ -381,8 +381,8 @@ int filename__read_str(const char *filename, char **buf, 
size_t *sizep)
n = read(fd, bf + size, alloc_size - size);
if (n < 0) {
if (size) {
-   pr_warning("read failed %d: %s\n", errno,
-strerror_r(errno, sbuf, sizeof(sbuf)));
+   pr_warn("read failed %d: %s\n", errno,
+   strerror_r(errno, sbuf, sizeof(sbuf)));
err = 0;
} else
err = -errno;
-- 
2.20.1



[PATCH 31/32] tools perf: Renaming pr_warning to pr_warn

2019-09-20 Thread Kefeng Wang
For kernel logging macro, pr_warning is completely removed and
replaced by pr_warn, using pr_warn in tools perf for symmetry
to kernel logging macro, then we could drop pr_warning in the
whole linux code.

Cc: Arnaldo Carvalho de Melo 
Cc: Peter Zijlstra 
Cc: Ingo Molnar 
Cc: Mark Rutland 
Cc: Alexander Shishkin 
Cc: Jiri Olsa 
Signed-off-by: Kefeng Wang 
---
 tools/perf/arch/x86/util/intel-pt.c  |   2 +-
 tools/perf/builtin-annotate.c|   7 +-
 tools/perf/builtin-buildid-cache.c   |  28 +++---
 tools/perf/builtin-diff.c|  12 +--
 tools/perf/builtin-help.c|  10 +-
 tools/perf/builtin-inject.c  |   8 +-
 tools/perf/builtin-probe.c   |  14 +--
 tools/perf/builtin-record.c  |  10 +-
 tools/perf/builtin-report.c  |   2 +-
 tools/perf/builtin-script.c  |  14 +--
 tools/perf/builtin-stat.c|  18 ++--
 tools/perf/builtin-timechart.c   |  12 +--
 tools/perf/builtin-top.c |   2 +-
 tools/perf/builtin-trace.c   |   8 +-
 tools/perf/lib/internal.h|   2 +-
 tools/perf/ui/browsers/scripts.c |   2 +-
 tools/perf/util/bpf-loader.c |   6 +-
 tools/perf/util/bpf-prologue.c   |   4 +-
 tools/perf/util/callchain.c  |   2 +-
 tools/perf/util/config.c |   8 +-
 tools/perf/util/data-convert-bt.c|   4 +-
 tools/perf/util/data.c   |   2 +-
 tools/perf/util/debug.c  |   4 +-
 tools/perf/util/debug.h  |   2 +-
 tools/perf/util/event.c  |  14 ++-
 tools/perf/util/evlist.c |   4 +-
 tools/perf/util/evsel.c  |  19 ++--
 tools/perf/util/header.c |  20 ++--
 tools/perf/util/jitdump.c|   4 +-
 tools/perf/util/llvm-utils.c |  18 ++--
 tools/perf/util/machine.c|   2 +-
 tools/perf/util/parse-branch-options.c   |   3 +-
 tools/perf/util/perf-hooks.c |   6 +-
 tools/perf/util/probe-event.c|  90 +-
 tools/perf/util/probe-file.c |  36 
 tools/perf/util/probe-finder.c   | 112 +++
 tools/perf/util/record.c |  18 ++--
 tools/perf/util/session.c|   2 +-
 tools/perf/util/srcline.c|   6 +-
 tools/perf/util/thread-stack.c   |   4 +-
 tools/perf/util/thread_map.c |   2 +-
 tools/perf/util/trace-event-parse.c  |   2 +-
 tools/perf/util/unwind-libunwind-local.c |   9 +-
 43 files changed, 272 insertions(+), 282 deletions(-)

diff --git a/tools/perf/arch/x86/util/intel-pt.c 
b/tools/perf/arch/x86/util/intel-pt.c
index cb7cf16af79c..701615996bd6 100644
--- a/tools/perf/arch/x86/util/intel-pt.c
+++ b/tools/perf/arch/x86/util/intel-pt.c
@@ -529,7 +529,7 @@ static int intel_pt_validate_config(struct perf_pmu 
*intel_pt_pmu,
 */
if (perf_pmu__scan_file(intel_pt_pmu, "format/pt", "%c", ) == 1 &&
!(evsel->core.attr.config & 1)) {
-   pr_warning("pt=0 doesn't make sense, forcing pt=1\n");
+   pr_warn("pt=0 doesn't make sense, forcing pt=1\n");
evsel->core.attr.config |= 1;
}
 
diff --git a/tools/perf/builtin-annotate.c b/tools/perf/builtin-annotate.c
index 4e4d2e76232e..71dbe17cf0ee 100644
--- a/tools/perf/builtin-annotate.c
+++ b/tools/perf/builtin-annotate.c
@@ -267,8 +267,8 @@ static int process_sample_event(struct perf_tool *tool,
int ret = 0;
 
if (machine__resolve(machine, , sample) < 0) {
-   pr_warning("problem processing %d event, skipping it.\n",
-  event->header.type);
+   pr_warn("problem processing %d event, skipping it.\n",
+   event->header.type);
return -1;
}
 
@@ -277,8 +277,7 @@ static int process_sample_event(struct perf_tool *tool,
 
if (!al.filtered &&
perf_evsel__add_sample(evsel, sample, , ann, machine)) {
-   pr_warning("problem incrementing symbol count, "
-  "skipping event\n");
+   pr_warn("problem incrementing symbol count, skipping event\n");
ret = -1;
}
 out_put:
diff --git a/tools/perf/builtin-buildid-cache.c 
b/tools/perf/builtin-buildid-cache.c
index 1a69eb565dc0..0859e3a8cdc3 100644
--- a/tools/perf/builtin-buildid-cache.c
+++ b/tools/perf/builtin-buildid-cache.c
@@ -281,11 +281,11 @@ static bool dso__missing_buildid_cache(struct dso *dso, 
int parm __maybe_unused)
if (errno == ENOENT)
return false;
 
-   pr_warning("Problems with %s file, consider removing it from 
the cache\n",
-  filename);
+   pr_warn("Problems with %s file, consider removing it from the 
cache\n",
+   filename);
} else if 

[PATCH 24/32] dma-debug: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Christoph Hellwig 
Cc: Marek Szyprowski 
Cc: Robin Murphy 
Signed-off-by: Kefeng Wang 
---
 kernel/dma/debug.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c
index 099002d84f46..a26170469543 100644
--- a/kernel/dma/debug.c
+++ b/kernel/dma/debug.c
@@ -161,7 +161,7 @@ static inline void dump_entry_trace(struct dma_debug_entry 
*entry)
 {
 #ifdef CONFIG_STACKTRACE
if (entry) {
-   pr_warning("Mapped at:\n");
+   pr_warn("Mapped at:\n");
stack_trace_print(entry->stack_entries, entry->stack_len, 0);
}
 #endif
-- 
2.20.1



[PATCH 32/32] checkpatch: Drop pr_warning check

2019-09-20 Thread Kefeng Wang
For now, all pr_warning are removed, delete pr_warning check in
checkpatch.

Cc: Andy Whitcroft 
Cc: Joe Perches 
Signed-off-by: Kefeng Wang 
---
 scripts/checkpatch.pl | 9 -
 1 file changed, 9 deletions(-)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 93a7edfe0f05..56d710274a15 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -4098,15 +4098,6 @@ sub process {
 "Prefer [subsystem eg: 
netdev]_$level2([subsystem]dev, ... then dev_$level2(dev, ... then 
pr_$level(...  to printk(KERN_$orig ...\n" . $herecurr);
}
 
-   if ($line =~ /\bpr_warning\s*\(/) {
-   if (WARN("PREFER_PR_LEVEL",
-"Prefer pr_warn(... to pr_warning(...\n" . 
$herecurr) &&
-   $fix) {
-   $fixed[$fixlinenr] =~
-   s/\bpr_warning\b/pr_warn/;
-   }
-   }
-
if ($line =~ /\bdev_printk\s*\(\s*KERN_([A-Z]+)/) {
my $orig = $1;
my $level = lc($orig);
-- 
2.20.1



[PATCH 21/32] staging: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Karsten Keil 
Cc: Greg Kroah-Hartman 
Signed-off-by: Kefeng Wang 
---
 drivers/staging/isdn/gigaset/interface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/isdn/gigaset/interface.c 
b/drivers/staging/isdn/gigaset/interface.c
index 17fa615a8c68..9ddadd07e707 100644
--- a/drivers/staging/isdn/gigaset/interface.c
+++ b/drivers/staging/isdn/gigaset/interface.c
@@ -518,7 +518,7 @@ void gigaset_if_init(struct cardstate *cs)
if (!IS_ERR(cs->tty_dev))
dev_set_drvdata(cs->tty_dev, cs);
else {
-   pr_warning("could not register device to the tty subsystem\n");
+   pr_warn("could not register device to the tty subsystem\n");
cs->tty_dev = NULL;
}
mutex_unlock(>mutex);
-- 
2.20.1



[PATCH 25/32] trace: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Steven Rostedt 
Cc: Ingo Molnar 
Signed-off-by: Kefeng Wang 
---
 kernel/trace/trace_benchmark.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/trace/trace_benchmark.c b/kernel/trace/trace_benchmark.c
index 80e0b2aca703..2e9a4746ea85 100644
--- a/kernel/trace/trace_benchmark.c
+++ b/kernel/trace/trace_benchmark.c
@@ -178,14 +178,14 @@ static int benchmark_event_kthread(void *arg)
 int trace_benchmark_reg(void)
 {
if (!ok_to_run) {
-   pr_warning("trace benchmark cannot be started via kernel 
command line\n");
+   pr_warn("trace benchmark cannot be started via kernel command 
line\n");
return -EBUSY;
}
 
bm_event_thread = kthread_run(benchmark_event_kthread,
  NULL, "event_benchmark");
if (IS_ERR(bm_event_thread)) {
-   pr_warning("trace benchmark failed to create kernel thread\n");
+   pr_warn("trace benchmark failed to create kernel thread\n");
return PTR_ERR(bm_event_thread);
}
 
-- 
2.20.1



[PATCH 30/32] tools lib bpf: Renaming pr_warning to pr_warn

2019-09-20 Thread Kefeng Wang
For kernel logging macro, pr_warning is completely removed and
replaced by pr_warn, using pr_warn in tools lib bpf for symmetry
to kernel logging macro, then we could drop pr_warning in the
whole linux code.

Cc: Alexei Starovoitov 
Cc: Daniel Borkmann 
Cc: Martin KaFai Lau 
Cc: Song Liu 
Cc: Yonghong Song 
Cc: b...@vger.kernel.org
Signed-off-by: Kefeng Wang 
---
 tools/lib/bpf/btf.c |  56 +--
 tools/lib/bpf/btf_dump.c|  20 +-
 tools/lib/bpf/libbpf.c  | 652 
 tools/lib/bpf/libbpf_internal.h |   2 +-
 tools/lib/bpf/xsk.c |   4 +-
 5 files changed, 363 insertions(+), 371 deletions(-)

diff --git a/tools/lib/bpf/btf.c b/tools/lib/bpf/btf.c
index 1aa189a9112a..801dac6f493d 100644
--- a/tools/lib/bpf/btf.c
+++ b/tools/lib/bpf/btf.c
@@ -390,14 +390,14 @@ struct btf *btf__parse_elf(const char *path, struct 
btf_ext **btf_ext)
GElf_Ehdr ehdr;
 
if (elf_version(EV_CURRENT) == EV_NONE) {
-   pr_warning("failed to init libelf for %s\n", path);
+   pr_warn("failed to init libelf for %s\n", path);
return ERR_PTR(-LIBBPF_ERRNO__LIBELF);
}
 
fd = open(path, O_RDONLY);
if (fd < 0) {
err = -errno;
-   pr_warning("failed to open %s: %s\n", path, strerror(errno));
+   pr_warn("failed to open %s: %s\n", path, strerror(errno));
return ERR_PTR(err);
}
 
@@ -405,19 +405,19 @@ struct btf *btf__parse_elf(const char *path, struct 
btf_ext **btf_ext)
 
elf = elf_begin(fd, ELF_C_READ, NULL);
if (!elf) {
-   pr_warning("failed to open %s as ELF file\n", path);
+   pr_warn("failed to open %s as ELF file\n", path);
goto done;
}
if (!gelf_getehdr(elf, )) {
-   pr_warning("failed to get EHDR from %s\n", path);
+   pr_warn("failed to get EHDR from %s\n", path);
goto done;
}
if (!btf_check_endianness()) {
-   pr_warning("non-native ELF endianness is not supported\n");
+   pr_warn("non-native ELF endianness is not supported\n");
goto done;
}
if (!elf_rawdata(elf_getscn(elf, ehdr.e_shstrndx), NULL)) {
-   pr_warning("failed to get e_shstrndx from %s\n", path);
+   pr_warn("failed to get e_shstrndx from %s\n", path);
goto done;
}
 
@@ -427,29 +427,29 @@ struct btf *btf__parse_elf(const char *path, struct 
btf_ext **btf_ext)
 
idx++;
if (gelf_getshdr(scn, ) != ) {
-   pr_warning("failed to get section(%d) header from %s\n",
-  idx, path);
+   pr_warn("failed to get section(%d) header from %s\n",
+   idx, path);
goto done;
}
name = elf_strptr(elf, ehdr.e_shstrndx, sh.sh_name);
if (!name) {
-   pr_warning("failed to get section(%d) name from %s\n",
-  idx, path);
+   pr_warn("failed to get section(%d) name from %s\n",
+   idx, path);
goto done;
}
if (strcmp(name, BTF_ELF_SEC) == 0) {
btf_data = elf_getdata(scn, 0);
if (!btf_data) {
-   pr_warning("failed to get section(%d, %s) data 
from %s\n",
-  idx, name, path);
+   pr_warn("failed to get section(%d, %s) data 
from %s\n",
+   idx, name, path);
goto done;
}
continue;
} else if (btf_ext && strcmp(name, BTF_EXT_ELF_SEC) == 0) {
btf_ext_data = elf_getdata(scn, 0);
if (!btf_ext_data) {
-   pr_warning("failed to get section(%d, %s) data 
from %s\n",
-  idx, name, path);
+   pr_warn("failed to get section(%d, %s) data 
from %s\n",
+   idx, name, path);
goto done;
}
continue;
@@ -600,9 +600,9 @@ int btf__load(struct btf *btf)
   log_buf, log_buf_size, false);
if (btf->fd < 0) {
err = -errno;
-   pr_warning("Error loading BTF: %s(%d)\n", strerror(errno), 
errno);
+   pr_warn("Error loading BTF: %s(%d)\n", strerror(errno), errno);
if (*log_buf)
-   pr_warning("%s\n", log_buf);
+   pr_warn("%s\n", log_buf);
goto done;
}
 
@@ -707,8 

[PATCH 02/32] arm64: Use pr_warn instead of pr_warning

2019-09-20 Thread Kefeng Wang
As said in commit f2c2cbcc35d4 ("powerpc: Use pr_warn instead of
pr_warning"), removing pr_warning so all logging messages use a
consistent _warn style. Let's do it.

Cc: Will Deacon 
Cc: Mark Rutland 
Cc: Catalin Marinas 
Signed-off-by: Kefeng Wang 
---
 arch/arm64/kernel/hw_breakpoint.c |  8 
 arch/arm64/kernel/smp.c   | 11 +--
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/arch/arm64/kernel/hw_breakpoint.c 
b/arch/arm64/kernel/hw_breakpoint.c
index 38ee1514cd9c..0b727edf4104 100644
--- a/arch/arm64/kernel/hw_breakpoint.c
+++ b/arch/arm64/kernel/hw_breakpoint.c
@@ -51,7 +51,7 @@ int hw_breakpoint_slots(int type)
case TYPE_DATA:
return get_num_wrps();
default:
-   pr_warning("unknown slot type: %d\n", type);
+   pr_warn("unknown slot type: %d\n", type);
return 0;
}
 }
@@ -112,7 +112,7 @@ static u64 read_wb_reg(int reg, int n)
GEN_READ_WB_REG_CASES(AARCH64_DBG_REG_WVR, AARCH64_DBG_REG_NAME_WVR, 
val);
GEN_READ_WB_REG_CASES(AARCH64_DBG_REG_WCR, AARCH64_DBG_REG_NAME_WCR, 
val);
default:
-   pr_warning("attempt to read from unknown breakpoint register 
%d\n", n);
+   pr_warn("attempt to read from unknown breakpoint register 
%d\n", n);
}
 
return val;
@@ -127,7 +127,7 @@ static void write_wb_reg(int reg, int n, u64 val)
GEN_WRITE_WB_REG_CASES(AARCH64_DBG_REG_WVR, AARCH64_DBG_REG_NAME_WVR, 
val);
GEN_WRITE_WB_REG_CASES(AARCH64_DBG_REG_WCR, AARCH64_DBG_REG_NAME_WCR, 
val);
default:
-   pr_warning("attempt to write to unknown breakpoint register 
%d\n", n);
+   pr_warn("attempt to write to unknown breakpoint register %d\n", 
n);
}
isb();
 }
@@ -145,7 +145,7 @@ static enum dbg_active_el debug_exception_level(int 
privilege)
case AARCH64_BREAKPOINT_EL1:
return DBG_ACTIVE_EL1;
default:
-   pr_warning("invalid breakpoint privilege level %d\n", 
privilege);
+   pr_warn("invalid breakpoint privilege level %d\n", privilege);
return -EINVAL;
}
 }
diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c
index dc9fe879c279..ab149bcc3dc7 100644
--- a/arch/arm64/kernel/smp.c
+++ b/arch/arm64/kernel/smp.c
@@ -345,8 +345,7 @@ void __cpu_die(unsigned int cpu)
 */
err = op_cpu_kill(cpu);
if (err)
-   pr_warn("CPU%d may not have shut down cleanly: %d\n",
-   cpu, err);
+   pr_warn("CPU%d may not have shut down cleanly: %d\n", cpu, err);
 }
 
 /*
@@ -976,8 +975,8 @@ void smp_send_stop(void)
udelay(1);
 
if (num_online_cpus() > 1)
-   pr_warning("SMP: failed to stop secondary CPUs %*pbl\n",
-  cpumask_pr_args(cpu_online_mask));
+   pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
+   cpumask_pr_args(cpu_online_mask));
 
sdei_mask_local_cpu();
 }
@@ -1017,8 +1016,8 @@ void crash_smp_send_stop(void)
udelay(1);
 
if (atomic_read(_for_crash_ipi) > 0)
-   pr_warning("SMP: failed to stop secondary CPUs %*pbl\n",
-  cpumask_pr_args());
+   pr_warn("SMP: failed to stop secondary CPUs %*pbl\n",
+   cpumask_pr_args());
 
sdei_mask_local_cpu();
 }
-- 
2.20.1



Re: [PATCH v3 2/6] platform/x86: huawei-wmi: Add quirks and module parameters

2019-09-20 Thread Greg Kroah-Hartman
On Thu, Sep 19, 2019 at 08:39:07PM -0400, Ayman Bagabas wrote:
> Introduce quirks and module parameters. 3 quirks are added:
> 1. Fixes reporting brightness keys twice since it's already handled by
>acpi-video.
> 2. Some models need a short delay when setting battery thresholds to
>prevent a race condition when two processes read/write. (will be used 
> later)
> 3. Matebook X (2017) handles micmute led through the "legacy" interface
>which is not currently implemented. Use ACPI EC method to control
>this led. (will be used later)
> 
> 2 module parameters are added to enable this short delay and/or report
>   brightness keys through this driver.

module parameters are a pain to manage and handle over time.  Is there
any way you can "automatically" figure this out, or use a sysfs file
instead?

thanks,

greg k-h


Re: mt76x2e hardware restart

2019-09-20 Thread Oleksandr Natalenko

On 19.09.2019 23:22, Oleksandr Natalenko wrote:

It checks for TX hang here:

=== mt76x02_mmio.c
557 void mt76x02_wdt_work(struct work_struct *work)
558 {
...
562 mt76x02_check_tx_hang(dev);
===


I've commented out the watchdog here ^^, and the card is not resetted 
any more, but similarly it stops working shortly after the first client 
connects. So, indeed, it must be some hang in the HW, and wdt seems to 
do a correct job.


Is it even debuggable/fixable from the driver?

--
  Oleksandr Natalenko (post-factum)


Re: [PATCH] staging: rtl8192u: fix multiple memory leaks on error path

2019-09-20 Thread Greg Kroah-Hartman
On Thu, Sep 19, 2019 at 09:51:33PM -0500, Navid Emamdoost wrote:
> In rtl8192_tx on error handling path allocated urbs and also skb should
> be released.
> 
> Signed-off-by: Navid Emamdoost 
> ---
>  drivers/staging/rtl8192u/r8192U_core.c | 17 -
>  1 file changed, 12 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/staging/rtl8192u/r8192U_core.c 
> b/drivers/staging/rtl8192u/r8192U_core.c
> index fe1f279ca368..b62b03802b1b 100644
> --- a/drivers/staging/rtl8192u/r8192U_core.c
> +++ b/drivers/staging/rtl8192u/r8192U_core.c
> @@ -1422,7 +1422,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
> *skb)
>   (struct tx_fwinfo_819x_usb *)(skb->data + 
> USB_HWDESC_HEADER_LEN);
>   struct usb_device *udev = priv->udev;
>   int pend;
> - int status;
> + int status, rt = -1;
>   struct urb *tx_urb = NULL, *tx_urb_zero = NULL;
>   unsigned int idx_pipe;
>  
> @@ -1566,8 +1566,10 @@ short rtl8192_tx(struct net_device *dev, struct 
> sk_buff *skb)
>   }
>   if (bSend0Byte) {
>   tx_urb_zero = usb_alloc_urb(0, GFP_ATOMIC);
> - if (!tx_urb_zero)
> - return -ENOMEM;
> + if (!tx_urb_zero) {
> + rt = -ENOMEM;
> + goto error;
> + }
>   usb_fill_bulk_urb(tx_urb_zero, udev,
> usb_sndbulkpipe(udev, idx_pipe),
> , 0, tx_zero_isr, dev);
> @@ -1577,7 +1579,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff 
> *skb)
>"Error TX URB for zero byte %d, error 
> %d",
>
> atomic_read(>tx_pending[tcb_desc->queue_index]),
>status);
> - return -1;
> + goto error;
>   }
>   }
>   netif_trans_update(dev);
> @@ -1588,7 +1590,12 @@ short rtl8192_tx(struct net_device *dev, struct 
> sk_buff *skb)
>   RT_TRACE(COMP_ERR, "Error TX URB %d, error %d",
>atomic_read(>tx_pending[tcb_desc->queue_index]),
>status);
> - return -1;
> +
> +error:
> + dev_kfree_skb_any(skb);
> + usb_free_urb(tx_urb);
> + usb_free_urb(tx_urb_zero);
> + return rt;
>  }
>  
>  static short rtl8192_usb_initendpoints(struct net_device *dev)
> -- 
> 2.17.1
> 
> ___
> devel mailing list
> de...@linuxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Hi,

This is the friendly semi-automated patch-bot of Greg Kroah-Hartman.
You have sent him a patch that has triggered this response.

Right now, the development tree you have sent a patch for is "closed"
due to the timing of the merge window.  Don't worry, the patch(es) you
have sent are not lost, and will be looked at after the merge window is
over (after the -rc1 kernel is released by Linus).

So thank you for your patience and your patches will be reviewed at this
later time, you do not have to do anything further, this is just a short
note to let you know the patch status and so you don't worry they didn't
make it through.

thanks,

greg k-h's patch email bot


Re: [PATCH] tty:vt: Add check the return value of kzalloc to avoid oops

2019-09-20 Thread Greg KH
On Fri, Sep 20, 2019 at 02:29:49AM +, Nixiaoming wrote:
> On 2019/9/19 17:30, Greg KH wrote:
> > On Thu, Sep 19, 2019 at 05:18:15PM +0800, Xiaoming Ni wrote:
> >> Using kzalloc() to allocate memory in function con_init(), but not
> >> checking the return value, there is a risk of null pointer references
> >> oops.
> >>
> >> Signed-off-by: Xiaoming Ni 
> >
> > We keep having this be "reported" 
> >
> >> ---
> >>  drivers/tty/vt/vt.c | 18 ++
> >>  1 file changed, 18 insertions(+)
> >>
> >> diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
> >> index 34aa39d..db83e52 100644
> >> --- a/drivers/tty/vt/vt.c
> >> +++ b/drivers/tty/vt/vt.c
> >> @@ -3357,15 +3357,33 @@ static int __init con_init(void)
> >>  
> >>for (currcons = 0; currcons < MIN_NR_CONSOLES; currcons++) {
> >>vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), 
> >> GFP_NOWAIT);
> >> +  if (unlikely(!vc)) {
> >> +  pr_warn("%s:failed to allocate memory for the %u vc\n",
> >> +  __func__, currcons);
> >> +  break;
> >> +  }
> >
> > At init, this really can not happen.  Have you see it ever happen?
> 
> I did not actually observe the null pointer here.
> I am confused when I see the code allocated here without check the return 
> value.
> Small memory allocation failures are difficult to occur during system 
> initialization
> But is it not safe enough if the code is not judged?
> Also if the memory allocation failure is not allowed here, is it better to 
> add the __GFP_NOFAIL flags?

See my response to Nicolas, but yes, that would be a good way to handle
this.

thanks,

greg k-h


Re: [PATCH] tty:vt: Add check the return value of kzalloc to avoid oops

2019-09-20 Thread Greg KH
On Thu, Sep 19, 2019 at 10:56:15PM -0400, Nicolas Pitre wrote:
> On Thu, 19 Sep 2019, Greg KH wrote:
> 
> > On Thu, Sep 19, 2019 at 05:18:15PM +0800, Xiaoming Ni wrote:
> > > Using kzalloc() to allocate memory in function con_init(), but not
> > > checking the return value, there is a risk of null pointer references
> > > oops.
> > > 
> > > Signed-off-by: Xiaoming Ni 
> > 
> > We keep having this be "reported" :(
> 
> Something probably needs to be "communicated" about that.

I know, but it's also kind of fun to see what these "automated" checkers
find, sometimes the resulting patches almost work properly :)

This one is really close, I think if the likely/unlikely gets cleaned
up, it is viable.

> > >   vc_cons[currcons].d = vc = kzalloc(sizeof(struct vc_data), 
> > > GFP_NOWAIT);
> > > + if (unlikely(!vc)) {
> > > + pr_warn("%s:failed to allocate memory for the %u vc\n",
> > > + __func__, currcons);
> > > + break;
> > > + }
> > 
> > At init, this really can not happen.  Have you see it ever happen?
> 
> This is maybe too subtle a fact. The "communication" could be done with 
> some GFP_WONTFAIL flag, and have the allocator simply pannic() if it 
> ever fails.

That's a good idea to do as well.

thanks,

greg k-h


[PATCH -next] w1: ds250x: Fix build error without CRC16

2019-09-20 Thread YueHaibing
If CRC16 is not set, building will fails:

drivers/w1/slaves/w1_ds250x.o: In function `w1_ds2505_read_page':
w1_ds250x.c:(.text+0x82f): undefined reference to `crc16'
w1_ds250x.c:(.text+0x90a): undefined reference to `crc16'
w1_ds250x.c:(.text+0x91a): undefined reference to `crc16'

Reported-by: Hulk Robot 
Fixes: 25ec8710d9c2 ("w1: add DS2501, DS2502, DS2505 EPROM device driver")
Signed-off-by: YueHaibing 
---
 drivers/w1/slaves/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig
index ebed495b..b784763 100644
--- a/drivers/w1/slaves/Kconfig
+++ b/drivers/w1/slaves/Kconfig
@@ -103,6 +103,7 @@ config W1_SLAVE_DS2438
 
 config W1_SLAVE_DS250X
tristate "512b/1kb/16kb EPROM family support"
+   select CRC16
help
  Say Y here if you want to use a 1-wire
  512b/1kb/16kb EPROM family device (DS250x).
-- 
2.7.4




Re: [PATCH 2/2] gpio: iproc-gpio: Handle interrupts for multiple instances

2019-09-20 Thread Srinath Mannam
Hi Linus,

We have tested patch with your changes, it works fine.
Thanks a lot for all the help.

Regards,
Srinath.

On Wed, Sep 11, 2019 at 3:13 PM Linus Walleij  wrote:
>
> On Thu, Aug 29, 2019 at 5:52 AM Srinath Mannam
>  wrote:
>
> > From: Rayagonda Kokatanur 
> >
> > When multiple instance of iproc-gpio chips are present, a fix up
> > message[1] is printed during the probe of second and later instances.
> >
> > This issue is because driver sharing same irq_chip data structure
> > among multiple instances of driver.
> >
> > Fix this by allocating irq_chip data structure per instance of
> > iproc-gpio.
> >
> > [1] fix up message addressed by this patch
> > [  7.862208] gpio gpiochip2: (689d.gpio): detected irqchip that
> >is shared with multiple gpiochips: please fix the driver.
> >
> > Fixes: 616043d58a89 ("pinctrl: Rename gpio driver from cygnus to iproc")
> > Signed-off-by: Rayagonda Kokatanur 
>
> Patch applied, I had to rewrite it a bit to fit the new code that
> set up the irqchip when adding the gpio_chip, please check that
> the result works.
>
> Yours,
> Linus Walleij


<    5   6   7   8   9   10