[tip:sched/urgent] ia64, sched/cputime: Fix build error if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y

2018-01-06 Thread tip-bot for Valentin Ilie
Commit-ID:  7729bebc619307a0233c86f8585a4bf3eadc7ce4
Gitweb: https://git.kernel.org/tip/7729bebc619307a0233c86f8585a4bf3eadc7ce4
Author: Valentin Ilie <valentin.i...@gmail.com>
AuthorDate: Fri, 5 Jan 2018 23:12:59 +
Committer:  Ingo Molnar <mi...@kernel.org>
CommitDate: Sat, 6 Jan 2018 11:48:34 +0100

ia64, sched/cputime: Fix build error if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y

Remove the extra parenthesis.

This bug was introduced by:

  e2339a4caa5e: ("ia64: Convert vtime to use nsec units directly")

Signed-off-by: Valentin Ilie <valentin.i...@gmail.com>
Cc: Linus Torvalds <torva...@linux-foundation.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Cc: Thomas Gleixner <t...@linutronix.de>
Cc: fenghua...@intel.com
Cc: linux-i...@vger.kernel.org
Cc: tony.l...@intel.com
Link: 
http://lkml.kernel.org/r/1515193979-24873-1-git-send-email-valentin.i...@gmail.com
Signed-off-by: Ingo Molnar <mi...@kernel.org>
---
 arch/ia64/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index c6ecb97..9025699 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -88,7 +88,7 @@ void vtime_flush(struct task_struct *tsk)
}
 
if (ti->softirq_time) {
-   delta = cycle_to_nsec(ti->softirq_time));
+   delta = cycle_to_nsec(ti->softirq_time);
account_system_index_time(tsk, delta, CPUTIME_SOFTIRQ);
}
 


[tip:sched/urgent] ia64, sched/cputime: Fix build error if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y

2018-01-06 Thread tip-bot for Valentin Ilie
Commit-ID:  7729bebc619307a0233c86f8585a4bf3eadc7ce4
Gitweb: https://git.kernel.org/tip/7729bebc619307a0233c86f8585a4bf3eadc7ce4
Author: Valentin Ilie 
AuthorDate: Fri, 5 Jan 2018 23:12:59 +
Committer:  Ingo Molnar 
CommitDate: Sat, 6 Jan 2018 11:48:34 +0100

ia64, sched/cputime: Fix build error if CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y

Remove the extra parenthesis.

This bug was introduced by:

  e2339a4caa5e: ("ia64: Convert vtime to use nsec units directly")

Signed-off-by: Valentin Ilie 
Cc: Linus Torvalds 
Cc: Peter Zijlstra 
Cc: Thomas Gleixner 
Cc: fenghua...@intel.com
Cc: linux-i...@vger.kernel.org
Cc: tony.l...@intel.com
Link: 
http://lkml.kernel.org/r/1515193979-24873-1-git-send-email-valentin.i...@gmail.com
Signed-off-by: Ingo Molnar 
---
 arch/ia64/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index c6ecb97..9025699 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -88,7 +88,7 @@ void vtime_flush(struct task_struct *tsk)
}
 
if (ti->softirq_time) {
-   delta = cycle_to_nsec(ti->softirq_time));
+   delta = cycle_to_nsec(ti->softirq_time);
account_system_index_time(tsk, delta, CPUTIME_SOFTIRQ);
}
 


[PATCH] ia64: Fix syntax error introduced by e2339a4caa5e

2018-01-05 Thread Valentin Ilie
Remove extra parentheses.

Signed-off-by: Valentin Ilie <valentin.i...@gmail.com>
---
 arch/ia64/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index c6ecb97..9025699 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -88,7 +88,7 @@ void vtime_flush(struct task_struct *tsk)
}
 
if (ti->softirq_time) {
-   delta = cycle_to_nsec(ti->softirq_time));
+   delta = cycle_to_nsec(ti->softirq_time);
account_system_index_time(tsk, delta, CPUTIME_SOFTIRQ);
}
 
-- 
2.7.4



[PATCH] ia64: Fix syntax error introduced by e2339a4caa5e

2018-01-05 Thread Valentin Ilie
Remove extra parentheses.

Signed-off-by: Valentin Ilie 
---
 arch/ia64/kernel/time.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index c6ecb97..9025699 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -88,7 +88,7 @@ void vtime_flush(struct task_struct *tsk)
}
 
if (ti->softirq_time) {
-   delta = cycle_to_nsec(ti->softirq_time));
+   delta = cycle_to_nsec(ti->softirq_time);
account_system_index_time(tsk, delta, CPUTIME_SOFTIRQ);
}
 
-- 
2.7.4



Re: [PATCH] mm/page_owner: Fix memory leak

2015-01-16 Thread Valentin Ilie
On 16 January 2015 at 17:30, Paul Bolle  wrote:
> Before you resend: what happens to the resources of a userspace program
> when its main() returns?

On top of that, I should have used free, not kfree. I will resend v2 ..

Sorry for the mess

-- 
Valentin
--
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/


[PATCH] mm/page_owner: Fix memory leak

2015-01-16 Thread Valentin Ilie
Call kfree on list2 after using it.

Signed-off-by: Valentin Ilie 
---
 tools/vm/page_owner_sort.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/vm/page_owner_sort.c b/tools/vm/page_owner_sort.c
index 77147b4..92292d5 100644
--- a/tools/vm/page_owner_sort.c
+++ b/tools/vm/page_owner_sort.c
@@ -139,6 +139,8 @@ int main(int argc, char **argv)
 
for (i = 0; i < count; i++)
fprintf(fout, "%d times:\n%s\n", list2[i].num, list2[i].txt);
+   
+   kfree(list2);
 
return 0;
 }
-- 
2.1.0

--
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/


[PATCH] mm/page_owner: Fix memory leak

2015-01-16 Thread Valentin Ilie
Call kfree on list2 after using it.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 tools/vm/page_owner_sort.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/vm/page_owner_sort.c b/tools/vm/page_owner_sort.c
index 77147b4..92292d5 100644
--- a/tools/vm/page_owner_sort.c
+++ b/tools/vm/page_owner_sort.c
@@ -139,6 +139,8 @@ int main(int argc, char **argv)
 
for (i = 0; i  count; i++)
fprintf(fout, %d times:\n%s\n, list2[i].num, list2[i].txt);
+   
+   kfree(list2);
 
return 0;
 }
-- 
2.1.0

--
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/


Re: [PATCH] mm/page_owner: Fix memory leak

2015-01-16 Thread Valentin Ilie
On 16 January 2015 at 17:30, Paul Bolle pebo...@tiscali.nl wrote:
 Before you resend: what happens to the resources of a userspace program
 when its main() returns?

On top of that, I should have used free, not kfree. I will resend v2 ..

Sorry for the mess

-- 
Valentin
--
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/


[PATCH] connector - documentation: close opened file descriptor

2014-09-17 Thread Valentin Ilie
For the logging process, we use either a file or stdout.

In the case of a file, we need to fix that by calling fclose at the right time.
In the case we end up calling fclose to stdout, we will not impact the program 
because we do it at its very end.

Signed-off-by: Valentin Ilie 
---
 Documentation/connector/ucon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
index 8a4da64..f9d785b 100644
--- a/Documentation/connector/ucon.c
+++ b/Documentation/connector/ucon.c
@@ -246,5 +246,6 @@ int main(int argc, char *argv[])
}
 
close(s);
+   fclose(out);
return 0;
 }
-- 
1.9.1

--
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/


[PATCH] connector - documentation: close opened file descriptor

2014-09-17 Thread Valentin Ilie
For the logging process, we use either a file or stdout.

In the case of a file, we need to fix that by calling fclose at the right time.
In the case we end up calling fclose to stdout, we will not impact the program 
because we do it at its very end.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 Documentation/connector/ucon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c
index 8a4da64..f9d785b 100644
--- a/Documentation/connector/ucon.c
+++ b/Documentation/connector/ucon.c
@@ -246,5 +246,6 @@ int main(int argc, char *argv[])
}
 
close(s);
+   fclose(out);
return 0;
 }
-- 
1.9.1

--
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/


Re: [PATCH] clk: st: Fix memory leak

2014-05-21 Thread Valentin Ilie
Hi,

Even though the probability of getting a memory leak here is small I
think this patch is worth applying.

Thanks,
Valentin

On 6 May 2014 15:32, Gabriel Fernandez  wrote:
> Hi Valentin
> Thanks for the patch, i agree with it.
>
> Mike do you planned to integrate this patch ?
>
> Gabriel.
>
> Best Regards.
>
>
>
> On 05/06/2014 11:29 AM, Valentin Ilie wrote:
>>
>> On 22 April 2014 16:15, Valentin Ilie  wrote:
>>>
>>> When it fails to allocate div, gate should be free'd before return
>>>
>>> Signed-off-by: Valentin Ilie 
>>> ---
>>>   drivers/clk/st/clkgen-pll.c | 4 +++-
>>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
>>> index bca0a0b..a886702 100644
>>> --- a/drivers/clk/st/clkgen-pll.c
>>> +++ b/drivers/clk/st/clkgen-pll.c
>>> @@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const
>>> char *parent_name,
>>>  gate->lock = odf_lock;
>>>
>>>  div = kzalloc(sizeof(*div), GFP_KERNEL);
>>> -   if (!div)
>>> +   if (!div) {
>>> +   kfree(gate);
>>>  return ERR_PTR(-ENOMEM);
>>> +   }
>>>
>>>  div->flags = CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO;
>>>  div->reg = reg + pll_data->odf[odf].offset;
>>> --
>>> 1.8.3.2
>>>
>> Can someone look into this?
>>
>



-- 
Valentin Ilie
+(40) 746 188 558
--
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/


Re: [PATCH] clk: st: Fix memory leak

2014-05-21 Thread Valentin Ilie
Hi,

Even though the probability of getting a memory leak here is small I
think this patch is worth applying.

Thanks,
Valentin

On 6 May 2014 15:32, Gabriel Fernandez gabriel.fernan...@st.com wrote:
 Hi Valentin
 Thanks for the patch, i agree with it.

 Mike do you planned to integrate this patch ?

 Gabriel.

 Best Regards.



 On 05/06/2014 11:29 AM, Valentin Ilie wrote:

 On 22 April 2014 16:15, Valentin Ilie valentin.i...@gmail.com wrote:

 When it fails to allocate div, gate should be free'd before return

 Signed-off-by: Valentin Ilie valentin.i...@gmail.com
 ---
   drivers/clk/st/clkgen-pll.c | 4 +++-
   1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
 index bca0a0b..a886702 100644
 --- a/drivers/clk/st/clkgen-pll.c
 +++ b/drivers/clk/st/clkgen-pll.c
 @@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const
 char *parent_name,
  gate-lock = odf_lock;

  div = kzalloc(sizeof(*div), GFP_KERNEL);
 -   if (!div)
 +   if (!div) {
 +   kfree(gate);
  return ERR_PTR(-ENOMEM);
 +   }

  div-flags = CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO;
  div-reg = reg + pll_data-odf[odf].offset;
 --
 1.8.3.2

 Can someone look into this?





-- 
Valentin Ilie
+(40) 746 188 558
--
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/


Re: [PATCH] clk: st: Fix memory leak

2014-05-06 Thread Valentin Ilie
On 22 April 2014 16:15, Valentin Ilie  wrote:
> When it fails to allocate div, gate should be free'd before return
>
> Signed-off-by: Valentin Ilie 
> ---
>  drivers/clk/st/clkgen-pll.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
> index bca0a0b..a886702 100644
> --- a/drivers/clk/st/clkgen-pll.c
> +++ b/drivers/clk/st/clkgen-pll.c
> @@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const 
> char *parent_name,
> gate->lock = odf_lock;
>
> div = kzalloc(sizeof(*div), GFP_KERNEL);
> -   if (!div)
> +   if (!div) {
> +   kfree(gate);
> return ERR_PTR(-ENOMEM);
> +   }
>
> div->flags = CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO;
> div->reg = reg + pll_data->odf[odf].offset;
> --
> 1.8.3.2
>

Can someone look into this?

-- 
Valentin Ilie
--
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/


Re: [PATCH] clk: st: Fix memory leak

2014-05-06 Thread Valentin Ilie
On 22 April 2014 16:15, Valentin Ilie valentin.i...@gmail.com wrote:
 When it fails to allocate div, gate should be free'd before return

 Signed-off-by: Valentin Ilie valentin.i...@gmail.com
 ---
  drivers/clk/st/clkgen-pll.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
 index bca0a0b..a886702 100644
 --- a/drivers/clk/st/clkgen-pll.c
 +++ b/drivers/clk/st/clkgen-pll.c
 @@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const 
 char *parent_name,
 gate-lock = odf_lock;

 div = kzalloc(sizeof(*div), GFP_KERNEL);
 -   if (!div)
 +   if (!div) {
 +   kfree(gate);
 return ERR_PTR(-ENOMEM);
 +   }

 div-flags = CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO;
 div-reg = reg + pll_data-odf[odf].offset;
 --
 1.8.3.2


Can someone look into this?

-- 
Valentin Ilie
--
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/


[PATCH] clk: st: Fix memory leak

2014-04-22 Thread Valentin Ilie
When it fails to allocate div, gate should be free'd before return

Signed-off-by: Valentin Ilie 
---
 drivers/clk/st/clkgen-pll.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
index bca0a0b..a886702 100644
--- a/drivers/clk/st/clkgen-pll.c
+++ b/drivers/clk/st/clkgen-pll.c
@@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const char 
*parent_name,
gate->lock = odf_lock;
 
div = kzalloc(sizeof(*div), GFP_KERNEL);
-   if (!div)
+   if (!div) {
+   kfree(gate);
return ERR_PTR(-ENOMEM);
+   }
 
div->flags = CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO;
div->reg = reg + pll_data->odf[odf].offset;
-- 
1.8.3.2

--
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/


[PATCH] clk: st: Fix memory leak

2014-04-22 Thread Valentin Ilie
When it fails to allocate div, gate should be free'd before return

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/clk/st/clkgen-pll.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c
index bca0a0b..a886702 100644
--- a/drivers/clk/st/clkgen-pll.c
+++ b/drivers/clk/st/clkgen-pll.c
@@ -521,8 +521,10 @@ static struct clk * __init clkgen_odf_register(const char 
*parent_name,
gate-lock = odf_lock;
 
div = kzalloc(sizeof(*div), GFP_KERNEL);
-   if (!div)
+   if (!div) {
+   kfree(gate);
return ERR_PTR(-ENOMEM);
+   }
 
div-flags = CLK_DIVIDER_ONE_BASED | CLK_DIVIDER_ALLOW_ZERO;
div-reg = reg + pll_data-odf[odf].offset;
-- 
1.8.3.2

--
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/


[PATCH] dma: edma: Fix memory leak

2013-10-24 Thread Valentin Ilie
When it fails to allocate a slot, edesc should be free'd before return;

Signed-off-by: Valentin Ilie 
---
 drivers/dma/edma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 098a8da..79ebac6 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -305,6 +305,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
edma_alloc_slot(EDMA_CTLR(echan->ch_num),
EDMA_SLOT_ANY);
if (echan->slot[i] < 0) {
+   kfree(edesc);
dev_err(dev, "Failed to allocate slot\n");
return NULL;
}
-- 
1.8.1.2

--
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/


[PATCH] clk: sunxi: fix memory leaks

2013-10-24 Thread Valentin Ilie
When the if condition is true, "fixed" and "gate" should be free'd before 
return.

Signed-off-by: Valentin Ilie 
---
 drivers/clk/sunxi/clk-sunxi.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 34ee69f..a970b55 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -48,8 +48,11 @@ static void __init sun4i_osc_clk_setup(struct device_node 
*node)
return;
}
 
-   if (of_property_read_u32(node, "clock-frequency", ))
+   if (of_property_read_u32(node, "clock-frequency", )) {
+   kfree(fixed);
+   kfree(gate);
return;
+   }
 
/* set up gate and fixed rate properties */
gate->reg = of_iomap(node, 0);
-- 
1.8.1.2

--
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/


[PATCH] clk: sunxi: fix memory leaks

2013-10-24 Thread Valentin Ilie
When the if condition is true, fixed and gate should be free'd before 
return.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/clk/sunxi/clk-sunxi.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi/clk-sunxi.c b/drivers/clk/sunxi/clk-sunxi.c
index 34ee69f..a970b55 100644
--- a/drivers/clk/sunxi/clk-sunxi.c
+++ b/drivers/clk/sunxi/clk-sunxi.c
@@ -48,8 +48,11 @@ static void __init sun4i_osc_clk_setup(struct device_node 
*node)
return;
}
 
-   if (of_property_read_u32(node, clock-frequency, rate))
+   if (of_property_read_u32(node, clock-frequency, rate)) {
+   kfree(fixed);
+   kfree(gate);
return;
+   }
 
/* set up gate and fixed rate properties */
gate-reg = of_iomap(node, 0);
-- 
1.8.1.2

--
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/


[PATCH] dma: edma: Fix memory leak

2013-10-24 Thread Valentin Ilie
When it fails to allocate a slot, edesc should be free'd before return;

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/dma/edma.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c
index 098a8da..79ebac6 100644
--- a/drivers/dma/edma.c
+++ b/drivers/dma/edma.c
@@ -305,6 +305,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg(
edma_alloc_slot(EDMA_CTLR(echan-ch_num),
EDMA_SLOT_ANY);
if (echan-slot[i]  0) {
+   kfree(edesc);
dev_err(dev, Failed to allocate slot\n);
return NULL;
}
-- 
1.8.1.2

--
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/


Re: [PATCH] ARM: mach-iop32x: iq31244: Replace if-then-else with a switch statement

2013-09-29 Thread Valentin Ilie
On 2 September 2013 18:23, Valentin Ilie  wrote:
> Convert a compound if-else blob to a switch statement.
>
> Signed-off-by: Valentin Ilie 
> ---
>  arch/arm/mach-iop32x/iq31244.c | 29 +++--
>  1 file changed, 11 insertions(+), 18 deletions(-)
>
> diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
> index f2cd296..3415f11 100644
> --- a/arch/arm/mach-iop32x/iq31244.c
> +++ b/arch/arm/mach-iop32x/iq31244.c
> @@ -101,28 +101,21 @@ void __init iq31244_map_io(void)
>  static int __init
>  ep80219_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
>  {
> -   int irq;
> -
> -   if (slot == 0) {
> -   /* CFlash */
> -   irq = IRQ_IOP32X_XINT1;
> -   } else if (slot == 1) {
> -   /* 82551 Pro 100 */
> -   irq = IRQ_IOP32X_XINT0;
> -   } else if (slot == 2) {
> -   /* PCI-X Slot */
> -   irq = IRQ_IOP32X_XINT3;
> -   } else if (slot == 3) {
> -   /* SATA */
> -   irq = IRQ_IOP32X_XINT2;
> -   } else {
> +   switch (slot) {
> +   case 0: /* CFlash */
> +   return IRQ_IOP32X_XINT1;
> +   case 1: /* 82551 Pro 100 */
> +   return IRQ_IOP32X_XINT0;
> +   case 2: /* PCI-X Slot */
> +   return IRQ_IOP32X_XINT3;
> +   case 3: /* SATA */
> +   return IRQ_IOP32X_XINT2;
> +   default:
> printk(KERN_ERR "ep80219_pci_map_irq() called for unknown "
> "device PCI:%d:%d:%d\n", dev->bus->number,
> PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
> -   irq = -1;
> +   return -1;
> }
> -
> -   return irq;
>  }
>
>  static struct hw_pci ep80219_pci __initdata = {
> --
> 1.8.1.2
>

Can someone look into this?

-- 
Valentin Ilie
--
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/


Re: [PATCH] ARM: mach-iop32x: iq31244: Replace if-then-else with a switch statement

2013-09-29 Thread Valentin Ilie
On 2 September 2013 18:23, Valentin Ilie valentin.i...@gmail.com wrote:
 Convert a compound if-else blob to a switch statement.

 Signed-off-by: Valentin Ilie valentin.i...@gmail.com
 ---
  arch/arm/mach-iop32x/iq31244.c | 29 +++--
  1 file changed, 11 insertions(+), 18 deletions(-)

 diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
 index f2cd296..3415f11 100644
 --- a/arch/arm/mach-iop32x/iq31244.c
 +++ b/arch/arm/mach-iop32x/iq31244.c
 @@ -101,28 +101,21 @@ void __init iq31244_map_io(void)
  static int __init
  ep80219_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
  {
 -   int irq;
 -
 -   if (slot == 0) {
 -   /* CFlash */
 -   irq = IRQ_IOP32X_XINT1;
 -   } else if (slot == 1) {
 -   /* 82551 Pro 100 */
 -   irq = IRQ_IOP32X_XINT0;
 -   } else if (slot == 2) {
 -   /* PCI-X Slot */
 -   irq = IRQ_IOP32X_XINT3;
 -   } else if (slot == 3) {
 -   /* SATA */
 -   irq = IRQ_IOP32X_XINT2;
 -   } else {
 +   switch (slot) {
 +   case 0: /* CFlash */
 +   return IRQ_IOP32X_XINT1;
 +   case 1: /* 82551 Pro 100 */
 +   return IRQ_IOP32X_XINT0;
 +   case 2: /* PCI-X Slot */
 +   return IRQ_IOP32X_XINT3;
 +   case 3: /* SATA */
 +   return IRQ_IOP32X_XINT2;
 +   default:
 printk(KERN_ERR ep80219_pci_map_irq() called for unknown 
 device PCI:%d:%d:%d\n, dev-bus-number,
 PCI_SLOT(dev-devfn), PCI_FUNC(dev-devfn));
 -   irq = -1;
 +   return -1;
 }
 -
 -   return irq;
  }

  static struct hw_pci ep80219_pci __initdata = {
 --
 1.8.1.2


Can someone look into this?

-- 
Valentin Ilie
--
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/


Re: [PATCH] usb: gadget: mv_u3d_core: fix memory leaks

2013-09-26 Thread Valentin Ilie
On 21 September 2013 12:30, Valentin Ilie  wrote:
> When trb_hw is NULL, trb should be free'd before return.
>
> Signed-off-by: Valentin Ilie 
> ---
>  drivers/usb/gadget/mv_u3d_core.c |2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/gadget/mv_u3d_core.c 
> b/drivers/usb/gadget/mv_u3d_core.c
> index 561b30e..4d31177 100644
> --- a/drivers/usb/gadget/mv_u3d_core.c
> +++ b/drivers/usb/gadget/mv_u3d_core.c
> @@ -310,6 +310,7 @@ static struct mv_u3d_trb *mv_u3d_build_trb_one(struct 
> mv_u3d_req *req,
>  */
> trb_hw = dma_pool_alloc(u3d->trb_pool, GFP_ATOMIC, dma);
> if (!trb_hw) {
> +   kfree(trb);
> dev_err(u3d->dev,
> "%s, dma_pool_alloc fail\n", __func__);
> return NULL;
> @@ -454,6 +455,7 @@ static int mv_u3d_req_to_trb(struct mv_u3d_req *req)
>
> trb_hw = kcalloc(trb_num, sizeof(*trb_hw), GFP_ATOMIC);
> if (!trb_hw) {
> +   kfree(trb);
> dev_err(u3d->dev,
> "%s, trb_hw alloc fail\n", __func__);
> return -ENOMEM;
> --
> 1.7.9.5
>

Can anyone look into this?

Thank you

-- 
Valentin Ilie
+(40) 746 188 558
--
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/


Re: [PATCH] usb: gadget: mv_u3d_core: fix memory leaks

2013-09-26 Thread Valentin Ilie
On 21 September 2013 12:30, Valentin Ilie valentin.i...@gmail.com wrote:
 When trb_hw is NULL, trb should be free'd before return.

 Signed-off-by: Valentin Ilie valentin.i...@gmail.com
 ---
  drivers/usb/gadget/mv_u3d_core.c |2 ++
  1 file changed, 2 insertions(+)

 diff --git a/drivers/usb/gadget/mv_u3d_core.c 
 b/drivers/usb/gadget/mv_u3d_core.c
 index 561b30e..4d31177 100644
 --- a/drivers/usb/gadget/mv_u3d_core.c
 +++ b/drivers/usb/gadget/mv_u3d_core.c
 @@ -310,6 +310,7 @@ static struct mv_u3d_trb *mv_u3d_build_trb_one(struct 
 mv_u3d_req *req,
  */
 trb_hw = dma_pool_alloc(u3d-trb_pool, GFP_ATOMIC, dma);
 if (!trb_hw) {
 +   kfree(trb);
 dev_err(u3d-dev,
 %s, dma_pool_alloc fail\n, __func__);
 return NULL;
 @@ -454,6 +455,7 @@ static int mv_u3d_req_to_trb(struct mv_u3d_req *req)

 trb_hw = kcalloc(trb_num, sizeof(*trb_hw), GFP_ATOMIC);
 if (!trb_hw) {
 +   kfree(trb);
 dev_err(u3d-dev,
 %s, trb_hw alloc fail\n, __func__);
 return -ENOMEM;
 --
 1.7.9.5


Can anyone look into this?

Thank you

-- 
Valentin Ilie
+(40) 746 188 558
--
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/


[PATCH] usb: gadget: mv_u3d_core: fix memory leaks

2013-09-21 Thread Valentin Ilie
When trb_hw is NULL, trb should be free'd before return.

Signed-off-by: Valentin Ilie 
---
 drivers/usb/gadget/mv_u3d_core.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c
index 561b30e..4d31177 100644
--- a/drivers/usb/gadget/mv_u3d_core.c
+++ b/drivers/usb/gadget/mv_u3d_core.c
@@ -310,6 +310,7 @@ static struct mv_u3d_trb *mv_u3d_build_trb_one(struct 
mv_u3d_req *req,
 */
trb_hw = dma_pool_alloc(u3d->trb_pool, GFP_ATOMIC, dma);
if (!trb_hw) {
+   kfree(trb);
dev_err(u3d->dev,
"%s, dma_pool_alloc fail\n", __func__);
return NULL;
@@ -454,6 +455,7 @@ static int mv_u3d_req_to_trb(struct mv_u3d_req *req)
 
trb_hw = kcalloc(trb_num, sizeof(*trb_hw), GFP_ATOMIC);
if (!trb_hw) {
+   kfree(trb);
dev_err(u3d->dev,
"%s, trb_hw alloc fail\n", __func__);
return -ENOMEM;
-- 
1.7.9.5

--
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/


[PATCH] usb: gadget: mv_u3d_core: fix memory leaks

2013-09-21 Thread Valentin Ilie
When trb_hw is NULL, trb should be free'd before return.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/usb/gadget/mv_u3d_core.c |2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/gadget/mv_u3d_core.c b/drivers/usb/gadget/mv_u3d_core.c
index 561b30e..4d31177 100644
--- a/drivers/usb/gadget/mv_u3d_core.c
+++ b/drivers/usb/gadget/mv_u3d_core.c
@@ -310,6 +310,7 @@ static struct mv_u3d_trb *mv_u3d_build_trb_one(struct 
mv_u3d_req *req,
 */
trb_hw = dma_pool_alloc(u3d-trb_pool, GFP_ATOMIC, dma);
if (!trb_hw) {
+   kfree(trb);
dev_err(u3d-dev,
%s, dma_pool_alloc fail\n, __func__);
return NULL;
@@ -454,6 +455,7 @@ static int mv_u3d_req_to_trb(struct mv_u3d_req *req)
 
trb_hw = kcalloc(trb_num, sizeof(*trb_hw), GFP_ATOMIC);
if (!trb_hw) {
+   kfree(trb);
dev_err(u3d-dev,
%s, trb_hw alloc fail\n, __func__);
return -ENOMEM;
-- 
1.7.9.5

--
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/


Null pointer deference in drivers/power/pm2301_charger.c

2013-09-20 Thread Valentin Ilie
Hello,

I am trying to solve a NULL pointer deference in
drivers/power/pm2301_charger.c (and to submit a trivial patch) but I
am not sure how to do it.

Line 958 - 961
pm2 = (struct pm2xxx_charger*)i2c_get_clientdata(pm2xxx_i2c_client);
if (!pm2) {
dev_err(pm2->dev, "no pm2xxx_charger data supplied\n");

Line 976 - 978
pm2 = (struct pm2xxx_charger*)i2c_get_clientdata(pm2xxx_i2c_client);
if (!pm2) {
dev_err(pm2->dev, "no pm2xxx_charger data supplied\n");

As it can be clearly seen, pm2 is used with NULL value in dev_err. The
question is, how to fix this? Should I delete the dev_err line or can
I use printk (to avoid the need of a dev) ?

Thank you,
Valentin
--
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/


Null pointer deference in drivers/power/pm2301_charger.c

2013-09-20 Thread Valentin Ilie
Hello,

I am trying to solve a NULL pointer deference in
drivers/power/pm2301_charger.c (and to submit a trivial patch) but I
am not sure how to do it.

Line 958 - 961
pm2 = (struct pm2xxx_charger*)i2c_get_clientdata(pm2xxx_i2c_client);
if (!pm2) {
dev_err(pm2-dev, no pm2xxx_charger data supplied\n);

Line 976 - 978
pm2 = (struct pm2xxx_charger*)i2c_get_clientdata(pm2xxx_i2c_client);
if (!pm2) {
dev_err(pm2-dev, no pm2xxx_charger data supplied\n);

As it can be clearly seen, pm2 is used with NULL value in dev_err. The
question is, how to fix this? Should I delete the dev_err line or can
I use printk (to avoid the need of a dev) ?

Thank you,
Valentin
--
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/


[PATCH] ASoC: blackfin: Add missing break statement to bf6xx

2013-09-13 Thread Valentin Ilie
SNDRV_PCM_FORMAT_S8 isn't supposed to fall through to SNDRV_PCM_FORMAT_S16_LE

Signed-off-by: Valentin Ilie 
---
 sound/soc/blackfin/bf6xx-i2s.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/blackfin/bf6xx-i2s.c b/sound/soc/blackfin/bf6xx-i2s.c
index c02405c..5810a06 100644
--- a/sound/soc/blackfin/bf6xx-i2s.c
+++ b/sound/soc/blackfin/bf6xx-i2s.c
@@ -88,6 +88,7 @@ static int bfin_i2s_hw_params(struct snd_pcm_substream 
*substream,
case SNDRV_PCM_FORMAT_S8:
param.spctl |= 0x70;
sport->wdsize = 1;
+   break;
case SNDRV_PCM_FORMAT_S16_LE:
param.spctl |= 0xf0;
sport->wdsize = 2;
-- 
1.7.9.5

--
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/


[PATCH] ASoC: blackfin: Add missing break statement to bf6xx

2013-09-13 Thread Valentin Ilie
SNDRV_PCM_FORMAT_S8 isn't supposed to fall through to SNDRV_PCM_FORMAT_S16_LE

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 sound/soc/blackfin/bf6xx-i2s.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/blackfin/bf6xx-i2s.c b/sound/soc/blackfin/bf6xx-i2s.c
index c02405c..5810a06 100644
--- a/sound/soc/blackfin/bf6xx-i2s.c
+++ b/sound/soc/blackfin/bf6xx-i2s.c
@@ -88,6 +88,7 @@ static int bfin_i2s_hw_params(struct snd_pcm_substream 
*substream,
case SNDRV_PCM_FORMAT_S8:
param.spctl |= 0x70;
sport-wdsize = 1;
+   break;
case SNDRV_PCM_FORMAT_S16_LE:
param.spctl |= 0xf0;
sport-wdsize = 2;
-- 
1.7.9.5

--
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/


[PATCH] ARM: mach-iop32x: iq31244: Replace if-then-else with a switch statement

2013-09-02 Thread Valentin Ilie
Convert a compound if-else blob to a switch statement.

Signed-off-by: Valentin Ilie 
---
 arch/arm/mach-iop32x/iq31244.c | 29 +++--
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index f2cd296..3415f11 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -101,28 +101,21 @@ void __init iq31244_map_io(void)
 static int __init
 ep80219_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
-   int irq;
-
-   if (slot == 0) {
-   /* CFlash */
-   irq = IRQ_IOP32X_XINT1;
-   } else if (slot == 1) {
-   /* 82551 Pro 100 */
-   irq = IRQ_IOP32X_XINT0;
-   } else if (slot == 2) {
-   /* PCI-X Slot */
-   irq = IRQ_IOP32X_XINT3;
-   } else if (slot == 3) {
-   /* SATA */
-   irq = IRQ_IOP32X_XINT2;
-   } else {
+   switch (slot) {
+   case 0: /* CFlash */
+   return IRQ_IOP32X_XINT1;
+   case 1: /* 82551 Pro 100 */
+   return IRQ_IOP32X_XINT0;
+   case 2: /* PCI-X Slot */
+   return IRQ_IOP32X_XINT3;
+   case 3: /* SATA */
+   return IRQ_IOP32X_XINT2;
+   default:
printk(KERN_ERR "ep80219_pci_map_irq() called for unknown "
"device PCI:%d:%d:%d\n", dev->bus->number,
PCI_SLOT(dev->devfn), PCI_FUNC(dev->devfn));
-   irq = -1;
+   return -1;
}
-
-   return irq;
 }
 
 static struct hw_pci ep80219_pci __initdata = {
-- 
1.8.1.2

--
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/


[PATCH] ARM: mach-iop32x: iq31244: Replace if-then-else with a switch statement

2013-09-02 Thread Valentin Ilie
Convert a compound if-else blob to a switch statement.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 arch/arm/mach-iop32x/iq31244.c | 29 +++--
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/arch/arm/mach-iop32x/iq31244.c b/arch/arm/mach-iop32x/iq31244.c
index f2cd296..3415f11 100644
--- a/arch/arm/mach-iop32x/iq31244.c
+++ b/arch/arm/mach-iop32x/iq31244.c
@@ -101,28 +101,21 @@ void __init iq31244_map_io(void)
 static int __init
 ep80219_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 {
-   int irq;
-
-   if (slot == 0) {
-   /* CFlash */
-   irq = IRQ_IOP32X_XINT1;
-   } else if (slot == 1) {
-   /* 82551 Pro 100 */
-   irq = IRQ_IOP32X_XINT0;
-   } else if (slot == 2) {
-   /* PCI-X Slot */
-   irq = IRQ_IOP32X_XINT3;
-   } else if (slot == 3) {
-   /* SATA */
-   irq = IRQ_IOP32X_XINT2;
-   } else {
+   switch (slot) {
+   case 0: /* CFlash */
+   return IRQ_IOP32X_XINT1;
+   case 1: /* 82551 Pro 100 */
+   return IRQ_IOP32X_XINT0;
+   case 2: /* PCI-X Slot */
+   return IRQ_IOP32X_XINT3;
+   case 3: /* SATA */
+   return IRQ_IOP32X_XINT2;
+   default:
printk(KERN_ERR ep80219_pci_map_irq() called for unknown 
device PCI:%d:%d:%d\n, dev-bus-number,
PCI_SLOT(dev-devfn), PCI_FUNC(dev-devfn));
-   irq = -1;
+   return -1;
}
-
-   return irq;
 }
 
 static struct hw_pci ep80219_pci __initdata = {
-- 
1.8.1.2

--
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/


[PATCH] NFC: mei_phy: Clean up file

2013-06-07 Thread Valentin Ilie
Fix checkpatch warnings.
Replace __attribute__((__packed__)) with __packed.
Replace spaces with tabs.

Signed-off-by: Valentin Ilie 
---
 drivers/nfc/mei_phy.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c
index 1201bdb..606bf55 100644
--- a/drivers/nfc/mei_phy.c
+++ b/drivers/nfc/mei_phy.c
@@ -30,7 +30,7 @@ struct mei_nfc_hdr {
u16 req_id;
u32 reserved;
u16 data_size;
-} __attribute__((packed));
+} __packed;
 
 #define MEI_NFC_MAX_READ (MEI_NFC_HEADER_SIZE + MEI_NFC_MAX_HCI_PAYLOAD)
 
@@ -60,8 +60,8 @@ int nfc_mei_phy_enable(void *phy_id)
 
r = mei_cl_enable_device(phy->device);
if (r < 0) {
-pr_err("MEI_PHY: Could not enable device\n");
-return r;
+   pr_err("MEI_PHY: Could not enable device\n");
+   return r;
}
 
r = mei_cl_register_event_cb(phy->device, nfc_mei_event_cb, phy);
-- 
1.7.9.5

--
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/


[PATCH] NFC: mei_phy: Clean up file

2013-06-07 Thread Valentin Ilie
Fix checkpatch warnings.
Replace __attribute__((__packed__)) with __packed.
Replace spaces with tabs.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/nfc/mei_phy.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c
index 1201bdb..606bf55 100644
--- a/drivers/nfc/mei_phy.c
+++ b/drivers/nfc/mei_phy.c
@@ -30,7 +30,7 @@ struct mei_nfc_hdr {
u16 req_id;
u32 reserved;
u16 data_size;
-} __attribute__((packed));
+} __packed;
 
 #define MEI_NFC_MAX_READ (MEI_NFC_HEADER_SIZE + MEI_NFC_MAX_HCI_PAYLOAD)
 
@@ -60,8 +60,8 @@ int nfc_mei_phy_enable(void *phy_id)
 
r = mei_cl_enable_device(phy-device);
if (r  0) {
-pr_err(MEI_PHY: Could not enable device\n);
-return r;
+   pr_err(MEI_PHY: Could not enable device\n);
+   return r;
}
 
r = mei_cl_register_event_cb(phy-device, nfc_mei_event_cb, phy);
-- 
1.7.9.5

--
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/


[PATCH] crypto: proc - Clean up

2013-04-09 Thread Valentin Ilie
Remove trailing whitespaces
Replace seq_puts with seq_printf when there are no extra parameters.
Fix indentation problems

Signed-off-by: Valentin Ilie 
---
 crypto/proc.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/crypto/proc.c b/crypto/proc.c
index 4a0a7aa..8a22f17 100644
--- a/crypto/proc.c
+++ b/crypto/proc.c
@@ -8,7 +8,7 @@
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option) 
+ * Software Foundation; either version 2 of the License, or (at your option)
  * any later version.
  *
  */
@@ -80,7 +80,7 @@ static void c_stop(struct seq_file *m, void *p)
 static int c_show(struct seq_file *m, void *p)
 {
struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list);
-   
+
seq_printf(m, "name : %s\n", alg->cra_name);
seq_printf(m, "driver   : %s\n", alg->cra_driver_name);
seq_printf(m, "module   : %s\n", module_name(alg->cra_module));
@@ -91,7 +91,7 @@ static int c_show(struct seq_file *m, void *p)
   "passed" : "unknown");
 
if (alg->cra_flags & CRYPTO_ALG_LARVAL) {
-   seq_printf(m, "type : larval\n");
+   seq_puts(m, "type : larval\n");
seq_printf(m, "flags: 0x%x\n", alg->cra_flags);
goto out;
}
@@ -100,10 +100,10 @@ static int c_show(struct seq_file *m, void *p)
alg->cra_type->show(m, alg);
goto out;
}
-   
+
switch (alg->cra_flags & (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) {
case CRYPTO_ALG_TYPE_CIPHER:
-   seq_printf(m, "type : cipher\n");
+   seq_puts(m, "type : cipher\n");
seq_printf(m, "blocksize: %u\n", alg->cra_blocksize);
seq_printf(m, "min keysize  : %u\n",
alg->cra_cipher.cia_min_keysize);
@@ -111,10 +111,10 @@ static int c_show(struct seq_file *m, void *p)
alg->cra_cipher.cia_max_keysize);
break;
case CRYPTO_ALG_TYPE_COMPRESS:
-   seq_printf(m, "type : compression\n");
+   seq_puts(m, "type : compression\n");
break;
default:
-   seq_printf(m, "type : unknown\n");
+   seq_puts(m, "type : unknown\n");
break;
}
 
@@ -134,7 +134,7 @@ static int crypto_info_open(struct inode *inode, struct 
file *file)
 {
return seq_open(file, _seq_ops);
 }
-
+
 static const struct file_operations proc_crypto_ops = {
.open   = crypto_info_open,
.read   = seq_read,
-- 
1.7.10.4

--
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/


[PATCH] crypto: proc - Clean up

2013-04-09 Thread Valentin Ilie
Remove trailing whitespaces
Replace seq_puts with seq_printf when there are no extra parameters.
Fix indentation problems

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 crypto/proc.c |   16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/crypto/proc.c b/crypto/proc.c
index 4a0a7aa..8a22f17 100644
--- a/crypto/proc.c
+++ b/crypto/proc.c
@@ -8,7 +8,7 @@
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option) 
+ * Software Foundation; either version 2 of the License, or (at your option)
  * any later version.
  *
  */
@@ -80,7 +80,7 @@ static void c_stop(struct seq_file *m, void *p)
 static int c_show(struct seq_file *m, void *p)
 {
struct crypto_alg *alg = list_entry(p, struct crypto_alg, cra_list);
-   
+
seq_printf(m, name : %s\n, alg-cra_name);
seq_printf(m, driver   : %s\n, alg-cra_driver_name);
seq_printf(m, module   : %s\n, module_name(alg-cra_module));
@@ -91,7 +91,7 @@ static int c_show(struct seq_file *m, void *p)
   passed : unknown);
 
if (alg-cra_flags  CRYPTO_ALG_LARVAL) {
-   seq_printf(m, type : larval\n);
+   seq_puts(m, type : larval\n);
seq_printf(m, flags: 0x%x\n, alg-cra_flags);
goto out;
}
@@ -100,10 +100,10 @@ static int c_show(struct seq_file *m, void *p)
alg-cra_type-show(m, alg);
goto out;
}
-   
+
switch (alg-cra_flags  (CRYPTO_ALG_TYPE_MASK | CRYPTO_ALG_LARVAL)) {
case CRYPTO_ALG_TYPE_CIPHER:
-   seq_printf(m, type : cipher\n);
+   seq_puts(m, type : cipher\n);
seq_printf(m, blocksize: %u\n, alg-cra_blocksize);
seq_printf(m, min keysize  : %u\n,
alg-cra_cipher.cia_min_keysize);
@@ -111,10 +111,10 @@ static int c_show(struct seq_file *m, void *p)
alg-cra_cipher.cia_max_keysize);
break;
case CRYPTO_ALG_TYPE_COMPRESS:
-   seq_printf(m, type : compression\n);
+   seq_puts(m, type : compression\n);
break;
default:
-   seq_printf(m, type : unknown\n);
+   seq_puts(m, type : unknown\n);
break;
}
 
@@ -134,7 +134,7 @@ static int crypto_info_open(struct inode *inode, struct 
file *file)
 {
return seq_open(file, crypto_seq_ops);
 }
-
+
 static const struct file_operations proc_crypto_ops = {
.open   = crypto_info_open,
.read   = seq_read,
-- 
1.7.10.4

--
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/


[PATCH] staging/fwserial: Replace seq_printf with seq_puts

2013-04-08 Thread Valentin Ilie
Fix checkpatch warning about seq_printf.

Signed-off-by: Valentin Ilie 
---
 drivers/staging/fwserial/fwserial.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fwserial/fwserial.c 
b/drivers/staging/fwserial/fwserial.c
index 5c64e3a..e5818a1 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1521,7 +1521,7 @@ static void fwtty_debugfs_show_port(struct seq_file *m, 
struct fwtty_port *port)
   stats.watermark);
 
if (port->port.console) {
-   seq_printf(m, "\n");
+   seq_puts(m, "\n");
(*port->fwcon_ops->proc_show)(m, port->con_data);
}
 
@@ -1553,7 +1553,7 @@ static int fwtty_proc_show(struct seq_file *m, void *v)
if (capable(CAP_SYS_ADMIN))
fwtty_proc_show_port(m, port);
fwtty_port_put(port);
-   seq_printf(m, "\n");
+   seq_puts(m, "\n");
}
return 0;
 }
@@ -1571,7 +1571,7 @@ static int fwtty_debugfs_stats_show(struct seq_file *m, 
void *v)
fwtty_proc_show_port(m, port);
fwtty_debugfs_show_port(m, port);
fwtty_port_put(port);
-   seq_printf(m, "\n");
+   seq_puts(m, "\n");
}
}
return 0;
-- 
1.7.10.4

--
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/


[PATCH] staging/fwserial: Replace seq_printf with seq_puts

2013-04-08 Thread Valentin Ilie
Fix checkpatch warning about seq_printf.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/staging/fwserial/fwserial.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/fwserial/fwserial.c 
b/drivers/staging/fwserial/fwserial.c
index 5c64e3a..e5818a1 100644
--- a/drivers/staging/fwserial/fwserial.c
+++ b/drivers/staging/fwserial/fwserial.c
@@ -1521,7 +1521,7 @@ static void fwtty_debugfs_show_port(struct seq_file *m, 
struct fwtty_port *port)
   stats.watermark);
 
if (port-port.console) {
-   seq_printf(m, \n);
+   seq_puts(m, \n);
(*port-fwcon_ops-proc_show)(m, port-con_data);
}
 
@@ -1553,7 +1553,7 @@ static int fwtty_proc_show(struct seq_file *m, void *v)
if (capable(CAP_SYS_ADMIN))
fwtty_proc_show_port(m, port);
fwtty_port_put(port);
-   seq_printf(m, \n);
+   seq_puts(m, \n);
}
return 0;
 }
@@ -1571,7 +1571,7 @@ static int fwtty_debugfs_stats_show(struct seq_file *m, 
void *v)
fwtty_proc_show_port(m, port);
fwtty_debugfs_show_port(m, port);
fwtty_port_put(port);
-   seq_printf(m, \n);
+   seq_puts(m, \n);
}
}
return 0;
-- 
1.7.10.4

--
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/


[PATCH] staging: speakup: selection.c fix typo in comment

2013-04-05 Thread Valentin Ilie
Replace disallocated with deallocated

Signed-off-by: Valentin Ilie 
---
 drivers/staging/speakup/selection.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/selection.c 
b/drivers/staging/speakup/selection.c
index 775af26..f0fb003 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -14,7 +14,7 @@
 unsigned short spk_xs, spk_ys, spk_xe, spk_ye; /* our region points */
 
 /* Variables for selection control. */
-/* must not be disallocated */
+/* must not be deallocated */
 struct vc_data *spk_sel_cons;
 /* cleared by clear_selection */
 static int sel_start = -1;
-- 
1.7.10.4

--
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/


[PATCH] staging: speakup: selection.c fix typo in comment

2013-04-05 Thread Valentin Ilie
Replace disallocated with deallocated

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/staging/speakup/selection.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/selection.c 
b/drivers/staging/speakup/selection.c
index 775af26..f0fb003 100644
--- a/drivers/staging/speakup/selection.c
+++ b/drivers/staging/speakup/selection.c
@@ -14,7 +14,7 @@
 unsigned short spk_xs, spk_ys, spk_xe, spk_ye; /* our region points */
 
 /* Variables for selection control. */
-/* must not be disallocated */
+/* must not be deallocated */
 struct vc_data *spk_sel_cons;
 /* cleared by clear_selection */
 static int sel_start = -1;
-- 
1.7.10.4

--
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/


[PATCH] Arch: x86: kernel: smpboot.c: Remove unused variable

2013-03-11 Thread Valentin Ilie
Remove unused variable 'c'

Signed-off-by: Valentin Ilie 
---
 arch/x86/kernel/smpboot.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a6ceaed..7bc998a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1367,7 +1367,6 @@ static inline void mwait_play_dead(void)
unsigned int highest_subcstate = 0;
int i;
void *mwait_ptr;
-   struct cpuinfo_x86 *c = __this_cpu_ptr(_info);
 
if (!this_cpu_has(X86_FEATURE_MWAIT))
return;
-- 
1.7.10.4

--
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/


[PATCH] Arch: x86: kernel: smpboot.c: Remove unused variable

2013-03-11 Thread Valentin Ilie
Remove unused variable 'c'

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 arch/x86/kernel/smpboot.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c
index a6ceaed..7bc998a 100644
--- a/arch/x86/kernel/smpboot.c
+++ b/arch/x86/kernel/smpboot.c
@@ -1367,7 +1367,6 @@ static inline void mwait_play_dead(void)
unsigned int highest_subcstate = 0;
int i;
void *mwait_ptr;
-   struct cpuinfo_x86 *c = __this_cpu_ptr(cpu_info);
 
if (!this_cpu_has(X86_FEATURE_MWAIT))
return;
-- 
1.7.10.4

--
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/


[PATCHv2] net: can: af_can.c: Fix checkpatch warnings

2013-03-10 Thread Valentin Ilie
Replace printk(KERN_ERR with pr_err
Add space before {
Removed OOM messages

Signed-off-by: Valentin Ilie 
---
 net/can/af_can.c | 21 -
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/net/can/af_can.c b/net/can/af_can.c
index c48e522..8bacf28 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -525,7 +525,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 
d = find_dev_rcv_lists(dev);
if (!d) {
-   printk(KERN_ERR "BUG: receive list not found for "
+   pr_err("BUG: receive list not found for "
   "dev %s, id %03X, mask %03X\n",
   DNAME(dev), can_id, mask);
goto out;
@@ -552,7 +552,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 */
 
if (!r) {
-   printk(KERN_ERR "BUG: receive list entry not found for "
+   pr_err("BUG: receive list entry not found for "
   "dev %s, id %03X, mask %03X\n",
   DNAME(dev), can_id, mask);
r = NULL;
@@ -749,8 +749,7 @@ int can_proto_register(const struct can_proto *cp)
int err = 0;
 
if (proto < 0 || proto >= CAN_NPROTO) {
-   printk(KERN_ERR "can: protocol number %d out of range\n",
-  proto);
+   pr_err("can: protocol number %d out of range\n", proto);
return -EINVAL;
}
 
@@ -761,8 +760,7 @@ int can_proto_register(const struct can_proto *cp)
mutex_lock(_tab_lock);
 
if (proto_tab[proto]) {
-   printk(KERN_ERR "can: protocol %d already registered\n",
-  proto);
+   pr_err("can: protocol %d already registered\n", proto);
err = -EBUSY;
} else
RCU_INIT_POINTER(proto_tab[proto], cp);
@@ -816,11 +814,8 @@ static int can_notifier(struct notifier_block *nb, 
unsigned long msg,
 
/* create new dev_rcv_lists for this device */
d = kzalloc(sizeof(*d), GFP_KERNEL);
-   if (!d) {
-   printk(KERN_ERR
-  "can: allocation of receive list failed\n");
+   if (!d)
return NOTIFY_DONE;
-   }
BUG_ON(dev->ml_priv);
dev->ml_priv = d;
 
@@ -838,8 +833,8 @@ static int can_notifier(struct notifier_block *nb, unsigned 
long msg,
dev->ml_priv = NULL;
}
} else
-   printk(KERN_ERR "can: notifier: receive list not "
-  "found for dev %s\n", dev->name);
+   pr_err("can: notifier: receive list not found for dev "
+  "%s\n", dev->name);
 
spin_unlock(_rcvlists_lock);
 
@@ -927,7 +922,7 @@ static __exit void can_exit(void)
/* remove created dev_rcv_lists from still registered CAN devices */
rcu_read_lock();
for_each_netdev_rcu(_net, dev) {
-   if (dev->type == ARPHRD_CAN && dev->ml_priv){
+   if (dev->type == ARPHRD_CAN && dev->ml_priv) {
 
struct dev_rcv_lists *d = dev->ml_priv;
 
-- 
1.8.1.2

--
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/


[PATCH] net: can: af_can.c: Fix checkpatch warnings

2013-03-10 Thread Valentin Ilie
Replace printk(KERN_ERR with pr_err
Add space before {

Signed-off-by: Valentin Ilie 
---
 net/can/af_can.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/can/af_can.c b/net/can/af_can.c
index c48e522..a14c0aa 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -525,7 +525,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 
d = find_dev_rcv_lists(dev);
if (!d) {
-   printk(KERN_ERR "BUG: receive list not found for "
+   pr_err("BUG: receive list not found for "
   "dev %s, id %03X, mask %03X\n",
   DNAME(dev), can_id, mask);
goto out;
@@ -552,7 +552,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 */
 
if (!r) {
-   printk(KERN_ERR "BUG: receive list entry not found for "
+   pr_err("BUG: receive list entry not found for "
   "dev %s, id %03X, mask %03X\n",
   DNAME(dev), can_id, mask);
r = NULL;
@@ -749,7 +749,7 @@ int can_proto_register(const struct can_proto *cp)
int err = 0;
 
if (proto < 0 || proto >= CAN_NPROTO) {
-   printk(KERN_ERR "can: protocol number %d out of range\n",
+   pr_err("can: protocol number %d out of range\n",
   proto);
return -EINVAL;
}
@@ -761,7 +761,7 @@ int can_proto_register(const struct can_proto *cp)
mutex_lock(_tab_lock);
 
if (proto_tab[proto]) {
-   printk(KERN_ERR "can: protocol %d already registered\n",
+   pr_err("can: protocol %d already registered\n",
   proto);
err = -EBUSY;
} else
@@ -817,8 +817,7 @@ static int can_notifier(struct notifier_block *nb, unsigned 
long msg,
/* create new dev_rcv_lists for this device */
d = kzalloc(sizeof(*d), GFP_KERNEL);
if (!d) {
-   printk(KERN_ERR
-  "can: allocation of receive list failed\n");
+   pr_err("can: allocation of receive list failed\n");
return NOTIFY_DONE;
}
BUG_ON(dev->ml_priv);
@@ -838,7 +837,7 @@ static int can_notifier(struct notifier_block *nb, unsigned 
long msg,
dev->ml_priv = NULL;
}
} else
-   printk(KERN_ERR "can: notifier: receive list not "
+   pr_err("can: notifier: receive list not "
   "found for dev %s\n", dev->name);
 
spin_unlock(_rcvlists_lock);
@@ -927,7 +926,7 @@ static __exit void can_exit(void)
/* remove created dev_rcv_lists from still registered CAN devices */
rcu_read_lock();
for_each_netdev_rcu(_net, dev) {
-   if (dev->type == ARPHRD_CAN && dev->ml_priv){
+   if (dev->type == ARPHRD_CAN && dev->ml_priv) {
 
struct dev_rcv_lists *d = dev->ml_priv;
 
-- 
1.8.1.2

--
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/


[PATCH] net: can: af_can.c: Fix checkpatch warnings

2013-03-10 Thread Valentin Ilie
Replace printk(KERN_ERR with pr_err
Add space before {

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 net/can/af_can.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/net/can/af_can.c b/net/can/af_can.c
index c48e522..a14c0aa 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -525,7 +525,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 
d = find_dev_rcv_lists(dev);
if (!d) {
-   printk(KERN_ERR BUG: receive list not found for 
+   pr_err(BUG: receive list not found for 
   dev %s, id %03X, mask %03X\n,
   DNAME(dev), can_id, mask);
goto out;
@@ -552,7 +552,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 */
 
if (!r) {
-   printk(KERN_ERR BUG: receive list entry not found for 
+   pr_err(BUG: receive list entry not found for 
   dev %s, id %03X, mask %03X\n,
   DNAME(dev), can_id, mask);
r = NULL;
@@ -749,7 +749,7 @@ int can_proto_register(const struct can_proto *cp)
int err = 0;
 
if (proto  0 || proto = CAN_NPROTO) {
-   printk(KERN_ERR can: protocol number %d out of range\n,
+   pr_err(can: protocol number %d out of range\n,
   proto);
return -EINVAL;
}
@@ -761,7 +761,7 @@ int can_proto_register(const struct can_proto *cp)
mutex_lock(proto_tab_lock);
 
if (proto_tab[proto]) {
-   printk(KERN_ERR can: protocol %d already registered\n,
+   pr_err(can: protocol %d already registered\n,
   proto);
err = -EBUSY;
} else
@@ -817,8 +817,7 @@ static int can_notifier(struct notifier_block *nb, unsigned 
long msg,
/* create new dev_rcv_lists for this device */
d = kzalloc(sizeof(*d), GFP_KERNEL);
if (!d) {
-   printk(KERN_ERR
-  can: allocation of receive list failed\n);
+   pr_err(can: allocation of receive list failed\n);
return NOTIFY_DONE;
}
BUG_ON(dev-ml_priv);
@@ -838,7 +837,7 @@ static int can_notifier(struct notifier_block *nb, unsigned 
long msg,
dev-ml_priv = NULL;
}
} else
-   printk(KERN_ERR can: notifier: receive list not 
+   pr_err(can: notifier: receive list not 
   found for dev %s\n, dev-name);
 
spin_unlock(can_rcvlists_lock);
@@ -927,7 +926,7 @@ static __exit void can_exit(void)
/* remove created dev_rcv_lists from still registered CAN devices */
rcu_read_lock();
for_each_netdev_rcu(init_net, dev) {
-   if (dev-type == ARPHRD_CAN  dev-ml_priv){
+   if (dev-type == ARPHRD_CAN  dev-ml_priv) {
 
struct dev_rcv_lists *d = dev-ml_priv;
 
-- 
1.8.1.2

--
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/


[PATCHv2] net: can: af_can.c: Fix checkpatch warnings

2013-03-10 Thread Valentin Ilie
Replace printk(KERN_ERR with pr_err
Add space before {
Removed OOM messages

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 net/can/af_can.c | 21 -
 1 file changed, 8 insertions(+), 13 deletions(-)

diff --git a/net/can/af_can.c b/net/can/af_can.c
index c48e522..8bacf28 100644
--- a/net/can/af_can.c
+++ b/net/can/af_can.c
@@ -525,7 +525,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 
d = find_dev_rcv_lists(dev);
if (!d) {
-   printk(KERN_ERR BUG: receive list not found for 
+   pr_err(BUG: receive list not found for 
   dev %s, id %03X, mask %03X\n,
   DNAME(dev), can_id, mask);
goto out;
@@ -552,7 +552,7 @@ void can_rx_unregister(struct net_device *dev, canid_t 
can_id, canid_t mask,
 */
 
if (!r) {
-   printk(KERN_ERR BUG: receive list entry not found for 
+   pr_err(BUG: receive list entry not found for 
   dev %s, id %03X, mask %03X\n,
   DNAME(dev), can_id, mask);
r = NULL;
@@ -749,8 +749,7 @@ int can_proto_register(const struct can_proto *cp)
int err = 0;
 
if (proto  0 || proto = CAN_NPROTO) {
-   printk(KERN_ERR can: protocol number %d out of range\n,
-  proto);
+   pr_err(can: protocol number %d out of range\n, proto);
return -EINVAL;
}
 
@@ -761,8 +760,7 @@ int can_proto_register(const struct can_proto *cp)
mutex_lock(proto_tab_lock);
 
if (proto_tab[proto]) {
-   printk(KERN_ERR can: protocol %d already registered\n,
-  proto);
+   pr_err(can: protocol %d already registered\n, proto);
err = -EBUSY;
} else
RCU_INIT_POINTER(proto_tab[proto], cp);
@@ -816,11 +814,8 @@ static int can_notifier(struct notifier_block *nb, 
unsigned long msg,
 
/* create new dev_rcv_lists for this device */
d = kzalloc(sizeof(*d), GFP_KERNEL);
-   if (!d) {
-   printk(KERN_ERR
-  can: allocation of receive list failed\n);
+   if (!d)
return NOTIFY_DONE;
-   }
BUG_ON(dev-ml_priv);
dev-ml_priv = d;
 
@@ -838,8 +833,8 @@ static int can_notifier(struct notifier_block *nb, unsigned 
long msg,
dev-ml_priv = NULL;
}
} else
-   printk(KERN_ERR can: notifier: receive list not 
-  found for dev %s\n, dev-name);
+   pr_err(can: notifier: receive list not found for dev 
+  %s\n, dev-name);
 
spin_unlock(can_rcvlists_lock);
 
@@ -927,7 +922,7 @@ static __exit void can_exit(void)
/* remove created dev_rcv_lists from still registered CAN devices */
rcu_read_lock();
for_each_netdev_rcu(init_net, dev) {
-   if (dev-type == ARPHRD_CAN  dev-ml_priv){
+   if (dev-type == ARPHRD_CAN  dev-ml_priv) {
 
struct dev_rcv_lists *d = dev-ml_priv;
 
-- 
1.8.1.2

--
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/


[PATCH] amba: bus: Fix checkpatch warnings

2013-03-08 Thread Valentin Ilie
Fixed the following checkpatch warnings:
- ERROR: space required after that ','.
- WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable

Signed-off-by: Valentin Ilie 
---
 drivers/amba/bus.c |   21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index cdbad3a..d214ba7 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -58,7 +58,7 @@ static int amba_uevent(struct device *dev, struct 
kobj_uevent_env *env)
return retval;
 }
 
-#define amba_attr_func(name,fmt,arg...)
\
+#define amba_attr_func(name, fmt, arg...)  \
 static ssize_t name##_show(struct device *_dev,
\
   struct device_attribute *attr, char *buf)\
 {  \
@@ -66,8 +66,8 @@ static ssize_t name##_show(struct device *_dev,   
\
return sprintf(buf, fmt, arg);  \
 }
 
-#define amba_attr(name,fmt,arg...) \
-amba_attr_func(name,fmt,arg)   \
+#define amba_attr(name, fmt, arg...)   \
+amba_attr_func(name, fmt, arg) \
 static DEVICE_ATTR(name, S_IRUGO, name##_show, NULL)
 
 amba_attr_func(id, "%08x\n", dev->periphid);
@@ -428,6 +428,7 @@ int amba_driver_register(struct amba_driver *drv)
 
return driver_register(>drv);
 }
+EXPORT_SYMBOL(amba_driver_register);
 
 /**
  * amba_driver_unregister - remove an AMBA device driver
@@ -441,7 +442,7 @@ void amba_driver_unregister(struct amba_driver *drv)
 {
driver_unregister(>drv);
 }
-
+EXPORT_SYMBOL(amba_driver_unregister);
 
 static void amba_device_release(struct device *dev)
 {
@@ -668,6 +669,7 @@ int amba_device_register(struct amba_device *dev, struct 
resource *parent)
 
return amba_device_add(dev, parent);
 }
+EXPORT_SYMBOL(amba_device_register);
 
 /**
  * amba_device_put - put an AMBA device
@@ -694,7 +696,7 @@ void amba_device_unregister(struct amba_device *dev)
 {
device_unregister(>dev);
 }
-
+EXPORT_SYMBOL(amba_device_unregister);
 
 struct find_data {
struct amba_device *dev;
@@ -754,6 +756,7 @@ amba_find_device(const char *busid, struct device *parent, 
unsigned int id,
 
return data.dev;
 }
+EXPORT_SYMBOL(amba_find_device);
 
 /**
  * amba_request_regions - request all mem regions associated with device
@@ -775,6 +778,7 @@ int amba_request_regions(struct amba_device *dev, const 
char *name)
 
return ret;
 }
+EXPORT_SYMBOL(amba_request_regions);
 
 /**
  * amba_release_regions - release mem regions associated with device
@@ -789,11 +793,4 @@ void amba_release_regions(struct amba_device *dev)
size = resource_size(>res);
release_mem_region(dev->res.start, size);
 }
-
-EXPORT_SYMBOL(amba_driver_register);
-EXPORT_SYMBOL(amba_driver_unregister);
-EXPORT_SYMBOL(amba_device_register);
-EXPORT_SYMBOL(amba_device_unregister);
-EXPORT_SYMBOL(amba_find_device);
-EXPORT_SYMBOL(amba_request_regions);
 EXPORT_SYMBOL(amba_release_regions);
-- 
1.7.10.4

--
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/


[PATCH] amba: bus: Fix checkpatch warnings

2013-03-08 Thread Valentin Ilie
Fixed the following checkpatch warnings:
- ERROR: space required after that ','.
- WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 drivers/amba/bus.c |   21 +
 1 file changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
index cdbad3a..d214ba7 100644
--- a/drivers/amba/bus.c
+++ b/drivers/amba/bus.c
@@ -58,7 +58,7 @@ static int amba_uevent(struct device *dev, struct 
kobj_uevent_env *env)
return retval;
 }
 
-#define amba_attr_func(name,fmt,arg...)
\
+#define amba_attr_func(name, fmt, arg...)  \
 static ssize_t name##_show(struct device *_dev,
\
   struct device_attribute *attr, char *buf)\
 {  \
@@ -66,8 +66,8 @@ static ssize_t name##_show(struct device *_dev,   
\
return sprintf(buf, fmt, arg);  \
 }
 
-#define amba_attr(name,fmt,arg...) \
-amba_attr_func(name,fmt,arg)   \
+#define amba_attr(name, fmt, arg...)   \
+amba_attr_func(name, fmt, arg) \
 static DEVICE_ATTR(name, S_IRUGO, name##_show, NULL)
 
 amba_attr_func(id, %08x\n, dev-periphid);
@@ -428,6 +428,7 @@ int amba_driver_register(struct amba_driver *drv)
 
return driver_register(drv-drv);
 }
+EXPORT_SYMBOL(amba_driver_register);
 
 /**
  * amba_driver_unregister - remove an AMBA device driver
@@ -441,7 +442,7 @@ void amba_driver_unregister(struct amba_driver *drv)
 {
driver_unregister(drv-drv);
 }
-
+EXPORT_SYMBOL(amba_driver_unregister);
 
 static void amba_device_release(struct device *dev)
 {
@@ -668,6 +669,7 @@ int amba_device_register(struct amba_device *dev, struct 
resource *parent)
 
return amba_device_add(dev, parent);
 }
+EXPORT_SYMBOL(amba_device_register);
 
 /**
  * amba_device_put - put an AMBA device
@@ -694,7 +696,7 @@ void amba_device_unregister(struct amba_device *dev)
 {
device_unregister(dev-dev);
 }
-
+EXPORT_SYMBOL(amba_device_unregister);
 
 struct find_data {
struct amba_device *dev;
@@ -754,6 +756,7 @@ amba_find_device(const char *busid, struct device *parent, 
unsigned int id,
 
return data.dev;
 }
+EXPORT_SYMBOL(amba_find_device);
 
 /**
  * amba_request_regions - request all mem regions associated with device
@@ -775,6 +778,7 @@ int amba_request_regions(struct amba_device *dev, const 
char *name)
 
return ret;
 }
+EXPORT_SYMBOL(amba_request_regions);
 
 /**
  * amba_release_regions - release mem regions associated with device
@@ -789,11 +793,4 @@ void amba_release_regions(struct amba_device *dev)
size = resource_size(dev-res);
release_mem_region(dev-res.start, size);
 }
-
-EXPORT_SYMBOL(amba_driver_register);
-EXPORT_SYMBOL(amba_driver_unregister);
-EXPORT_SYMBOL(amba_device_register);
-EXPORT_SYMBOL(amba_device_unregister);
-EXPORT_SYMBOL(amba_find_device);
-EXPORT_SYMBOL(amba_request_regions);
 EXPORT_SYMBOL(amba_release_regions);
-- 
1.7.10.4

--
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/


[PATCH] kernel: panic.c

2012-11-04 Thread Valentin Ilie
Fixed checkpatch warnings.
Replaced printk(KERN_WARNING with pr_warn

Signed-off-by: Valentin Ilie 

---
 kernel/panic.c |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index e1b2822..8f1709f 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -100,7 +100,7 @@ void panic(const char *fmt, ...)
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
-   printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
+   pr_emerg("Kernel panic - not syncing: %s\n", buf);
 #ifdef CONFIG_DEBUG_BUGVERBOSE
/*
 * Avoid nested stack-dumping if a panic occurs during oops processing
@@ -137,7 +137,7 @@ void panic(const char *fmt, ...)
 * Delay timeout seconds before rebooting the machine.
 * We can't use the "normal" timers since we just panicked.
 */
-   printk(KERN_EMERG "Rebooting in %d seconds..", panic_timeout);
+   pr_emerg("Rebooting in %d seconds..", panic_timeout);
 
for (i = 0; i < panic_timeout * 1000; i += PANIC_TIMER_STEP) {
touch_nmi_watchdog();
@@ -161,7 +161,7 @@ void panic(const char *fmt, ...)
extern int stop_a_enabled;
/* Make sure the user can actually press Stop-A (L1-A) */
stop_a_enabled = 1;
-   printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot 
prom\n");
+   pr_emerg("Press Stop-A (L1-A) to return to the boot prom\n");
}
 #endif
 #if defined(CONFIG_S390)
@@ -182,7 +182,6 @@ void panic(const char *fmt, ...)
mdelay(PANIC_TIMER_STEP);
}
 }
-
 EXPORT_SYMBOL(panic);
 
 
@@ -277,7 +276,7 @@ void add_taint(unsigned flag)
 
default:
if (__debug_locks_off())
-   printk(KERN_WARNING "Disabling lock debugging due to 
kernel taint\n");
+   pr_warn("Disabling lock debugging due to kernel 
taint\n");
}
 
set_bit(flag, _mask);
@@ -383,7 +382,7 @@ late_initcall(init_oops_id);
 void print_oops_end_marker(void)
 {
init_oops_id();
-   printk(KERN_WARNING "---[ end trace %016llx ]---\n",
+   pr_warn("---[ end trace %016llx ]---\n",
(unsigned long long)oops_id);
 }
 
@@ -409,11 +408,11 @@ static void warn_slowpath_common(const char *file, int 
line, void *caller,
 {
const char *board;
 
-   printk(KERN_WARNING "[ cut here ]\n");
-   printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
+   pr_warn("[ cut here ]\n");
+   pr_warn("WARNING: at %s:%d %pS()\n", file, line, caller);
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
-   printk(KERN_WARNING "Hardware name: %s\n", board);
+   pr_warn("Hardware name: %s\n", board);
 
if (args)
vprintk(args->fmt, args->args);
-- 
1.7.10.4

--
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/


[PATCH] kernel: panic.c

2012-11-04 Thread Valentin Ilie
Fixed checkpatch warnings.
Replaced printk(KERN_WARNING with pr_warn

Signed-off-by: Valentin Ilie valentin.i...@gmail.com

---
 kernel/panic.c |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index e1b2822..8f1709f 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -100,7 +100,7 @@ void panic(const char *fmt, ...)
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
-   printk(KERN_EMERG Kernel panic - not syncing: %s\n,buf);
+   pr_emerg(Kernel panic - not syncing: %s\n, buf);
 #ifdef CONFIG_DEBUG_BUGVERBOSE
/*
 * Avoid nested stack-dumping if a panic occurs during oops processing
@@ -137,7 +137,7 @@ void panic(const char *fmt, ...)
 * Delay timeout seconds before rebooting the machine.
 * We can't use the normal timers since we just panicked.
 */
-   printk(KERN_EMERG Rebooting in %d seconds.., panic_timeout);
+   pr_emerg(Rebooting in %d seconds.., panic_timeout);
 
for (i = 0; i  panic_timeout * 1000; i += PANIC_TIMER_STEP) {
touch_nmi_watchdog();
@@ -161,7 +161,7 @@ void panic(const char *fmt, ...)
extern int stop_a_enabled;
/* Make sure the user can actually press Stop-A (L1-A) */
stop_a_enabled = 1;
-   printk(KERN_EMERG Press Stop-A (L1-A) to return to the boot 
prom\n);
+   pr_emerg(Press Stop-A (L1-A) to return to the boot prom\n);
}
 #endif
 #if defined(CONFIG_S390)
@@ -182,7 +182,6 @@ void panic(const char *fmt, ...)
mdelay(PANIC_TIMER_STEP);
}
 }
-
 EXPORT_SYMBOL(panic);
 
 
@@ -277,7 +276,7 @@ void add_taint(unsigned flag)
 
default:
if (__debug_locks_off())
-   printk(KERN_WARNING Disabling lock debugging due to 
kernel taint\n);
+   pr_warn(Disabling lock debugging due to kernel 
taint\n);
}
 
set_bit(flag, tainted_mask);
@@ -383,7 +382,7 @@ late_initcall(init_oops_id);
 void print_oops_end_marker(void)
 {
init_oops_id();
-   printk(KERN_WARNING ---[ end trace %016llx ]---\n,
+   pr_warn(---[ end trace %016llx ]---\n,
(unsigned long long)oops_id);
 }
 
@@ -409,11 +408,11 @@ static void warn_slowpath_common(const char *file, int 
line, void *caller,
 {
const char *board;
 
-   printk(KERN_WARNING [ cut here ]\n);
-   printk(KERN_WARNING WARNING: at %s:%d %pS()\n, file, line, caller);
+   pr_warn([ cut here ]\n);
+   pr_warn(WARNING: at %s:%d %pS()\n, file, line, caller);
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
-   printk(KERN_WARNING Hardware name: %s\n, board);
+   pr_warn(Hardware name: %s\n, board);
 
if (args)
vprintk(args-fmt, args-args);
-- 
1.7.10.4

--
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/


[PATCH] kernel: workqueue.c: fixed checkpatch issues

2012-08-18 Thread valentin . ilie
From: valentin 

Fixed some checkpatch warnings.

Signed-off-by: Valentin Ilie 
---
 kernel/workqueue.c |   27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 692d976..c4d57c8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -268,16 +268,16 @@ struct workqueue_struct {
 };
 
 struct workqueue_struct *system_wq __read_mostly;
-struct workqueue_struct *system_long_wq __read_mostly;
-struct workqueue_struct *system_nrt_wq __read_mostly;
-struct workqueue_struct *system_unbound_wq __read_mostly;
-struct workqueue_struct *system_freezable_wq __read_mostly;
-struct workqueue_struct *system_nrt_freezable_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_wq);
+struct workqueue_struct *system_long_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_long_wq);
+struct workqueue_struct *system_nrt_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_nrt_wq);
+struct workqueue_struct *system_unbound_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_unbound_wq);
+struct workqueue_struct *system_freezable_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_freezable_wq);
+struct workqueue_struct *system_nrt_freezable_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_nrt_freezable_wq);
 
 #define CREATE_TRACE_POINTS
@@ -2011,10 +2011,9 @@ __acquires(>lock)
lock_map_release(>wq->lockdep_map);
 
if (unlikely(in_atomic() || lockdep_depth(current) > 0)) {
-   printk(KERN_ERR "BUG: workqueue leaked lock or atomic: "
-  "%s/0x%08x/%d\n",
+   pr_err("BUG: workqueue leaked lock or atomic: %s/0x%08x/%d\n",
   current->comm, preempt_count(), task_pid_nr(current));
-   printk(KERN_ERR "last function: ");
+   pr_err("last function: ");
print_symbol("%s\n", (unsigned long)f);
debug_show_held_locks(current);
dump_stack();
@@ -2569,8 +2568,8 @@ reflush:
 
if (++flush_cnt == 10 ||
(flush_cnt % 100 == 0 && flush_cnt <= 1000))
-   pr_warning("workqueue %s: flush on destruction isn't 
complete after %u tries\n",
-  wq->name, flush_cnt);
+   pr_warn("workqueue %s: flush on destruction isn't 
complete after %u tries\n",
+   wq->name, flush_cnt);
goto reflush;
}
 
@@ -2781,7 +2780,7 @@ static int try_to_grab_pending(struct work_struct *work)
 }
 
 static bool __cancel_work_timer(struct work_struct *work,
-   struct timer_list* timer)
+   struct timer_list *timer)
 {
int ret;
 
@@ -3085,9 +3084,9 @@ static int wq_clamp_max_active(int max_active, unsigned 
int flags,
int lim = flags & WQ_UNBOUND ? WQ_UNBOUND_MAX_ACTIVE : WQ_MAX_ACTIVE;
 
if (max_active < 1 || max_active > lim)
-   printk(KERN_WARNING "workqueue: max_active %d requested for %s "
-  "is out of range, clamping between %d and %d\n",
-  max_active, name, 1, lim);
+   pr_warn("workqueue: max_active %d requested for %s is out of "
+   "range, clamping between %d and %d\n",
+   max_active, name, 1, lim);
 
return clamp_val(max_active, 1, lim);
 }
-- 
1.7.10.4

--
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/


[PATCH] kernel: workqueue.c: fixed checkpatch issues

2012-08-18 Thread valentin . ilie
From: valentin valentin.i...@gmail.com

Fixed some checkpatch warnings.

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 kernel/workqueue.c |   27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/kernel/workqueue.c b/kernel/workqueue.c
index 692d976..c4d57c8 100644
--- a/kernel/workqueue.c
+++ b/kernel/workqueue.c
@@ -268,16 +268,16 @@ struct workqueue_struct {
 };
 
 struct workqueue_struct *system_wq __read_mostly;
-struct workqueue_struct *system_long_wq __read_mostly;
-struct workqueue_struct *system_nrt_wq __read_mostly;
-struct workqueue_struct *system_unbound_wq __read_mostly;
-struct workqueue_struct *system_freezable_wq __read_mostly;
-struct workqueue_struct *system_nrt_freezable_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_wq);
+struct workqueue_struct *system_long_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_long_wq);
+struct workqueue_struct *system_nrt_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_nrt_wq);
+struct workqueue_struct *system_unbound_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_unbound_wq);
+struct workqueue_struct *system_freezable_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_freezable_wq);
+struct workqueue_struct *system_nrt_freezable_wq __read_mostly;
 EXPORT_SYMBOL_GPL(system_nrt_freezable_wq);
 
 #define CREATE_TRACE_POINTS
@@ -2011,10 +2011,9 @@ __acquires(gcwq-lock)
lock_map_release(cwq-wq-lockdep_map);
 
if (unlikely(in_atomic() || lockdep_depth(current)  0)) {
-   printk(KERN_ERR BUG: workqueue leaked lock or atomic: 
-  %s/0x%08x/%d\n,
+   pr_err(BUG: workqueue leaked lock or atomic: %s/0x%08x/%d\n,
   current-comm, preempt_count(), task_pid_nr(current));
-   printk(KERN_ERR last function: );
+   pr_err(last function: );
print_symbol(%s\n, (unsigned long)f);
debug_show_held_locks(current);
dump_stack();
@@ -2569,8 +2568,8 @@ reflush:
 
if (++flush_cnt == 10 ||
(flush_cnt % 100 == 0  flush_cnt = 1000))
-   pr_warning(workqueue %s: flush on destruction isn't 
complete after %u tries\n,
-  wq-name, flush_cnt);
+   pr_warn(workqueue %s: flush on destruction isn't 
complete after %u tries\n,
+   wq-name, flush_cnt);
goto reflush;
}
 
@@ -2781,7 +2780,7 @@ static int try_to_grab_pending(struct work_struct *work)
 }
 
 static bool __cancel_work_timer(struct work_struct *work,
-   struct timer_list* timer)
+   struct timer_list *timer)
 {
int ret;
 
@@ -3085,9 +3084,9 @@ static int wq_clamp_max_active(int max_active, unsigned 
int flags,
int lim = flags  WQ_UNBOUND ? WQ_UNBOUND_MAX_ACTIVE : WQ_MAX_ACTIVE;
 
if (max_active  1 || max_active  lim)
-   printk(KERN_WARNING workqueue: max_active %d requested for %s 
-  is out of range, clamping between %d and %d\n,
-  max_active, name, 1, lim);
+   pr_warn(workqueue: max_active %d requested for %s is out of 
+   range, clamping between %d and %d\n,
+   max_active, name, 1, lim);
 
return clamp_val(max_active, 1, lim);
 }
-- 
1.7.10.4

--
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/


Kernel: panic.c: fixed checkpatch warnings

2012-07-08 Thread Valentin Ilie
Replaced printk(KERN_WARNING.. with pr_warn..

Signed-off-by: Valentin Ilie 
---
 kernel/panic.c |   18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index d2a5f4e..be76bc4 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -37,7 +37,6 @@ int panic_timeout;
 EXPORT_SYMBOL_GPL(panic_timeout);
 
 ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
-
 EXPORT_SYMBOL(panic_notifier_list);
 
 static long no_blink(int state)
@@ -92,7 +91,7 @@ void panic(const char *fmt, ...)
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
-   printk(KERN_EMERG "Kernel panic - not syncing: %s\n",buf);
+   pr_emerg("Kernel panic - not syncing: %s\n", buf);
 #ifdef CONFIG_DEBUG_BUGVERBOSE
/*
 * Avoid nested stack-dumping if a panic occurs during oops processing
@@ -129,7 +128,7 @@ void panic(const char *fmt, ...)
 * Delay timeout seconds before rebooting the machine.
 * We can't use the "normal" timers since we just panicked.
 */
-   printk(KERN_EMERG "Rebooting in %d seconds..", panic_timeout);
+   pr_emerg("Rebooting in %d seconds..", panic_timeout);
 
for (i = 0; i < panic_timeout * 1000; i += PANIC_TIMER_STEP) {
touch_nmi_watchdog();
@@ -153,7 +152,7 @@ void panic(const char *fmt, ...)
extern int stop_a_enabled;
/* Make sure the user can actually press Stop-A (L1-A) */
stop_a_enabled = 1;
-   printk(KERN_EMERG "Press Stop-A (L1-A) to return to the boot 
prom\n");
+   pr_emerg("Press Stop-A (L1-A) to return to the boot prom\n");
}
 #endif
 #if defined(CONFIG_S390)
@@ -174,7 +173,6 @@ void panic(const char *fmt, ...)
mdelay(PANIC_TIMER_STEP);
}
 }
-
 EXPORT_SYMBOL(panic);
 
 
@@ -269,7 +267,7 @@ void add_taint(unsigned flag)
 
default:
if (__debug_locks_off())
-   printk(KERN_WARNING "Disabling lock debugging due to 
kernel taint\n");
+   pr_warn("Disabling lock debugging due to kernel 
taint\n");
}
 
set_bit(flag, _mask);
@@ -375,7 +373,7 @@ late_initcall(init_oops_id);
 void print_oops_end_marker(void)
 {
init_oops_id();
-   printk(KERN_WARNING "---[ end trace %016llx ]---\n",
+   pr_warn("---[ end trace %016llx ]---\n",
(unsigned long long)oops_id);
 }
 
@@ -401,11 +399,11 @@ static void warn_slowpath_common(const char *file, int 
line, void *caller,
 {
const char *board;
 
-   printk(KERN_WARNING "[ cut here ]\n");
-   printk(KERN_WARNING "WARNING: at %s:%d %pS()\n", file, line, caller);
+   pr_warn("[ cut here ]\n");
+   pr_warn("WARNING: at %s:%d %pS()\n", file, line, caller);
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
-   printk(KERN_WARNING "Hardware name: %s\n", board);
+   pr_warn("Hardware name: %s\n", board);
 
if (args)
vprintk(args->fmt, args->args);
-- 
1.7.10.4

--
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/


[PATCH] Kernel: dma.c: fixed coding style issues

2012-07-08 Thread Valentin Ilie
Fixed coding style issues. (checkpatch warnings)

Signed-off-by: Valentin Ilie 
---
 kernel/dma.c |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/kernel/dma.c b/kernel/dma.c
index 6c6262f..082cd74 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -38,6 +38,7 @@
 
 
 DEFINE_SPINLOCK(dma_spin_lock);
+EXPORT_SYMBOL(dma_spin_lock);
 
 /*
  * If our port doesn't define this it has no PC like DMA
@@ -66,7 +67,7 @@ static struct dma_chan dma_chan_busy[MAX_DMA_CHANNELS] = {
  * @dmanr: DMA channel number
  * @device_id: reserving device ID string, used in /proc/dma
  */
-int request_dma(unsigned int dmanr, const char * device_id)
+int request_dma(unsigned int dmanr, const char *device_id)
 {
if (dmanr >= MAX_DMA_CHANNELS)
return -EINVAL;
@@ -87,12 +88,12 @@ int request_dma(unsigned int dmanr, const char * device_id)
 void free_dma(unsigned int dmanr)
 {
if (dmanr >= MAX_DMA_CHANNELS) {
-   printk(KERN_WARNING "Trying to free DMA%d\n", dmanr);
+   pr_warn("Trying to free DMA%d\n", dmanr);
return;
}
 
if (xchg(_chan_busy[dmanr].lock, 0) == 0) {
-   printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr);
+   pr_warn("Trying to free free DMA%d\n", dmanr);
return;
}
 
@@ -104,12 +105,14 @@ int request_dma(unsigned int dmanr, const char *device_id)
 {
return -EINVAL;
 }
+EXPORT_SYMBOL(request_dma);
 
 void free_dma(unsigned int dmanr)
 {
 }
+EXPORT_SYMBOL(free_dma);
 
-#endif
+#endif /* MAX_DMA_CHANNELS */
 
 #ifdef CONFIG_PROC_FS
 
@@ -153,8 +156,4 @@ static int __init proc_dma_init(void)
 }
 
 __initcall(proc_dma_init);
-#endif
-
-EXPORT_SYMBOL(request_dma);
-EXPORT_SYMBOL(free_dma);
-EXPORT_SYMBOL(dma_spin_lock);
+#endif /* CONFIG_PROC_FS */
-- 
1.7.10.4

--
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/


[PATCH] Kernel: dma.c: fixed coding style issues

2012-07-08 Thread Valentin Ilie
Fixed coding style issues. (checkpatch warnings)

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 kernel/dma.c |   17 -
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/kernel/dma.c b/kernel/dma.c
index 6c6262f..082cd74 100644
--- a/kernel/dma.c
+++ b/kernel/dma.c
@@ -38,6 +38,7 @@
 
 
 DEFINE_SPINLOCK(dma_spin_lock);
+EXPORT_SYMBOL(dma_spin_lock);
 
 /*
  * If our port doesn't define this it has no PC like DMA
@@ -66,7 +67,7 @@ static struct dma_chan dma_chan_busy[MAX_DMA_CHANNELS] = {
  * @dmanr: DMA channel number
  * @device_id: reserving device ID string, used in /proc/dma
  */
-int request_dma(unsigned int dmanr, const char * device_id)
+int request_dma(unsigned int dmanr, const char *device_id)
 {
if (dmanr = MAX_DMA_CHANNELS)
return -EINVAL;
@@ -87,12 +88,12 @@ int request_dma(unsigned int dmanr, const char * device_id)
 void free_dma(unsigned int dmanr)
 {
if (dmanr = MAX_DMA_CHANNELS) {
-   printk(KERN_WARNING Trying to free DMA%d\n, dmanr);
+   pr_warn(Trying to free DMA%d\n, dmanr);
return;
}
 
if (xchg(dma_chan_busy[dmanr].lock, 0) == 0) {
-   printk(KERN_WARNING Trying to free free DMA%d\n, dmanr);
+   pr_warn(Trying to free free DMA%d\n, dmanr);
return;
}
 
@@ -104,12 +105,14 @@ int request_dma(unsigned int dmanr, const char *device_id)
 {
return -EINVAL;
 }
+EXPORT_SYMBOL(request_dma);
 
 void free_dma(unsigned int dmanr)
 {
 }
+EXPORT_SYMBOL(free_dma);
 
-#endif
+#endif /* MAX_DMA_CHANNELS */
 
 #ifdef CONFIG_PROC_FS
 
@@ -153,8 +156,4 @@ static int __init proc_dma_init(void)
 }
 
 __initcall(proc_dma_init);
-#endif
-
-EXPORT_SYMBOL(request_dma);
-EXPORT_SYMBOL(free_dma);
-EXPORT_SYMBOL(dma_spin_lock);
+#endif /* CONFIG_PROC_FS */
-- 
1.7.10.4

--
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/


Kernel: panic.c: fixed checkpatch warnings

2012-07-08 Thread Valentin Ilie
Replaced printk(KERN_WARNING.. with pr_warn..

Signed-off-by: Valentin Ilie valentin.i...@gmail.com
---
 kernel/panic.c |   18 --
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/kernel/panic.c b/kernel/panic.c
index d2a5f4e..be76bc4 100644
--- a/kernel/panic.c
+++ b/kernel/panic.c
@@ -37,7 +37,6 @@ int panic_timeout;
 EXPORT_SYMBOL_GPL(panic_timeout);
 
 ATOMIC_NOTIFIER_HEAD(panic_notifier_list);
-
 EXPORT_SYMBOL(panic_notifier_list);
 
 static long no_blink(int state)
@@ -92,7 +91,7 @@ void panic(const char *fmt, ...)
va_start(args, fmt);
vsnprintf(buf, sizeof(buf), fmt, args);
va_end(args);
-   printk(KERN_EMERG Kernel panic - not syncing: %s\n,buf);
+   pr_emerg(Kernel panic - not syncing: %s\n, buf);
 #ifdef CONFIG_DEBUG_BUGVERBOSE
/*
 * Avoid nested stack-dumping if a panic occurs during oops processing
@@ -129,7 +128,7 @@ void panic(const char *fmt, ...)
 * Delay timeout seconds before rebooting the machine.
 * We can't use the normal timers since we just panicked.
 */
-   printk(KERN_EMERG Rebooting in %d seconds.., panic_timeout);
+   pr_emerg(Rebooting in %d seconds.., panic_timeout);
 
for (i = 0; i  panic_timeout * 1000; i += PANIC_TIMER_STEP) {
touch_nmi_watchdog();
@@ -153,7 +152,7 @@ void panic(const char *fmt, ...)
extern int stop_a_enabled;
/* Make sure the user can actually press Stop-A (L1-A) */
stop_a_enabled = 1;
-   printk(KERN_EMERG Press Stop-A (L1-A) to return to the boot 
prom\n);
+   pr_emerg(Press Stop-A (L1-A) to return to the boot prom\n);
}
 #endif
 #if defined(CONFIG_S390)
@@ -174,7 +173,6 @@ void panic(const char *fmt, ...)
mdelay(PANIC_TIMER_STEP);
}
 }
-
 EXPORT_SYMBOL(panic);
 
 
@@ -269,7 +267,7 @@ void add_taint(unsigned flag)
 
default:
if (__debug_locks_off())
-   printk(KERN_WARNING Disabling lock debugging due to 
kernel taint\n);
+   pr_warn(Disabling lock debugging due to kernel 
taint\n);
}
 
set_bit(flag, tainted_mask);
@@ -375,7 +373,7 @@ late_initcall(init_oops_id);
 void print_oops_end_marker(void)
 {
init_oops_id();
-   printk(KERN_WARNING ---[ end trace %016llx ]---\n,
+   pr_warn(---[ end trace %016llx ]---\n,
(unsigned long long)oops_id);
 }
 
@@ -401,11 +399,11 @@ static void warn_slowpath_common(const char *file, int 
line, void *caller,
 {
const char *board;
 
-   printk(KERN_WARNING [ cut here ]\n);
-   printk(KERN_WARNING WARNING: at %s:%d %pS()\n, file, line, caller);
+   pr_warn([ cut here ]\n);
+   pr_warn(WARNING: at %s:%d %pS()\n, file, line, caller);
board = dmi_get_system_info(DMI_PRODUCT_NAME);
if (board)
-   printk(KERN_WARNING Hardware name: %s\n, board);
+   pr_warn(Hardware name: %s\n, board);
 
if (args)
vprintk(args-fmt, args-args);
-- 
1.7.10.4

--
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/