Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2112636pxb; Mon, 12 Apr 2021 14:55:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9xpNNkJgkKiNRtDSoLZwgLD3B3m5Y/n5wVfImtCYEbF4SD41YK9lhR4iSdBZ4VoLOw3qB X-Received: by 2002:a17:906:4d10:: with SMTP id r16mr20700817eju.169.1618264559326; Mon, 12 Apr 2021 14:55:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618264559; cv=none; d=google.com; s=arc-20160816; b=CHiztuzOAPB7f94undweBhja7pW00QE5KpzBgZJYNKv6tI0fcLfpmOziK3uL1xXO7q LKWHMQjgH2a2SQG7O8i9SzYJQXqipZjppRE4goPUIHK2U+M1kKrRgbYkHFI4qQEFHxE4 HVfBFtOUkYx2k8+YMvUitjGb6D0jtXi5C4alLGzAW2iocwaST4eipncdjJEU4A4Iyc42 va/aaKwVSUl8nD3p5Zij82dEIq+gLQx+HnhafFtRm8Pifzr4Y2/54kYGUzjTHXkOeDep cy7BIUuuPLt4C0rzxOB310XUejW9iE+tz5VDcCSTgKWGsqryzc3dkaUwxhILIa3YGcF9 b/uQ== 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=qPFkcAokwa/sm/lmnxKSA4otQOpuHuGmoOOQKjfvTyDuus8ohoTyfFqbXYpoWPv0Gd QKkJ38cl1lpo2MJsujX+Bl9NB70t+di9iLB1RD8OZzezGKO8XgowotXvu4c1U7fRq7Vl 0jVWpi83AUNUhFxoyAL3QvPjteS9GEiQnpq37DakAvroGBJGx1YGXvsH7gfPY+NYYExA GlaJd9Xpl7dzkERqNj6JSzgCHwk2KUay7bLmBGauQL4QTSRDGjYqMcHFIsbINhQmTPAo zBOo5dWLszR+NuxzN6pe2gy4QcZZCZS26uql5xuyH1wE759Wx4wZrRiYiM/tlYiHVeRF koqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=HtbshmBu; 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 f19si9740899edd.510.2021.04.12.14.55.34; Mon, 12 Apr 2021 14:55:59 -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=HtbshmBu; 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 S240511AbhDLJYJ (ORCPT + 99 others); Mon, 12 Apr 2021 05:24:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:54796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239932AbhDLJBh (ORCPT ); Mon, 12 Apr 2021 05:01:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1955E6137A; Mon, 12 Apr 2021 09:00:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618218009; bh=Pssl+L1Ni8KwTl834n12ZJfzUk4qjK5DT37VcSCaQfE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HtbshmBukeh6ovmB6y/Sa7dkB46Z4KqNiQpepJND8DNoTJbeitGicOTREb8dgj0DS Wnb3qahM0kl+LUcbF4RH6y0CgZEfY5xT75P5DtV3XMETiYcZdqdtKDWhmtcIGqXGjy tF0LIHMM9LoY6MYFnKjKA2jWmkk0I/vLUWGaNvUs= 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.11 037/210] parisc: avoid a warning on u8 cast for cmpxchg on u8 pointers Date: Mon, 12 Apr 2021 10:39:02 +0200 Message-Id: <20210412084017.247885238@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084016.009884719@linuxfoundation.org> References: <20210412084016.009884719@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;