* [PATCH] x86/platform/uv/BAU: minor cleanup, make some local functions static
@ 2017-07-03 14:22 Colin King
2017-07-04 3:49 ` Dou Liyang
0 siblings, 1 reply; 4+ messages in thread
From: Colin King @ 2017-07-03 14:22 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86,
Andrew Banman, Mike Travis, Dimitri Sivanich
Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
Functions normal_busy, handle_uv2_busy, uv_flush_send_and_wait and
find_another_by_swack are local to the source, so make them static
Fixes various smatch warnings, such as:
"symbol 'find_another_by_swack' was not declared. Should it be static?"
"symbol 'handle_uv2_busy' was not declared. Should it be static?"
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
arch/x86/platform/uv/tlb_uv.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 2983faab5b18..730b47dce402 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -595,7 +595,7 @@ static unsigned long uv2_3_read_status(unsigned long offset, int rshft, int desc
* The bit provided by the activation_status_2 register is irrelevant to
* the status if it is only being tested for busy or not busy.
*/
-int normal_busy(struct bau_control *bcp)
+static int normal_busy(struct bau_control *bcp)
{
int cpu = bcp->uvhub_cpu;
int mmr_offset;
@@ -612,7 +612,7 @@ int normal_busy(struct bau_control *bcp)
* of a hardware bug.
* Workaround the bug.
*/
-int handle_uv2_busy(struct bau_control *bcp)
+static int handle_uv2_busy(struct bau_control *bcp)
{
struct ptc_stats *stat = bcp->statp;
@@ -917,7 +917,8 @@ static void handle_cmplt(int completion_status, struct bau_desc *bau_desc,
* Returns 1 if it gives up entirely and the original cpu mask is to be
* returned to the kernel.
*/
-int uv_flush_send_and_wait(struct cpumask *flush_mask, struct bau_control *bcp,
+static int uv_flush_send_and_wait(struct cpumask *flush_mask,
+ struct bau_control *bcp,
struct bau_desc *bau_desc)
{
int seq_number = 0;
@@ -1212,8 +1213,8 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
* Search the message queue for any 'other' unprocessed message with the
* same software acknowledge resource bit vector as the 'msg' message.
*/
-struct bau_pq_entry *find_another_by_swack(struct bau_pq_entry *msg,
- struct bau_control *bcp)
+static struct bau_pq_entry *find_another_by_swack(struct bau_pq_entry *msg,
+ struct bau_control *bcp)
{
struct bau_pq_entry *msg_next = msg + 1;
unsigned char swack_vec = msg->swack_vec;
--
2.11.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/platform/uv/BAU: minor cleanup, make some local functions static
2017-07-03 14:22 [PATCH] x86/platform/uv/BAU: minor cleanup, make some local functions static Colin King
@ 2017-07-04 3:49 ` Dou Liyang
2017-07-04 7:19 ` Thomas Gleixner
0 siblings, 1 reply; 4+ messages in thread
From: Dou Liyang @ 2017-07-04 3:49 UTC (permalink / raw)
To: Colin King, Thomas Gleixner, Ingo Molnar, H . Peter Anvin, x86,
Andrew Banman, Mike Travis, Dimitri Sivanich
Cc: kernel-janitors, linux-kernel
Hi Colin,
At 07/03/2017 10:22 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Functions normal_busy, handle_uv2_busy, uv_flush_send_and_wait and
> find_another_by_swack are local to the source, so make them static
>
> Fixes various smatch warnings, such as:
> "symbol 'find_another_by_swack' was not declared. Should it be static?"
> "symbol 'handle_uv2_busy' was not declared. Should it be static?"
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
> arch/x86/platform/uv/tlb_uv.c | 11 ++++++-----
> 1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
> index 2983faab5b18..730b47dce402 100644
> --- a/arch/x86/platform/uv/tlb_uv.c
> +++ b/arch/x86/platform/uv/tlb_uv.c
> @@ -595,7 +595,7 @@ static unsigned long uv2_3_read_status(unsigned long offset, int rshft, int desc
> * The bit provided by the activation_status_2 register is irrelevant to
> * the status if it is only being tested for busy or not busy.
> */
> -int normal_busy(struct bau_control *bcp)
> +static int normal_busy(struct bau_control *bcp)
In my opinion, there is no need to mark *normal_busy* static, remove it
directly.
the commit c5d35d399e68(x86/UV2: Work around BAU bug) add it to
handle_uv2_busy(), but the handle_uv2_busy() is rewritten now. the
normal_busy is unused, can be remove.
By the way, there are also an other function named
uv_bau_message_interrupt() can be remove.
Thanks,
dou.
> {
> int cpu = bcp->uvhub_cpu;
> int mmr_offset;
> @@ -612,7 +612,7 @@ int normal_busy(struct bau_control *bcp)
> * of a hardware bug.
> * Workaround the bug.
> */
> -int handle_uv2_busy(struct bau_control *bcp)
> +static int handle_uv2_busy(struct bau_control *bcp)
> {
> struct ptc_stats *stat = bcp->statp;
>
> @@ -917,7 +917,8 @@ static void handle_cmplt(int completion_status, struct bau_desc *bau_desc,
> * Returns 1 if it gives up entirely and the original cpu mask is to be
> * returned to the kernel.
> */
> -int uv_flush_send_and_wait(struct cpumask *flush_mask, struct bau_control *bcp,
> +static int uv_flush_send_and_wait(struct cpumask *flush_mask,
> + struct bau_control *bcp,
> struct bau_desc *bau_desc)
> {
> int seq_number = 0;
> @@ -1212,8 +1213,8 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask,
> * Search the message queue for any 'other' unprocessed message with the
> * same software acknowledge resource bit vector as the 'msg' message.
> */
> -struct bau_pq_entry *find_another_by_swack(struct bau_pq_entry *msg,
> - struct bau_control *bcp)
> +static struct bau_pq_entry *find_another_by_swack(struct bau_pq_entry *msg,
> + struct bau_control *bcp)
> {
> struct bau_pq_entry *msg_next = msg + 1;
> unsigned char swack_vec = msg->swack_vec;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/platform/uv/BAU: minor cleanup, make some local functions static
2017-07-04 3:49 ` Dou Liyang
@ 2017-07-04 7:19 ` Thomas Gleixner
2017-07-04 7:29 ` Dou Liyang
0 siblings, 1 reply; 4+ messages in thread
From: Thomas Gleixner @ 2017-07-04 7:19 UTC (permalink / raw)
To: Dou Liyang
Cc: Colin King, Ingo Molnar, H . Peter Anvin, x86, Andrew Banman,
Mike Travis, Dimitri Sivanich, kernel-janitors, linux-kernel
On Tue, 4 Jul 2017, Dou Liyang wrote:
> At 07/03/2017 10:22 PM, Colin King wrote:
> > -int normal_busy(struct bau_control *bcp)
> > +static int normal_busy(struct bau_control *bcp)
>
> In my opinion, there is no need to mark *normal_busy* static, remove it
> directly.
>
> the commit c5d35d399e68(x86/UV2: Work around BAU bug) add it to
> handle_uv2_busy(), but the handle_uv2_busy() is rewritten now. the
> normal_busy is unused, can be remove.
Correct.
> By the way, there are also an other function named
> uv_bau_message_interrupt() can be remove.
Not so much.
# git grep uv_bau_message_interrupt arch/x86/
arch/x86/entry/entry_64.S:apicinterrupt3 UV_BAU_MESSAGE uv_bau_message_intr1 uv_bau_message_interrupt
arch/x86/platform/uv/tlb_uv.c:void uv_bau_message_interrupt(struct pt_regs *regs)
Thanks,
tglx
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] x86/platform/uv/BAU: minor cleanup, make some local functions static
2017-07-04 7:19 ` Thomas Gleixner
@ 2017-07-04 7:29 ` Dou Liyang
0 siblings, 0 replies; 4+ messages in thread
From: Dou Liyang @ 2017-07-04 7:29 UTC (permalink / raw)
To: Thomas Gleixner
Cc: Colin King, Ingo Molnar, H . Peter Anvin, x86, Andrew Banman,
Mike Travis, Dimitri Sivanich, kernel-janitors, linux-kernel
Hi Thomas,
At 07/04/2017 03:19 PM, Thomas Gleixner wrote:
> On Tue, 4 Jul 2017, Dou Liyang wrote:
>> At 07/03/2017 10:22 PM, Colin King wrote:
>>> -int normal_busy(struct bau_control *bcp)
>>> +static int normal_busy(struct bau_control *bcp)
>>
>> In my opinion, there is no need to mark *normal_busy* static, remove it
>> directly.
>>
>> the commit c5d35d399e68(x86/UV2: Work around BAU bug) add it to
>> handle_uv2_busy(), but the handle_uv2_busy() is rewritten now. the
>> normal_busy is unused, can be remove.
>
> Correct.
>
>> By the way, there are also an other function named
>> uv_bau_message_interrupt() can be remove.
>
> Not so much.
>
> # git grep uv_bau_message_interrupt arch/x86/
> arch/x86/entry/entry_64.S:apicinterrupt3 UV_BAU_MESSAGE uv_bau_message_intr1 uv_bau_message_interrupt
> arch/x86/platform/uv/tlb_uv.c:void uv_bau_message_interrupt(struct pt_regs *regs)
>
Oops, Indeed! you are right. ;)
Thanks,
dou.
> Thanks,
>
> tglx
>
>
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-04 7:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-03 14:22 [PATCH] x86/platform/uv/BAU: minor cleanup, make some local functions static Colin King
2017-07-04 3:49 ` Dou Liyang
2017-07-04 7:19 ` Thomas Gleixner
2017-07-04 7:29 ` Dou Liyang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).