Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp344430imm; Wed, 29 Aug 2018 01:14:58 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdawarv2KwLdW2Wi+Ij9YuaSRx+SM4rxm3BYidVkqEDa+yDwlUEnEPkCpaEu1dg8llXKTBg5 X-Received: by 2002:a62:9402:: with SMTP id m2-v6mr4840695pfe.3.1535530498742; Wed, 29 Aug 2018 01:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535530498; cv=none; d=google.com; s=arc-20160816; b=zQcFFV9rgsGevaAFwHIM1+9AL2jcg56gbAnnHW5Ta4Hmlqq45CC29rrdUROpLd9XK2 csIRbjoiVnckgGtCYzmw5Q1TXp+qrb2MEuFAGl5ke8bAKwuR80DZ1gGOMY390gPcJlFw TSDgY76RIYYzs/sVSS6r1Yzbh/LWyrz0brufQUZMJUG23MMumk8pRDgxBvmpGivpE+Oo no+Tu25dfvda1NT1kMcQonmqQ7EO5VYjakk6BfhH5rMc5vB/A+z6m4/EMv6pubLrV+ra Y00UxzwnOqilmX8yCtKrqQ75EffQWxycPlXZ0/CnflKtd0tFzkjUgAPjbfdeM8fVTzjI ci5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=VqswxntAhybQ33EhwoOd3fTgeL8ptHkKQ6P3mkQI1V4=; b=iZy/kahNRoCHXrJw0hZA5oKT6C6Ok9uX6yMSSCHMtTAjKNp+OOzYHCC9aJlHcmqp7n pZdfbXR+8ZoPJnVZubJQvBSntqu91TgIx0gVzE5/0VuJ6X5ugdjgTNKMespFNlRkNNas geq5fVOpxk5PnrwDnTzfqoc6eWUn1hVp+Kac+ZzEtcJ9VPbQDo+KYz+UxZqieR1Ryhvx zFP8H5NYt4xn6gTHMXw9C0z5rD3yTYBLyPKoJeSkejRBr9cXRRwZFYKKiYFrhTt1EdMt NmJz+Q9/EHJXT6TdJngGJ+gPRJ9Ttb5sYiyqcmlMEaYSsmz2FAqpJhVeQoGFfDfPyE90 qF/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t13-v6si3297651pfc.194.2018.08.29.01.14.43; Wed, 29 Aug 2018 01:14:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728066AbeH2MJN (ORCPT + 99 others); Wed, 29 Aug 2018 08:09:13 -0400 Received: from ex13-edg-ou-002.vmware.com ([208.91.0.190]:26867 "EHLO EX13-EDG-OU-002.vmware.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727477AbeH2MJK (ORCPT ); Wed, 29 Aug 2018 08:09:10 -0400 Received: from sc9-mailhost3.vmware.com (10.113.161.73) by EX13-EDG-OU-002.vmware.com (10.113.208.156) with Microsoft SMTP Server id 15.0.1156.6; Wed, 29 Aug 2018 01:13:02 -0700 Received: from sc2-haas01-esx0118.eng.vmware.com (sc2-haas01-esx0118.eng.vmware.com [10.172.44.118]) by sc9-mailhost3.vmware.com (Postfix) with ESMTP id 569D940DD7; Wed, 29 Aug 2018 01:13:26 -0700 (PDT) From: Nadav Amit To: Thomas Gleixner CC: , Ingo Molnar , , Arnd Bergmann , , Nadav Amit , Andy Lutomirski , Masami Hiramatsu , Kees Cook , Peter Zijlstra Subject: [RFC PATCH 6/6] x86/alternatives: remove text_poke() return value Date: Wed, 29 Aug 2018 01:11:47 -0700 Message-ID: <20180829081147.184610-7-namit@vmware.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180829081147.184610-1-namit@vmware.com> References: <20180829081147.184610-1-namit@vmware.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: None (EX13-EDG-OU-002.vmware.com: namit@vmware.com does not designate permitted sender hosts) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The return value of text_poke() is meaningless - it is one of the function inputs. One day someone may allow the callers to deal with text_poke() failures, if those actually happen. In the meanwhile, remove the return value. Cc: Andy Lutomirski Cc: Masami Hiramatsu Cc: Kees Cook Cc: Peter Zijlstra Signed-off-by: Nadav Amit --- arch/x86/include/asm/text-patching.h | 2 +- arch/x86/kernel/alternative.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/text-patching.h b/arch/x86/include/asm/text-patching.h index ffe7902cc326..1f73f71b4de2 100644 --- a/arch/x86/include/asm/text-patching.h +++ b/arch/x86/include/asm/text-patching.h @@ -34,7 +34,7 @@ extern void *text_poke_early(void *addr, const void *opcode, size_t len); * On the local CPU you need to be protected again NMI or MCE handlers seeing an * inconsistent instruction while you patch. */ -extern void *text_poke(void *addr, const void *opcode, size_t len); +extern void text_poke(void *addr, const void *opcode, size_t len); extern int poke_int3_handler(struct pt_regs *regs); extern void *text_poke_bp(void *addr, const void *opcode, size_t len, void *handler); extern int after_bootmem; diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index 0feac3dfabe9..45b7fdeaed90 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c @@ -795,7 +795,7 @@ static void text_poke_safe(void *addr, const void *opcode, size_t len, * * Note: Must be called under text_mutex. */ -void *text_poke(void *addr, const void *opcode, size_t len) +void text_poke(void *addr, const void *opcode, size_t len) { bool cross_page_boundary = offset_in_page(addr) + len > PAGE_SIZE; struct page *pages[2] = {0}; -- 2.17.1