From 4eb147c83f34e00184557923d2bf93f593deb41c Mon Sep 17 00:00:00 2001 From: Rickard Strandqvist Date: Sat, 26 Jul 2014 15:58:22 +0200 Subject: arch: blackfin: kernel: setup.c: Cleaning up missing null-terminate in conjunction with strncpy Replacing strncpy with strlcpy to avoid strings that lacks null terminate. Signed-off-by: Rickard Strandqvist Signed-off-by: Steven Miao --- arch/blackfin/kernel/setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/blackfin/kernel') diff --git a/arch/blackfin/kernel/setup.c b/arch/blackfin/kernel/setup.c index 4f424ae3b36d..ad82468bd94d 100644 --- a/arch/blackfin/kernel/setup.c +++ b/arch/blackfin/kernel/setup.c @@ -1464,5 +1464,5 @@ void __init cmdline_init(const char *r0) { early_shadow_stamp(); if (r0) - strncpy(command_line, r0, COMMAND_LINE_SIZE); + strlcpy(command_line, r0, COMMAND_LINE_SIZE); } -- cgit v1.2.3 From a0f4207d03b40eee6338b51288849965ac2b94e2 Mon Sep 17 00:00:00 2001 From: Sonic Zhang Date: Tue, 29 Jul 2014 16:41:10 +0800 Subject: bug[220] kgdb: change the smp cross core function entry Signed-off-by: Sonic Zhang --- arch/blackfin/kernel/kgdb.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'arch/blackfin/kernel') diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index fa53faeeb0e9..48dacde30550 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c @@ -330,9 +330,6 @@ static void bfin_disable_hw_debug(struct pt_regs *regs) } #ifdef CONFIG_SMP -extern void generic_exec_single(int cpu, struct call_single_data *data, int wait); -static struct call_single_data kgdb_smp_ipi_data[NR_CPUS]; - void kgdb_passive_cpu_callback(void *info) { kgdb_nmicallback(raw_smp_processor_id(), get_irq_regs()); @@ -343,15 +340,14 @@ void kgdb_roundup_cpus(unsigned long flags) unsigned int cpu; for (cpu = cpumask_first(cpu_online_mask); cpu < nr_cpu_ids; - cpu = cpumask_next(cpu, cpu_online_mask)) { - kgdb_smp_ipi_data[cpu].func = kgdb_passive_cpu_callback; - generic_exec_single(cpu, &kgdb_smp_ipi_data[cpu], 0); - } + cpu = cpumask_next(cpu, cpu_online_mask)) + smp_call_function_single(cpu, kgdb_passive_cpu_callback, + NULL, 0); } void kgdb_roundup_cpu(int cpu, unsigned long flags) { - generic_exec_single(cpu, &kgdb_smp_ipi_data[cpu], 0); + smp_call_function_single(cpu, kgdb_passive_cpu_callback, NULL, 0); } #endif -- cgit v1.2.3 From bb717b33aa6b01abcc78c7a18dec343a3bde9574 Mon Sep 17 00:00:00 2001 From: Andre Wolokita Date: Fri, 5 Sep 2014 10:42:28 +1000 Subject: debug-mmrs: Eliminate all traces of the USB_PHY_TEST MMR Interacting with the USB_PHY_TEST MMR through debugfs was causing wide-spread chaos in the realm (kernel panic). Expunge all references to this demonic register. Signed-off-by: Andre Wolokita --- arch/blackfin/kernel/debug-mmrs.c | 1 - arch/blackfin/mach-bf527/include/mach/cdefBF525.h | 5 ----- arch/blackfin/mach-bf527/include/mach/defBF525.h | 4 ---- arch/blackfin/mach-bf548/include/mach/cdefBF542.h | 4 ---- arch/blackfin/mach-bf548/include/mach/cdefBF547.h | 4 ---- arch/blackfin/mach-bf548/include/mach/defBF542.h | 3 --- arch/blackfin/mach-bf548/include/mach/defBF547.h | 3 --- 7 files changed, 24 deletions(-) (limited to 'arch/blackfin/kernel') diff --git a/arch/blackfin/kernel/debug-mmrs.c b/arch/blackfin/kernel/debug-mmrs.c index 947ad0832338..86b1cd3a0309 100644 --- a/arch/blackfin/kernel/debug-mmrs.c +++ b/arch/blackfin/kernel/debug-mmrs.c @@ -1620,7 +1620,6 @@ static int __init bfin_debug_mmrs_init(void) D16(USB_APHY_CNTRL); D16(USB_APHY_CALIB); D16(USB_APHY_CNTRL2); - D16(USB_PHY_TEST); D16(USB_PLLOSC_CTRL); D16(USB_SRP_CLKDIV); D16(USB_EP_NI0_TXMAXP); diff --git a/arch/blackfin/mach-bf527/include/mach/cdefBF525.h b/arch/blackfin/mach-bf527/include/mach/cdefBF525.h index d90a85b6b6b9..bd045318a250 100644 --- a/arch/blackfin/mach-bf527/include/mach/cdefBF525.h +++ b/arch/blackfin/mach-bf527/include/mach/cdefBF525.h @@ -122,11 +122,6 @@ #define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2) #define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val) -/* (PHY_TEST is for ADI usage only) */ - -#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST) -#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val) - #define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL) #define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val) #define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV) diff --git a/arch/blackfin/mach-bf527/include/mach/defBF525.h b/arch/blackfin/mach-bf527/include/mach/defBF525.h index 71578d964d00..591e00ff620a 100644 --- a/arch/blackfin/mach-bf527/include/mach/defBF525.h +++ b/arch/blackfin/mach-bf527/include/mach/defBF525.h @@ -77,10 +77,6 @@ #define USB_APHY_CNTRL2 0xffc039e8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */ -/* (PHY_TEST is for ADI usage only) */ - -#define USB_PHY_TEST 0xffc039ec /* Used for reducing simulation time and simplifies FIFO testability */ - #define USB_PLLOSC_CTRL 0xffc039f0 /* Used to program different parameters for USB PLL and Oscillator */ #define USB_SRP_CLKDIV 0xffc039f4 /* Used to program clock divide value for the clock fed to the SRP detection logic */ diff --git a/arch/blackfin/mach-bf548/include/mach/cdefBF542.h b/arch/blackfin/mach-bf548/include/mach/cdefBF542.h index d09c19cd1b7b..916347901d5a 100644 --- a/arch/blackfin/mach-bf548/include/mach/cdefBF542.h +++ b/arch/blackfin/mach-bf548/include/mach/cdefBF542.h @@ -241,10 +241,6 @@ #define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2) #define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val) -/* (PHY_TEST is for ADI usage only) */ - -#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST) -#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val) #define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL) #define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val) #define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV) diff --git a/arch/blackfin/mach-bf548/include/mach/cdefBF547.h b/arch/blackfin/mach-bf548/include/mach/cdefBF547.h index bcb9726dea54..be83f645bba8 100644 --- a/arch/blackfin/mach-bf548/include/mach/cdefBF547.h +++ b/arch/blackfin/mach-bf548/include/mach/cdefBF547.h @@ -408,10 +408,6 @@ #define bfin_read_USB_APHY_CNTRL2() bfin_read16(USB_APHY_CNTRL2) #define bfin_write_USB_APHY_CNTRL2(val) bfin_write16(USB_APHY_CNTRL2, val) -/* (PHY_TEST is for ADI usage only) */ - -#define bfin_read_USB_PHY_TEST() bfin_read16(USB_PHY_TEST) -#define bfin_write_USB_PHY_TEST(val) bfin_write16(USB_PHY_TEST, val) #define bfin_read_USB_PLLOSC_CTRL() bfin_read16(USB_PLLOSC_CTRL) #define bfin_write_USB_PLLOSC_CTRL(val) bfin_write16(USB_PLLOSC_CTRL, val) #define bfin_read_USB_SRP_CLKDIV() bfin_read16(USB_SRP_CLKDIV) diff --git a/arch/blackfin/mach-bf548/include/mach/defBF542.h b/arch/blackfin/mach-bf548/include/mach/defBF542.h index 51161575a163..ae4b889e3606 100644 --- a/arch/blackfin/mach-bf548/include/mach/defBF542.h +++ b/arch/blackfin/mach-bf548/include/mach/defBF542.h @@ -140,9 +140,6 @@ #define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */ #define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */ -/* (PHY_TEST is for ADI usage only) */ - -#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */ #define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */ #define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */ diff --git a/arch/blackfin/mach-bf548/include/mach/defBF547.h b/arch/blackfin/mach-bf548/include/mach/defBF547.h index d55dcc0f5324..7cc7928a3c73 100644 --- a/arch/blackfin/mach-bf548/include/mach/defBF547.h +++ b/arch/blackfin/mach-bf548/include/mach/defBF547.h @@ -254,9 +254,6 @@ #define USB_APHY_CALIB 0xffc03de4 /* Register used to set some calibration values */ #define USB_APHY_CNTRL2 0xffc03de8 /* Register used to prevent re-enumeration once Moab goes into hibernate mode */ -/* (PHY_TEST is for ADI usage only) */ - -#define USB_PHY_TEST 0xffc03dec /* Used for reducing simulation time and simplifies FIFO testability */ #define USB_PLLOSC_CTRL 0xffc03df0 /* Used to program different parameters for USB PLL and Oscillator */ #define USB_SRP_CLKDIV 0xffc03df4 /* Used to program clock divide value for the clock fed to the SRP detection logic */ -- cgit v1.2.3 From b9061ef5d4da934cfc6e052a1e486077d29f267d Mon Sep 17 00:00:00 2001 From: Rickard Strandqvist Date: Thu, 1 Jan 2015 18:54:26 +0100 Subject: arch: blackfin: kernel: kgdb: Remove unused function Remove the function kgdb_post_primary_code() that is not used anywhere. This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist Acked-by: Sonic Zhang --- arch/blackfin/kernel/kgdb.c | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'arch/blackfin/kernel') diff --git a/arch/blackfin/kernel/kgdb.c b/arch/blackfin/kernel/kgdb.c index 48dacde30550..cf773f0f1f30 100644 --- a/arch/blackfin/kernel/kgdb.c +++ b/arch/blackfin/kernel/kgdb.c @@ -355,19 +355,6 @@ void kgdb_roundup_cpu(int cpu, unsigned long flags) static unsigned long kgdb_arch_imask; #endif -void kgdb_post_primary_code(struct pt_regs *regs, int e_vector, int err_code) -{ - if (kgdb_single_step) - preempt_enable(); - -#ifdef CONFIG_IPIPE - if (kgdb_arch_imask) { - cpu_pda[raw_smp_processor_id()].ex_imask = kgdb_arch_imask; - kgdb_arch_imask = 0; - } -#endif -} - int kgdb_arch_handle_exception(int vector, int signo, int err_code, char *remcom_in_buffer, char *remcom_out_buffer, -- cgit v1.2.3