Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp5835652ybv; Wed, 12 Feb 2020 00:59:01 -0800 (PST) X-Google-Smtp-Source: APXvYqzUqPYgVR7K9eehnRo53J7f9xqVkw6GJQYTLIl3c+Jxgq56K5ReMQe0iXJExi7U197wtdg7 X-Received: by 2002:a05:6808:312:: with SMTP id i18mr5730986oie.44.1581497940947; Wed, 12 Feb 2020 00:59:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581497940; cv=none; d=google.com; s=arc-20160816; b=BmHHB9SvGTwjECdHBu6o8o3waq5r0oSn9//JbE3tGpjnsFzULZIxQGroxlLDDmETx/ 31AvkVEnKLuVhLXFk0WAeZwl3SZZg9omXxhKfF9Go5zZ7wBpyMRodDYKSTNe8UTWijeF gbYnPEbJyrbwZd60QyBGaNRhRULrCzfnm/obps3Uchy70TOjmU0WZmLIwBWFXh5P+QgB 7co+2vmATuz2vvJerCgjjEnM2eqnCjJmnGXts4k3lIeOS3b6Vm7+Yr86l4ihVrbKcE48 b/WymFz5hlbFaZa9T2SLrHeIA5/ax6NJ/rNWhUrMwqFQjZcIWKu196b1RxkBJJsRrpjm 71mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=PaNb/Wp11IhwyKZtaeQKdn01ArSCATdD8YJx8G+8pWE=; b=uJTzZd8Up0jVImrdypa9xNvIalH52rJ8B7OmK0o58YHFXr0QV/eC/4dCFi0LY+dwY+ qqefVRlbJ+KmPRfxB2Z/JalCPOLexwH2ETUyDxoq3O/8Wna5yW8Q0jObF2nMFoNbsVQT /EknQU8mqNDlKcx/QuZ2bnME+GTQ9SMILCUwp8mzjJwrWJV6IVy/ISXsR7REKTPG+0/q HOB8XGfTcxJ8YobTiyNgm0x8avDd9EFDiSkuIiEBMavbH+2Uv0aL8fRPBdj1Yy1GOsJ0 gNG/BSbR/scjRrZirvDSEOme108SptZUADIvLdrbFPKsgnHo6tgKN6Xjh1HV1lFujWKJ Bx9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=pvAOFnQm; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si3661014otg.66.2020.02.12.00.58.48; Wed, 12 Feb 2020 00:59:00 -0800 (PST) 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; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b=pvAOFnQm; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728848AbgBLI6a (ORCPT + 99 others); Wed, 12 Feb 2020 03:58:30 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:45864 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728816AbgBLI62 (ORCPT ); Wed, 12 Feb 2020 03:58:28 -0500 Received: by mail-wr1-f65.google.com with SMTP id g3so1170358wrs.12 for ; Wed, 12 Feb 2020 00:58:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PaNb/Wp11IhwyKZtaeQKdn01ArSCATdD8YJx8G+8pWE=; b=pvAOFnQmyb0XpA+3rrFTqQcXgWZcZCpPzPU33FovZQy6p03SaD2vv8L9o14UdUxpV4 lRnvQWA8AhmVTmy+NXcIyx+3RCBFVt6T52mgROqI4g7nEo7B28nJJ110uTTtCENtgFUU MHfpS/MJ3RQtT+12WCGlJII+jr1NL8Zf7S3JhzWhUCKPzhIUKHF6ZBH9+rMTQASlDrKr nOGpUIWJYfO8faoOhN1iAJVDyc7QhTXdVDgaSzgG9kA8jBoyGWc4cTkOdbIohA5LTqbJ NoHHgIL5VwYGSa+tx0onKADDLFh9xu3UA1RyVj9ngAQUODL/Vy4dXJ3VDcncqarJLsZ8 iITw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=PaNb/Wp11IhwyKZtaeQKdn01ArSCATdD8YJx8G+8pWE=; b=REDt6nvNneneDPIrDEwi8zom4o7M/Tl1n98zyqWqjMNZiq0PaLlvK1bhSOWlq8oIxw fCQA+AY9kBB/lzdvbEqYmOgdK68uva2wMd8oyXpr7i2SdbCf5T4kC5Felpm2V6PNYub4 Gu7Dy2c+yWJh9q22F9MeMCVIhO7r7H3QhPDAFuGCf5YZDnBy9a24NaL8E1Z8HdNToRXL I3kTFQHi/GbMDcat7rdD59wgfjOgjXpLYBYcMIYVZC6E89vQ5l18Wt0eg1QK9+UsSg6y vm7MzFXwbHVsWWY5sqsZMGWnOyTJCp7WBXZtbTKXK1RWNUfq0r4zw/BfYRx9YydRdjy4 kJyA== X-Gm-Message-State: APjAAAUTC+lBqWabaCgLJxmaP7wHvr4T9siNPrEjspkvDG+jOv6hf51d 17s9QvDryRItds4OL+x8EO3yVBsk6numJA== X-Received: by 2002:a5d:4bd0:: with SMTP id l16mr5409699wrt.271.1581497906135; Wed, 12 Feb 2020 00:58:26 -0800 (PST) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id n13sm7498001wmd.21.2020.02.12.00.58.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Feb 2020 00:58:25 -0800 (PST) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com, arnd@arndb.de Cc: Stefan Asserhall Subject: [PATCH 10/10] microblaze: Use asm generic cmpxchg.h for !SMP case Date: Wed, 12 Feb 2020 09:58:07 +0100 Message-Id: <4d8c08bc549fc663eba0237a4ccd5e1e0e1bc01c.1581497860.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.25.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The whole implementation is done in asm-generic/cmpxchg.h file and there is no reason to duplicate it. Also do not include asm-generic/cmpxchg-local.h because it is already included from asm-generic/cmpxchg.h Signed-off-by: Michal Simek Reviewed-by: Stefan Asserhall --- arch/microblaze/include/asm/cmpxchg.h | 40 ++------------------------- 1 file changed, 3 insertions(+), 37 deletions(-) diff --git a/arch/microblaze/include/asm/cmpxchg.h b/arch/microblaze/include/asm/cmpxchg.h index 596300c74509..3523b51aab36 100644 --- a/arch/microblaze/include/asm/cmpxchg.h +++ b/arch/microblaze/include/asm/cmpxchg.h @@ -2,42 +2,8 @@ #ifndef _ASM_MICROBLAZE_CMPXCHG_H #define _ASM_MICROBLAZE_CMPXCHG_H -#include - -void __bad_xchg(volatile void *ptr, int size); - -static inline unsigned long __xchg(unsigned long x, volatile void *ptr, - int size) -{ - unsigned long ret; - unsigned long flags; - - switch (size) { - case 1: - local_irq_save(flags); - ret = *(volatile unsigned char *)ptr; - *(volatile unsigned char *)ptr = x; - local_irq_restore(flags); - break; - - case 4: - local_irq_save(flags); - ret = *(volatile unsigned long *)ptr; - *(volatile unsigned long *)ptr = x; - local_irq_restore(flags); - break; - default: - __bad_xchg(ptr, size), ret = 0; - break; - } - - return ret; -} - -#define xchg(ptr, x) \ - ((__typeof__(*(ptr))) __xchg((unsigned long)(x), (ptr), sizeof(*(ptr)))) - -#include -#include +#ifndef CONFIG_SMP +# include +#endif #endif /* _ASM_MICROBLAZE_CMPXCHG_H */ -- 2.25.0