Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7808383rwi; Mon, 24 Oct 2022 21:13:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7tFKRMYgEYn27EEJ7LE9fX4lYpBJKyMrfHgavUNuoZrMQX/8XG+l9C0kg2XWb+WdTf4cou X-Received: by 2002:a17:907:2d1e:b0:7a9:c2f9:2c2c with SMTP id gs30-20020a1709072d1e00b007a9c2f92c2cmr5796345ejc.405.1666671218536; Mon, 24 Oct 2022 21:13:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666671218; cv=none; d=google.com; s=arc-20160816; b=x/RiDg4TikaN4fZfd9CU87qcA/JclyxbJBNtW7EZe0zeFJA0lv7ZGRfIfNBUuLJAJ9 T96mnfXyy6S4ZPcS1uz37hRr+x8MI58bILGenHx6etEpeAFo4/QU5dAq7mPqWhM3NQtj GJYsQuEU452wjjo1z5fCQRxVdf/KHX3gpLBIla/mj2bMBxhQyxbaSgNIzbyh0S/jDPdn C+ChemJIgnMpnD9QKPr3O/KX1FG0PjXKxE2MniPoEKxlUM1PfML8j0FT1/mQvnfzjari eylvBfauaAEC/tIkkOTJPpBEIjEw1HUvKd3OVeP/TQQKqo4BtrA9qzfzV+9ZVHQKEb0l 4wgQ== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=SqueIuur96T/Lpqr3cus+zTBE27miZkejlPQDxMblsI=; b=E0A64oWse5o4CtAiHC/4z2Ju9YBdMhldpFx0SriUZtSlVW6yGZSeHJhZftLVx5Yep4 JdWrzYLelox1U/RdjxYp5cLOutoPeG0qloOBWeAx1jmB7VpKA8cRK9vNM5TdeB+lis6v nSmpl+DCe+1mA9AiRZv6yDEnbqDjCAywc3AX6dmiVxeSzrsaoHIxKZqW26ZtfyM91KSg /xbjj9iiS3i2PcwUFzRaf2Pg7QqV2JQ6YvqKaTT3S2j0q4PoK3IOA8zFM4EvIf3Q4ows obokY/OP8eFEWTIp0dPmRbnxgPwmf0tX4j0LpEBYYkAZkWBoRaMk+oWqiQmpzmo+aYSZ eUpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=P+KnXybm; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ga15-20020a1709070c0f00b0072fb108db55si1668895ejc.895.2022.10.24.21.13.13; Mon, 24 Oct 2022 21:13:38 -0700 (PDT) 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=@kernel.org header.s=k20201202 header.b=P+KnXybm; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbiJYEA1 (ORCPT + 99 others); Tue, 25 Oct 2022 00:00:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229528AbiJYEAX (ORCPT ); Tue, 25 Oct 2022 00:00:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B00384504D; Mon, 24 Oct 2022 21:00:22 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id AAD2061725; Tue, 25 Oct 2022 04:00:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 81CFBC433D7; Tue, 25 Oct 2022 04:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666670421; bh=3TINTyanXuh5N7qudvfxQz6WRFTsujLwEF2pzywIiiE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=P+KnXybmZVUF8gekFdWhYtiDldRQa2c58xCgS3Ba/n5uiZdtsuWFZ+YgTBOfCxIHh 2JmNbKMTzQwkP8wWeXWN2Os2mG4mnBgJ/9yKp58256KL8zWaqwPMtdEdg+ArHDKycg 02kzSCX5iq2Y4S4E3QzNG7VeZ3438EHSHLKAVtGBxw4wmKzSVRuj17oS7aN+z19Y1z +ImrrVUaFfuvbjHy2V8HvOYinRuzKFsSkySjPDDzVwHxyFMXzwzVfdn0W2UwUYgWRG dTP7g6yEgrQosSJxkBhpHnNRj89zSHufDIwjY3zdGheve31DXS+GteBnYkIAMaW8zX kUU5UgHNUKAbw== Date: Mon, 24 Oct 2022 21:00:19 -0700 From: Jakub Kicinski To: Junxiao Chang Cc: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, mcoquelin.stm32@gmail.com, Joao.Pinto@synopsys.com, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 1/2] net: stmmac: fix unsafe MTL DMA macro Message-ID: <20221024210019.551e64ae@kernel.org> In-Reply-To: <20221021114711.1610797-1-junxiao.chang@intel.com> References: <20221021114711.1610797-1-junxiao.chang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Fri, 21 Oct 2022 19:47:10 +0800 Junxiao Chang wrote: > Macro like "#define abc(x) (x, x)" is unsafe which might introduce > side effects. Each MTL RxQ DMA channel mask is 4 bits, so using > (0xf << chan) instead of GENMASK(x + 3, x) to avoid unsafe macro. > > Fixes: d43042f4da3e ("net: stmmac: mapping mtl rx to dma channel") You need to point out an existing usage where this is causing problems, otherwise this is not a fix. And squash the two patches together, it's going to be easier to review.