Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1060331lqz; Sun, 31 Mar 2024 11:41:02 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXYwRFNwhgmaxDT/E6sQSEOX6xJlF6GR12sgHOnBYonvrZ0IoYKQKf3ansJ88Y73vkBKqZiiy+Q6fV5o+WXLwZ6uGALwUrpsjF8a6iJqA== X-Google-Smtp-Source: AGHT+IHntaI/J+RM5YeXbwOsOo5RhETUsINI3VIK0J9hSoreP0uwjcSW3OvxqI6936/oIg8OVODj X-Received: by 2002:a17:907:3da0:b0:a4e:5c46:8831 with SMTP id he32-20020a1709073da000b00a4e5c468831mr1831145ejc.60.1711910462510; Sun, 31 Mar 2024 11:41:02 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711910462; cv=pass; d=google.com; s=arc-20160816; b=eXUmsLgZVI+QtE2xANQfX7o8k93SMWXrM5sMcagynkt1EGb5t6a19eEOA8d86GR42+ nlyxGn7zwSkRxIvzIlrtGnNh9WjD2RlPDwTlWjlxr6jKTIvvl3TtI28TX8GeVayl/Uau kiURx9Z+P55vQDOuHaPqwfs+frTWuJbmDCfRwMhyJr1ri0eZBEWmiPhwM0hKC0Rhi2Oi odE1erDeykmex/RTL8YbNSjI9/mwNw8C+H2Y1wq5oppW+cVylMOurTYIZX8IVETf50F2 QktLpeksrMtlYjFxwSKAFpqYzvuhhSHa5u5kwp4vffulCI8v2p8b2tR1Sq7fm+zGAt2Q AfAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=3RLEPu6RQP/5M9wd5J+kwXghCN3bfdIa3D9zecgf9m0=; fh=GayfzZRn+l2+ojgNht0OuzvY37GvN26bLaEbp6LClHg=; b=mhB1GKoGnuXhExl1ZTGDlVpzaGlbBHvBsdMyHU03k5i21JBnvbc2n4I+NA9zh2yHxs iQPUDI2Udx32p1v/PhS/Md95AQeieB/ZoV28i2+HF+Q0NRQWiiu484VagfKTg70U0tVY VQVCj4rZAa+WZQmejXrcix7ah5USlfBk+aUsdNNwMry3Yggt28OvgnYHvNiJBISF/7yW 7AER3saMThvWxMdRJUbJN9Ai+k/9Bcva5BBCTu4ocgO+vA5sNDGXgKr/MVqW4KfZqWpU YU67UVPJG0YqZMCi4T5qyeSnDgW2v4UY0SBxTRgviEjn5pR5z2jv0IedKjIQZIK/btxH xCmQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DhPxK8Wo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-126350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id m25-20020a17090607d900b00a46d8d3c346si3780245ejc.909.2024.03.31.11.41.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 31 Mar 2024 11:41:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-126350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DhPxK8Wo; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-126350-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-126350-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 067B81F23506 for ; Sun, 31 Mar 2024 18:41:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C2013146D5B; Sun, 31 Mar 2024 18:40:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DhPxK8Wo" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC7F04688; Sun, 31 Mar 2024 18:40:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711910453; cv=none; b=pfxYy6hXbj/EgKm/bgUsgpQMFt7+f//tBBYgJQhRvfA8ZR+JDIrROqp+/WCtkENGDvC7zrc4EmlIdWH9/DIXFoXzpBGb/C0SOfUDw7aJPHiRSXjPsspYmYcqABVlcgDN7lEsKzrABaRqd91EJ2ihsWD3pqG4fw9LnAv/xVwKQ/I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711910453; c=relaxed/simple; bh=ReDZvz0PK8Wdw1R/qBjVXBhqT+tqV1odnJn9/n31B0o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rIansGiARmi3OPl9tCxrh7pA4/ZX+5BEAJ6NpsEIxwgrn8Xay1VE8AvGAYiEQ7uow5Kb29SBL3c7aS+AwkSsyna/3ZWRdz+1EV/9w+zm01p5qXpTJK6dmiHTTN8VHFyFzv4eh0Y923N7W9cGpmqdr0oTrfchyczM9EPLKM86pE8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DhPxK8Wo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 613B8C433F1; Sun, 31 Mar 2024 18:40:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711910453; bh=ReDZvz0PK8Wdw1R/qBjVXBhqT+tqV1odnJn9/n31B0o=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=DhPxK8WoHKpch5OEWQLfQUplJHthOcuBKsYkPRJ9cMgBULbeFAb6dBjuhEm4O/a6E LimE4cymp0JFJZb90d+tNlEQ5OgO3z18yDC0Kg0vAsjqkLnOqq9o9H4DoMli76FUC6 ZVhAk9zzn4S3ydCfNfbHOYY3UFj+W+DVY4zg+2QoN8JyI5sC/RhwrNmsE4n445Woz0 UqbXhwPDSV+0eiGfQgKsn0EetwN/NIFmZ9XUBySwvqhyyEhIAQiWqIDPF58SGSIyvV QyyWkgOu0tcX8sNGLtzajJKB8m3llcSqP+WjqJ3b5LTibpChLj7wt+UwBzY2hqbWKR lQQ/32xPiSOug== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id E79B2CE0ACC; Sun, 31 Mar 2024 11:40:52 -0700 (PDT) Date: Sun, 31 Mar 2024 11:40:52 -0700 From: "Paul E. McKenney" To: Yujie Liu Cc: kernel test robot , oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [paulmck-rcu:dev.2024.03.27b 61/69] lib/cmpxchg-emu.c:24:11: warning: no previous prototype for 'cmpxchg_emu_u8' Message-ID: <09a45a0f-1936-4712-94dd-156ab70cb332@paulmck-laptop> Reply-To: paulmck@kernel.org References: <202403300508.Xz7XNp71-lkp@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Mon, Apr 01, 2024 at 12:06:26AM +0800, Yujie Liu wrote: > On Fri, Mar 29, 2024 at 04:08:10PM -0700, Paul E. McKenney wrote: > > On Sat, Mar 30, 2024 at 05:26:12AM +0800, kernel test robot wrote: > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2024.03.27b > > > head: 786fab3085d764055a78edb54023420920344333 > > > commit: b48ffed4c636b96d2be7a93806870772ce34961f [61/69] csky: Emulate one-byte and two-byte cmpxchg > > > config: csky-allnoconfig (https://download.01.org/0day-ci/archive/20240330/202403300508.Xz7XNp71-lkp@intel.com/config) > > > compiler: csky-linux-gcc (GCC) 13.2.0 > > > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240330/202403300508.Xz7XNp71-lkp@intel.com/reproduce) > > > > > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > > > the same patch/commit), kindly add following tags > > > | Reported-by: kernel test robot > > > | Closes: https://lore.kernel.org/oe-kbuild-all/202403300508.Xz7XNp71-lkp@intel.com/ > > > > > > All warnings (new ones prefixed by >>): > > > > > > >> lib/cmpxchg-emu.c:24:11: warning: no previous prototype for 'cmpxchg_emu_u8' [-Wmissing-prototypes] > > > 24 | uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new) > > > | ^~~~~~~~~~~~~~ > > > >> lib/cmpxchg-emu.c:51:11: warning: no previous prototype for 'cmpxchg_emu_u16' [-Wmissing-prototypes] > > > 51 | uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new) > > > | ^~~~~~~~~~~~~~~ > > > > Again, good catch, and thank you for the testing! Does the patch at the > > end of this email fix things for you? > > The warning is fixed by the patch at the end of the mail. > > Tested-by: Yujie Liu Thank you! I will apply all three of your Tested-by tags on my next rebase. Thanx, Paul > > > vim +/cmpxchg_emu_u8 +24 lib/cmpxchg-emu.c > > > > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 22 > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 23 /* Emulate one-byte cmpxchg() in terms of 4-byte cmpxchg. */ > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 @24 uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new) > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 25 { > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 26 u32 *p32 = (u32 *)(((uintptr_t)p) & ~0x3); > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 27 int i = ((uintptr_t)p) & 0x3; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 28 union u8_32 old32; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 29 union u8_32 new32; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 30 u32 ret; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 31 > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 32 old32.w = READ_ONCE(*p32); > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 33 do { > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 34 if (old32.b[i] != old) > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 35 return old32.b[i]; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 36 new32.w = old32.w; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 37 new32.b[i] = new; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 38 instrument_atomic_read_write(p, 1); > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 39 ret = data_race(cmpxchg(p32, old32.w, new32.w)); > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 40 } while (ret != old32.w); > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 41 return old; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 42 } > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 43 EXPORT_SYMBOL_GPL(cmpxchg_emu_u8); > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 44 > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 45 union u16_32 { > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 46 u16 h[2]; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 47 u32 w; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 48 }; > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 49 > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 50 /* Emulate two-byte cmpxchg() in terms of 4-byte cmpxchg. */ > > > 0bbce967f3ecfc Paul E. McKenney 2024-03-17 @51 uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new) > > > > > > :::::: The code at line 24 was first introduced by commit > > > :::::: 0bbce967f3ecfc6da1e7e8756b0d398e791b8dee lib: Add one-byte and two-byte cmpxchg() emulation functions > > > > > > :::::: TO: Paul E. McKenney > > > :::::: CC: Paul E. McKenney > > > > > > -- > > > 0-DAY CI Kernel Test Service > > > https://github.com/intel/lkp-tests/wiki > > > > commit a326496eb88936b291adea830c2e59e74ca1d373 > > Author: Paul E. McKenney > > Date: Fri Mar 29 16:06:45 2024 -0700 > > > > squash! lib: Add one-byte and two-byte cmpxchg() emulation functions > > > > [ paulmck: Apply kernel test robot feedback. ] > > > > Signed-off-by: Paul E. McKenney > > > > diff --git a/lib/cmpxchg-emu.c b/lib/cmpxchg-emu.c > > index abdd451767220..a88c4f3c88430 100644 > > --- a/lib/cmpxchg-emu.c > > +++ b/lib/cmpxchg-emu.c > > @@ -14,6 +14,7 @@ > > #include > > #include > > #include > > +#include > > > > union u8_32 { > > u8 b[4]; > >