Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7822850rwl; Tue, 10 Jan 2023 05:58:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXtktqbSxEF9iVY73e4dKQR1fdW86+kgBfdxrySkN4T+QToWRVqwY45NBDQ5UTVQokPpBy13 X-Received: by 2002:a17:90b:158e:b0:223:b1e4:146 with SMTP id lc14-20020a17090b158e00b00223b1e40146mr67623658pjb.37.1673359096624; Tue, 10 Jan 2023 05:58:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673359096; cv=none; d=google.com; s=arc-20160816; b=Lg2QTRMqdHKfS80QsiAaMCwywoUAYC2Q7JCRrgyW7vBak0geq8fFXOxuVgEZtI25At je/8laP2TqdYcMsgc3My6WObPzAkOX/NvvBtpu0+tm89PxKELKG/X7zheX0yOsdAqdZw 7l+O6hD5Vd5zgWhVs27naC08wdXER9VQQmRw/Rhp2RxF4SrdQPeUdFntUpJ1Wjit7E9l ApzPfNF/oB/G7GJKsmQ9vZ3EpsXRAZWTtyhdXK9g4KLKitWZGI61G6K05TmCcPbpryJ0 UXu+FAHRR5GJcBf65E8xRqS8jJqR1sejxNyo031WE5pnKZG3S5DlesZctkY8KeLj9AmN CcRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=E2Dsfeh+L22Up+05tfBf7KKXlOJsM1sQPzE0uRDEqyk=; b=pWB0TfZEgZCt6JM5A+tdOoC6KF1hXEU6ssUehRiutQNUsBMStttjz4yMFkTaG4asVM em8VOSSCA9nspXgusRXo98tUxQEvbQxEuvLfyI3yVQ85GIiIkAaUTcPEjrOfeXcNS9YO VppNDhX4NRnWLduR9U3FzYCleS7ZJnnSyhEuVgx66iL9jkUKn1rzUSAOl57cjFnoNfUR bj5QR1R11N4SV3maRQsby7AA2L8rKJhjlJtVUcDEBiIE6dIw5bEkdN5iyGIzNzigjHlQ OAWOcu/782eZ1FcDVZp0STmqMo1S6YMkEhquRjuKZYFWrfiTRsmp0LuQXxXzhECsoQ5s dR7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kO8ox8CR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rj4-20020a17090b3e8400b0021e41006030si11869114pjb.76.2023.01.10.05.58.09; Tue, 10 Jan 2023 05:58:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kO8ox8CR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238381AbjAJNxt (ORCPT + 53 others); Tue, 10 Jan 2023 08:53:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237663AbjAJNxU (ORCPT ); Tue, 10 Jan 2023 08:53:20 -0500 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EF098BF38; Tue, 10 Jan 2023 05:52:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673358752; x=1704894752; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=Tp8Z9Ay/HrlqQE0qDFK7p4Fost9+vU0ggkXvi/hfbkY=; b=kO8ox8CR+uhilfo5/X2nxkaV4R1ebPsPUWkdF4QsFnqdZi0+9yMqWhfv PKlzD1J/dYnz4SJUbaTjjtC0QteypDLuv9UL2ilJKOJseLb3blbbDRgKR /alyOqQ4wC48vEI6zM+ZbMmNStQiJjb/yC4L96pos2WPad5aLaWdyVG4l uSLI+r8CIVKKNrMjXpOdrBxFuVBLBGOGy9vjBUTE3wgpx9dSS06FYtC+A FnrdBVP/dZdOHbJka0bOPO00rFLSmTMw/1SY2fd3RmEgzglcdIq9JPESj +zfCtPa5XOVBH9lR3c6QkN7FDo4tDCyPTRSCV6yON/XMy6W476qcBtwWn A==; X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="387599277" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="387599277" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2023 05:52:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10585"; a="830995823" X-IronPort-AV: E=Sophos;i="5.96,315,1665471600"; d="scan'208";a="830995823" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga005.jf.intel.com with ESMTP; 10 Jan 2023 05:52:23 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1pFF36-0073E7-37; Tue, 10 Jan 2023 15:52:20 +0200 Date: Tue, 10 Jan 2023 15:52:20 +0200 From: Andy Shevchenko To: Andrzej Hajda Cc: Mark Rutland , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , dri-devel@lists.freedesktop.org, linux-mips@vger.kernel.org, sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-snps-arc@lists.infradead.org, Boqun Feng , linux-xtensa@linux-xtensa.org, Arnd Bergmann , intel-gfx@lists.freedesktop.org, linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, loongarch@lists.linux.dev, Rodrigo Vivi , linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Vetter , linux-alpha@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org Subject: Re: [Intel-gfx] [RFC DO NOT MERGE] treewide: use __xchg in most obvious places Message-ID: References: <20230110105306.3973122-1-andrzej.hajda@intel.com> <1bfae3d0-8c0b-ea83-7184-db847a4a969f@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1bfae3d0-8c0b-ea83-7184-db847a4a969f@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 10, 2023 at 01:46:37PM +0100, Andrzej Hajda wrote: > On 10.01.2023 12:07, Andy Shevchenko wrote: > > On Tue, Jan 10, 2023 at 11:53:06AM +0100, Andrzej Hajda wrote: ... > > > + return __xchg(&p_chain->p_prod_elem, > > > + (void *)(((u8 *)p_chain->p_prod_elem) + p_chain->elem_size)); > > > > Wondering if you still need a (void *) casting after the change. Ditto for the > > rest of similar cases. > > IMHO it is not needed also before the change and IIRC gcc has an extension > which allows to drop (u8 *) cast as well [1]. I guess you can drop at least the former one. > [1]: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html ... > > Btw, is it done by coccinelle? If no, why not providing the script? > > Yes I have used cocci. My cocci skills are far from perfect, so I did not > want to share my dirty code, but this is nothing secret: Thank you! It's not about secrecy, it's about automation / error proofness. -- With Best Regards, Andy Shevchenko