From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754745AbdBGNTr (ORCPT ); Tue, 7 Feb 2017 08:19:47 -0500 Received: from smtprelay2.synopsys.com ([198.182.60.111]:45808 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753522AbdBGNTp (ORCPT ); Tue, 7 Feb 2017 08:19:45 -0500 From: Alexey Brodkin To: linux-snps-arc@lists.infradead.org Cc: linux-kernel@vger.kernel.org, Alexey Brodkin , Felix Fietkau , Vineet Gupta , Igor Guryanov Subject: [PATCH] ARC: [arcompact] fix handling of unaligned access in delay slot Date: Tue, 7 Feb 2017 16:19:38 +0300 Message-Id: <1486473578-21205-1-git-send-email-abrodkin@synopsys.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 9aed02feae5 ("ARC: [arcompact] handle unaligned access delay slot corner case") was meant to fix one corner-case of unaligned access fixup. But for some reason real implementation has an important spello which prevents kernel to be built with enabled CONFIG_ARC_EMUL_UNALIGNED: --------------------------------->8-------------------------------- arch/arc/kernel/unaligned.c: In function 'misaligned_fixup': arch/arc/kernel/unaligned.c:246:25: error: expected ';' before '~ token regs->ret = regs->bta ~1U; ^ --------------------------------->8-------------------------------- What needs to be done - LSB bit of regs->bta has to be cleared and now we do exactly this with "& ~1U". While at it fix another spello in comments. Signed-off-by: Alexey Brodkin Reported-by: John Crispin Cc: Felix Fietkau Cc: Vineet Gupta Cc: Igor Guryanov --- arch/arc/kernel/unaligned.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arc/kernel/unaligned.c b/arch/arc/kernel/unaligned.c index 91ebe382147f..39ee23d107cc 100644 --- a/arch/arc/kernel/unaligned.c +++ b/arch/arc/kernel/unaligned.c @@ -241,9 +241,9 @@ int misaligned_fixup(unsigned long address, struct pt_regs *regs, if (state.fault) goto fault; - /* clear any remanants of delay slot */ + /* clear any remnants of delay slot */ if (delay_mode(regs)) { - regs->ret = regs->bta ~1U; + regs->ret = regs->bta & ~1U; regs->status32 &= ~STATUS_DE_MASK; } else { regs->ret += state.instr_len; -- 2.7.4