From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753149AbbFDR6Y (ORCPT ); Thu, 4 Jun 2015 13:58:24 -0400 Received: from mail-am1on0058.outbound.protection.outlook.com ([157.56.112.58]:8480 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751672AbbFDR6V (ORCPT ); Thu, 4 Jun 2015 13:58:21 -0400 Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; From: Chris Metcalf To: CC: Chris Metcalf Subject: [PATCH] tile: avoid a "label not used" warning in do_page_fault() Date: Thu, 4 Jun 2015 13:58:13 -0400 Message-ID: <1433440693-21801-1-git-send-email-cmetcalf@ezchip.com> X-Mailer: git-send-email 2.1.2 X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;DB3FFO11FD027;1:SXHru9VTy1D43x4/i4XgyAc3QAlLw9sWpcjKleie6kdm2qcaPeCsONOseoyzZL/QRImBC9NNEog7DxwOx9VNd/8TVhGJjKemLeeSt1t7F/wjtjVWO8J1Ho38fJluvQGJ0tBQgJOvrxYTXoHMUsJfnFTdtEcFZFHaZxTNlJghsQHnKbr6w0xwQO5lRjPdkx5/OWAvhNUVuB72ScN+FiqX8ZyvLJAiyiXt9fkOJuV03LHFfp+9rn/0cnyk93lj5rK+zXWzlVtq1nxM0Ct8KNWwhGn6er4jk23AbBFmZTiRbUi3olXl7ilAevWbbjhSIVS19SvkSN0488Ei/hg69UBHlvKnL7U90RLAarMJJ+ioaFU= X-Forefront-Antispam-Report: CIP:12.216.194.146;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(339900001)(189002)(199003)(229853001)(50466002)(77156002)(50986999)(50226001)(86362001)(47776003)(87936001)(85426001)(48376002)(6806004)(62966003)(450100001)(36756003)(106476002)(68736005)(92566002)(81156007)(33646002)(106356001)(104016003)(105606002)(19580405001)(4001540100001)(5001830100001)(42186005)(5001860100001)(46102003)(97736004)(110136002)(2351001)(189998001)(19580395003)(107886002)(106466001)(64706001)(5001960100002)(9376004)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR02MB0775;H:ld-1.internal.tilera.com;FPR:;SPF:Fail;PTR:InfoNoRecords;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775;UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB1174; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(520003)(5005006)(3002001);SRVR:DB5PR02MB0775;BCL:0;PCL:0;RULEID:;SRVR:DB5PR02MB0775; X-Forefront-PRVS: 0597911EE1 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jun 2015 17:58:16.5155 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3;Ip=[12.216.194.146];Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR02MB0775 X-OriginatorOrg: ezchip.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There are two different ifdef cases where the label is used, but if neither is true, the label is unused and the compiler generates a warning. Refactor the code the way x86 does so that there is a do_page_fault() that just does exception handling for context tracking, and make __do_page_fault() a static inline so that various cases can just return instead of doing a jump to "done". Signed-off-by: Chris Metcalf --- arch/tile/mm/fault.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/arch/tile/mm/fault.c b/arch/tile/mm/fault.c index e83cc999da02..4787ee8f0705 100644 --- a/arch/tile/mm/fault.c +++ b/arch/tile/mm/fault.c @@ -699,11 +699,10 @@ struct intvec_state do_page_fault_ics(struct pt_regs *regs, int fault_num, * interrupt away appropriately and return immediately. We can't do * page faults for user code while in kernel mode. */ -void do_page_fault(struct pt_regs *regs, int fault_num, - unsigned long address, unsigned long write) +static inline void __do_page_fault(struct pt_regs *regs, int fault_num, + unsigned long address, unsigned long write) { int is_page_fault; - enum ctx_state prev_state = exception_enter(); #ifdef CONFIG_KPROBES /* @@ -713,7 +712,7 @@ void do_page_fault(struct pt_regs *regs, int fault_num, */ if (notify_die(DIE_PAGE_FAULT, "page fault", regs, -1, regs->faultnum, SIGSEGV) == NOTIFY_STOP) - goto done; + return; #endif #ifdef __tilegx__ @@ -835,18 +834,22 @@ void do_page_fault(struct pt_regs *regs, int fault_num, async->is_fault = is_page_fault; async->is_write = write; async->address = address; - goto done; + return; } } #endif handle_page_fault(regs, fault_num, is_page_fault, address, write); +} -done: +void do_page_fault(struct pt_regs *regs, int fault_num, + unsigned long address, unsigned long write) +{ + enum ctx_state prev_state = exception_enter(); + __do_page_fault(regs, fault_num, address, write); exception_exit(prev_state); } - #if CHIP_HAS_TILE_DMA() /* * This routine effectively re-issues asynchronous page faults -- 2.1.2