From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 942F6C6FD1F for ; Tue, 2 Apr 2024 17:21:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AE2B06B0083; Tue, 2 Apr 2024 13:21:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6BB66B0085; Tue, 2 Apr 2024 13:21:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8E5566B0088; Tue, 2 Apr 2024 13:21:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 6825E6B0083 for ; Tue, 2 Apr 2024 13:21:03 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 20BC0C09F6 for ; Tue, 2 Apr 2024 17:21:03 +0000 (UTC) X-FDA: 81965257206.09.B6D2624 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf30.hostedemail.com (Postfix) with ESMTP id 5D32E80015 for ; Tue, 2 Apr 2024 17:21:01 +0000 (UTC) Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JuJsNdep; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of "SRS0=/0Vc=LH=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=/0Vc=LH=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1712078461; a=rsa-sha256; cv=none; b=3Gh0QgkK5+TV+d9TfqyeT8qmV036oyyh/3l1H6PiUDnrF9Ru7eQAW0o6EIJcbADvutH7XB faE7orjDGnKUoy8D17bmuXSKwJfwyWhWfY75VUUMmaaAS0D2OjBTD1+ET5nMNljWNm1+tY 8e88dHKVwldpczphaAQkLrCZxaxc5/c= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=JuJsNdep; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf30.hostedemail.com: domain of "SRS0=/0Vc=LH=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" designates 139.178.84.217 as permitted sender) smtp.mailfrom="SRS0=/0Vc=LH=paulmck-ThinkPad-P17-Gen-1.home=paulmck@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1712078461; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=hCs/oI44tO2qd+zEx8tH/i9enxQZzVAA4rEr0dxtQhM=; b=nmm0rk5PrEN+TL66uXXfWDZW7a0dQEswnsYctENH41N8RUcZKfmAKezr95Swgr85Zdze5B GVkF6g73XG0VIzBMZhDy2vsRsPm7kD5XmP6xS97mRvCbpnPHrIWQv37Wot9OgNCE2L/Aug Qul4Vn05RlKhpGFxdEMAEK7VS5TuMWM= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5499661001; Tue, 2 Apr 2024 17:21:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF3B5C433C7; Tue, 2 Apr 2024 17:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1712078460; bh=UK+3+HxSRTmbngxVPisYm46ZN+zdwzhqfhTYNlZ8FO0=; h=Date:From:To:Cc:Subject:Reply-To:References:In-Reply-To:From; b=JuJsNdep86NzuSCIXdfbJlBnDRCabBn8nvVfaE/cDCCrorB3Zk9Xn7ZGHhz5DGoEJ vIHL425HFyzYRRW+g33MmMp3iv5Ftl+t3ZGEJklHJNZ6+9TFysjwHVl1J4VH6XhJLh ZawDyqfaLAC38L9p+GAhVdXzj7WTULkowO9D4zs8fU+49q5DfHZZ+G0LElZ42XEbSj vPBg9ScjKi5YcH5r9uMepswJPK0Ybk2C36r6G7uwXygeEuHfhgg6v01EmAIujK6MyG gPabBrqWik3XZ/UtjHM6sq5X/vatMlMuvuvsIZOSHb4c4nB9v86HznK/gCFcX+3qAU XyEPqjE4rX44g== Received: by paulmck-ThinkPad-P17-Gen-1.home (Postfix, from userid 1000) id 91D10CE0FF2; Tue, 2 Apr 2024 10:20:59 -0700 (PDT) Date: Tue, 2 Apr 2024 10:20:59 -0700 From: "Paul E. McKenney" To: kernel test robot Cc: oe-kbuild-all@lists.linux.dev, Linux Memory Management List Subject: Re: [linux-next:master 2559/3220] arch/riscv/include/asm/cmpxchg.h:329:23: warning: assignment to 'struct tty_struct *' from 'uintptr_t' {aka 'long unsigned int'} makes pointer from integer without a cast Message-ID: <55cfb596-8b21-4177-ab4c-0d531fb74c86@paulmck-laptop> Reply-To: paulmck@kernel.org References: <202404021504.YTP51bL3-lkp@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202404021504.YTP51bL3-lkp@intel.com> X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5D32E80015 X-Stat-Signature: pjua8j9cwsq4axkgwafn38pmqhexuagg X-HE-Tag: 1712078461-739506 X-HE-Meta: U2FsdGVkX1+F7KIJUqgygm+w3TlFI+UvJvN5PFTjAazKrordAgFo7deGf7E9U3Miy1wni1Tyjg3rurtgUPlszxrjKKz/E/VqQSQ3Ze1BQGgqxJdpK/udFXi+xqwOoMTPbU827VKBb7eoVugTUjqY8J83RbS4jpp/PACS5znkgI5yyXjSlRH5UOsro2qS55l+HjjHlNO/ET5vlM8sVDZ1nCU/ZgRgRilgY442tEZXIG06g/Lta9hHF+/jKucNu4z6PHvFNjkAXHS+S/SyVOGHIRabPPP1VOl0LGgFtXm+p1u89OgTkoZbGzUeiDOU7M1SVcp+n4bF5/kDqZXe6zhX5bQ1cSkv3+eMEfFHzWKV2UuwwHbLZGyhAeyG5ENw0cZ0aT3VKN031KuTgPQvepfRSdxD8Erqz74rzz4xvLeOddBOkYilFh9eR3Esw2D0uYgniHanoP6GVhd3Qw6Mf2ReQ4q0BcOpJdF/8CZXxn8ws0K5Wvo76dxdaTZK1d2hZG2Md5wa+d+gP7Za2xzFtmmEcw2p2sr/uZ9TVEPo4nhYWyRbaFYn+54aTheKLBOln6K/cYseYDz2vOm3O+hbN82Z51YuBsS6dSI7lHQjISn9HP7r13bWpF1O7rhZJDUHClQxOXl6E9NqxzXa3u6WWQ+edgQzCaTc38obD4dyRrifMTlte4yw+79+IHz6lXCD9s5j0vPHlgtQVYz8+rKoh022hcg4BkE4BZTfyKNcgPLtN3A/h6YMRQkYeAU7XLifQ25TP4q/+QZBvpY1/9Yl6KcdzN4XuaI4yx1S9tXX7CyV4xzSQcUKsTOs7RXpu42tt7uhJ1G0zmyxCzXMHvkcYABTsl2CLEXzpVwsikmldI6Qve+CK78jOnNj6b1jLW8P5Gipebcg3jTFoB4QSLKAjCLFaXUmf/VARYyViKbWKCE7FK8UsZgo21PoXFVJkMioryKIQl17r6gIsljR2IDYjf3 1NsjyVRr 8XCj0nHKhKJIVC7BMsmP1F+z3tr3jzSA2KwYUSKZ1V80vT4iAR6Dk9mX5Zcwdo26azRnaUk4maO08BIWMvRmrq0mv6l0Wdcc8rL2rrJ+rgWghzlZqzChOKbFnCsRCgOpJHjxKuiwA47r59Jl/T4ku8z+QfsF0CJU04fmNx1dcVuVA4I6NSackYZ1z9+z5l5gRRJUmeWsW90ItoG7CQyCmMSCc/djF24/vzw555vr2vj+TEtt2FEqDcbD99sCY7NRzcjhCcXGiU89ehQYpXbgTdktXxq5v0l030DLaL4mZnoi/CIBZRKhGkyiN/dKZhCQGEitAejji4QjgQGgnuXjeqcCvYJCVlJDgKfg9jdpMCVrgnUWLNs30SaQTF0zEtfx4ZYI8Ma5SZ5qwylBt4YvwAW9+7urpUIggKBJBIvyNGYvvSOWHTqraTz5iIFGzyyNwM2T8y9eyJCdXLlEYHp8S6wajRbZzZOoUvFVluQog7w+VTN/LRGo/giZrRvIECudPJ2g1l8rGturXsMoQrXTdSIuX1UqaDq3FaU37zmtkouNyp5y4Amrv3HE824dVFMImBNc0xSqu36kOs47oSkSdbu6kKQz0u4R/UyeNbQfFlgdMkOmIZzQvx8ZrPIlOnYP7bMw+PhQPZhKjuETMwUOZcqYkAfvSO2hiJEJOHJ6aWqn010ej/weTofWHLOE1Xr8UQWqYNmEiJv1tqm4Smzo/8aFzN2rk1SUZ67NKa8mDZit65X4xHMCqS943sw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Tue, Apr 02, 2024 at 03:08:07PM +0800, kernel test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: c0b832517f627ead3388c6f0c74e8ac10ad5774b > commit: df35ee400e06b23ecd44fdb66451a5343932f834 [2559/3220] riscv: Emulate one-byte and two-byte cmpxchg > config: riscv-randconfig-r061-20240402 (https://download.01.org/0day-ci/archive/20240402/202404021504.YTP51bL3-lkp@intel.com/config) > compiler: riscv64-linux-gcc (GCC) 13.2.0 > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240402/202404021504.YTP51bL3-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/202404021504.YTP51bL3-lkp@intel.com/ One fix leads to another. ;-) Does the patch at the end of this email clear things up? Thanx, Paul > All warnings (new ones prefixed by >>): > > In file included from arch/riscv/include/asm/atomic.h:19, > from include/linux/atomic.h:7, > from include/linux/cpumask.h:14, > from include/linux/smp.h:13, > from include/linux/lockdep.h:14, > from include/linux/spinlock.h:63, > from include/linux/mmzone.h:8, > from include/linux/gfp.h:7, > from include/linux/slab.h:16, > from drivers/accessibility/speakup/selection.c:2: > drivers/accessibility/speakup/selection.c: In function 'speakup_set_selection': > arch/riscv/include/asm/cmpxchg.h:329:62: warning: passing argument 2 of 'cmpxchg_emu_u8' makes integer from pointer without a cast [-Wint-conversion] > 329 | __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > In file included from arch/riscv/include/asm/cmpxchg.h:12: > include/linux/cmpxchg-emu.h:13:52: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 13 | uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > arch/riscv/include/asm/cmpxchg.h:329:69: warning: passing argument 3 of 'cmpxchg_emu_u8' makes integer from pointer without a cast [-Wint-conversion] > 329 | __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > include/linux/cmpxchg-emu.h:13:67: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 13 | uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > >> arch/riscv/include/asm/cmpxchg.h:329:23: warning: assignment to 'struct tty_struct *' from 'uintptr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion] > 329 | __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ > | ^ > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > arch/riscv/include/asm/cmpxchg.h:333:64: warning: passing argument 2 of 'cmpxchg_emu_u16' makes integer from pointer without a cast [-Wint-conversion] > 333 | __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > include/linux/cmpxchg-emu.h:14:54: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 14 | uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > arch/riscv/include/asm/cmpxchg.h:333:71: warning: passing argument 3 of 'cmpxchg_emu_u16' makes integer from pointer without a cast [-Wint-conversion] > 333 | __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > include/linux/cmpxchg-emu.h:14:69: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 14 | uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > arch/riscv/include/asm/cmpxchg.h:333:23: warning: assignment to 'struct tty_struct *' from 'uintptr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion] > 333 | __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > | ^ > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > drivers/accessibility/speakup/selection.c: In function 'speakup_paste_selection': > arch/riscv/include/asm/cmpxchg.h:329:62: warning: passing argument 2 of 'cmpxchg_emu_u8' makes integer from pointer without a cast [-Wint-conversion] > 329 | __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:124:13: note: in expansion of macro 'cmpxchg' > 124 | if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) { > | ^~~~~~~ > include/linux/cmpxchg-emu.h:13:52: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 13 | uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > arch/riscv/include/asm/cmpxchg.h:329:69: warning: passing argument 3 of 'cmpxchg_emu_u8' makes integer from pointer without a cast [-Wint-conversion] > 329 | __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:124:13: note: in expansion of macro 'cmpxchg' > 124 | if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) { > | ^~~~~~~ > include/linux/cmpxchg-emu.h:13:67: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 13 | uintptr_t cmpxchg_emu_u8(volatile u8 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > >> arch/riscv/include/asm/cmpxchg.h:329:23: warning: assignment to 'struct tty_struct *' from 'uintptr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion] > 329 | __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ > | ^ > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:124:13: note: in expansion of macro 'cmpxchg' > 124 | if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) { > | ^~~~~~~ > arch/riscv/include/asm/cmpxchg.h:333:64: warning: passing argument 2 of 'cmpxchg_emu_u16' makes integer from pointer without a cast [-Wint-conversion] > 333 | __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:124:13: note: in expansion of macro 'cmpxchg' > 124 | if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) { > | ^~~~~~~ > include/linux/cmpxchg-emu.h:14:54: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 14 | uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > arch/riscv/include/asm/cmpxchg.h:333:71: warning: passing argument 3 of 'cmpxchg_emu_u16' makes integer from pointer without a cast [-Wint-conversion] > 333 | __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > | ^~~~~ > | | > | struct tty_struct * > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:124:13: note: in expansion of macro 'cmpxchg' > 124 | if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) { > | ^~~~~~~ > include/linux/cmpxchg-emu.h:14:69: note: expected 'uintptr_t' {aka 'long unsigned int'} but argument is of type 'struct tty_struct *' > 14 | uintptr_t cmpxchg_emu_u16(volatile u16 *p, uintptr_t old, uintptr_t new); > | ~~~~~~~~~~^~~ > arch/riscv/include/asm/cmpxchg.h:333:23: warning: assignment to 'struct tty_struct *' from 'uintptr_t' {aka 'long unsigned int'} makes pointer from integer without a cast [-Wint-conversion] > 333 | __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > | ^ > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:124:13: note: in expansion of macro 'cmpxchg' > 124 | if (cmpxchg(&speakup_paste_work.tty, NULL, tty)) { > | ^~~~~~~ > drivers/accessibility/speakup/selection.c: In function 'speakup_set_selection': > arch/riscv/include/asm/cmpxchg.h:333:23: warning: this statement may fall through [-Wimplicit-fallthrough=] > 333 | __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > arch/riscv/include/asm/cmpxchg.h:334:9: note: here > 334 | case 4: \ > | ^~~~ > arch/riscv/include/asm/cmpxchg.h:368:30: note: in expansion of macro '__cmpxchg' > 368 | (__typeof__(*(ptr))) __cmpxchg((ptr), \ > | ^~~~~~~~~ > include/linux/atomic/atomic-arch-fallback.h:55:21: note: in expansion of macro 'arch_cmpxchg' > 55 | #define raw_cmpxchg arch_cmpxchg > | ^~~~~~~~~~~~ > include/linux/atomic/atomic-instrumented.h:4788:9: note: in expansion of macro 'raw_cmpxchg' > 4788 | raw_cmpxchg(__ai_ptr, __VA_ARGS__); \ > | ^~~~~~~~~~~ > drivers/accessibility/speakup/selection.c:71:13: note: in expansion of macro 'cmpxchg' > 71 | if (cmpxchg(&speakup_sel_work.tty, NULL, tty)) { > | ^~~~~~~ > > > vim +329 arch/riscv/include/asm/cmpxchg.h > > 319 > 320 #define __cmpxchg(ptr, old, new, size) \ > 321 ({ \ > 322 __typeof__(ptr) __ptr = (ptr); \ > 323 __typeof__(*(ptr)) __old = (old); \ > 324 __typeof__(*(ptr)) __new = (new); \ > 325 __typeof__(*(ptr)) __ret; \ > 326 register unsigned int __rc; \ > 327 switch (size) { \ > 328 case 1: \ > > 329 __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ > 330 break; \ > 331 case 2: \ > 332 break; \ > 333 __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ > 334 case 4: \ > 335 __asm__ __volatile__ ( \ > 336 "0: lr.w %0, %2\n" \ > 337 " bne %0, %z3, 1f\n" \ > 338 " sc.w.rl %1, %z4, %2\n" \ > 339 " bnez %1, 0b\n" \ > 340 RISCV_FULL_BARRIER \ > 341 "1:\n" \ > 342 : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \ > 343 : "rJ" ((long)__old), "rJ" (__new) \ > 344 : "memory"); \ > 345 break; \ > 346 case 8: \ > 347 __asm__ __volatile__ ( \ > 348 "0: lr.d %0, %2\n" \ > 349 " bne %0, %z3, 1f\n" \ > 350 " sc.d.rl %1, %z4, %2\n" \ > 351 " bnez %1, 0b\n" \ > 352 RISCV_FULL_BARRIER \ > 353 "1:\n" \ > 354 : "=&r" (__ret), "=&r" (__rc), "+A" (*__ptr) \ > 355 : "rJ" (__old), "rJ" (__new) \ > 356 : "memory"); \ > 357 break; \ > 358 default: \ > 359 BUILD_BUG(); \ > 360 } \ > 361 __ret; \ > 362 }) > 363 > > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki ------------------------------------------------------------------------ diff --git a/arch/riscv/include/asm/cmpxchg.h b/arch/riscv/include/asm/cmpxchg.h index a5b377481785c..fb1ac86ac2bf6 100644 --- a/arch/riscv/include/asm/cmpxchg.h +++ b/arch/riscv/include/asm/cmpxchg.h @@ -172,11 +172,11 @@ register unsigned int __rc; \ switch (size) { \ case 1: \ - __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, __old, __new); \ + __ret = cmpxchg_emu_u8((volatile u8 *)__ptr, (uintptr_t)__old, (uintptr_t)__new); \ break; \ case 2: \ break; \ - __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, __old, __new); \ + __ret = cmpxchg_emu_u16((volatile u16 *)__ptr, (uintptr_t)__old, (uintptr_t)__new); \ case 4: \ __asm__ __volatile__ ( \ "0: lr.w %0, %2\n" \