Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2079414pxb; Mon, 12 Apr 2021 13:52:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOT6LeuSCr4yRGVC9yfzkXUfA+4BMAb+sVhClzXbblci1k2TnZ490Yh+jLXpfi75It1S2Z X-Received: by 2002:a17:90b:902:: with SMTP id bo2mr1087454pjb.193.1618260746881; Mon, 12 Apr 2021 13:52:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618260746; cv=none; d=google.com; s=arc-20160816; b=jFEixlz0CqDPTRwqCN1hCBE6zt6RAl9TEWQVRn0EP51hW/U1IEF32VijhlbetMJLb2 xLDqUa98QF+p1jth1nTHdeuN9vi4jyq7lK+unfCxhFgpjnctulukAEbD2MSN4gbf5P64 BOREl6KrlQR3jlfUCaCvZZqCfr5VYqosmqGfnnMY184RiNRMywxwjLQTi+Z/BtLZ7e5y xh+AnXPtZsNhBwdyA0ryrnk8E6eSyCRAkhrAooN3Rh0nq3MzR92IoLZ46quSKWosjDYD grf9olh89Eb6H4IKOzJk0Kqsoh5YICxrcYBUgc9AsgdoeCu+qmAgZNMwvXYHpVccnEGD QmvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Zl8gcypOzQ/j2JdUqvoGjrrFOtDMq5lkPKarTk//AOY=; b=dPUszEqOhwzdCxQy4ExHRjG5Y2H7AF3dF/eNP2hHZwzUzyQf1Xnn2a+3vwS/susG2o W9jYke7NCpccVFG6ADpdG+zwsuSS6fKWiuTCVo8fuRzSUUYSl0ij/CnaYGRj0nSlMED+ 2FpLcgTLJ2QGSD7hblNYjK4IlnrmaqSmpzF5YgefI6bLWFF4p9TMOOqsep/1/XXJJzSt C8Ax90ZHPc5/kL3VtzNkzqrCjSVSWREyRPxkHke4LzyfvmEb9TL2BcjrikrsIHkJvEKi HG/xJPjixbk2SdzJf3Wz7SbjKitEMlUkMjPFPD3ORRcyWzAF8NKTbG1arbkG0MrY14DO luJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="sqMw/Rgp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n68si14419625pgn.110.2021.04.12.13.52.13; Mon, 12 Apr 2021 13:52:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="sqMw/Rgp"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239775AbhDLJBO (ORCPT + 99 others); Mon, 12 Apr 2021 05:01:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:44272 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238466AbhDLIwL (ORCPT ); Mon, 12 Apr 2021 04:52:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ECF9D611F0; Mon, 12 Apr 2021 08:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618217476; bh=Pssl+L1Ni8KwTl834n12ZJfzUk4qjK5DT37VcSCaQfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sqMw/RgpqfkvtSYI7ZeKNNkkpTVh4GfQo9q8egKBT5j2DJfl8zV7/s5JbQgah8oP/ F7FIds0UlXwvdXBP9UCZfYXhJXXuy/KHIHQW6mFyIcokXZGWFvufyjN+Wy78j/JZ8S fQsRPxqALypXO3GJeSO6mBKn9Vc6r8bHsMsUAE6U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Liam Beguin , Helge Deller , Gao Xiang Subject: [PATCH 5.10 030/188] parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers Date: Mon, 12 Apr 2021 10:39:04 +0200 Message-Id: <20210412084014.656272073@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084013.643370347@linuxfoundation.org> References: <20210412084013.643370347@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Gao Xiang commit 4d752e5af63753ab5140fc282929b98eaa4bd12e upstream. commit b344d6a83d01 ("parisc: add support for cmpxchg on u8 pointers") can generate a sparse warning ("cast truncates bits from constant value"), which has been reported several times [1] [2] [3]. The original code worked as expected, but anyway, let silence such sparse warning as what others did [4]. [1] https://lore.kernel.org/r/202104061220.nRMBwCXw-lkp@intel.com [2] https://lore.kernel.org/r/202012291914.T5Agcn99-lkp@intel.com [3] https://lore.kernel.org/r/202008210829.KVwn7Xeh%25lkp@intel.com [4] https://lore.kernel.org/r/20210315131512.133720-2-jacopo+renesas@jmondi.org Cc: Liam Beguin Cc: Helge Deller Cc: stable@vger.kernel.org # v5.8+ Signed-off-by: Gao Xiang Signed-off-by: Helge Deller Signed-off-by: Greg Kroah-Hartman --- arch/parisc/include/asm/cmpxchg.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/parisc/include/asm/cmpxchg.h +++ b/arch/parisc/include/asm/cmpxchg.h @@ -72,7 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned l #endif case 4: return __cmpxchg_u32((unsigned int *)ptr, (unsigned int)old, (unsigned int)new_); - case 1: return __cmpxchg_u8((u8 *)ptr, (u8)old, (u8)new_); + case 1: return __cmpxchg_u8((u8 *)ptr, old & 0xff, new_ & 0xff); } __cmpxchg_called_with_bad_pointer(); return old;