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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8B786C04A95 for ; Tue, 25 Oct 2022 04:01:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=qTgyUHNIPqjm3YE3DtwVyFnMxCZQtlCnyBkbzV8P4KE=; b=NlUTjlep5bV7Vw TtTlTx2auwds3XGtORs/+UIcmMObqrrP0XvNzFggmso1NeXLil1rGFj3HdPBgE4Q7isDlb4O/sOty pueyhVcaucanLJ6Rs0Oq4PXdpoDcnNCV7GlPptsi9Mlq0AMEO4UyGUde0WYHvXQV4D5jW+rIxNiJa z6l/du6qh34FieM0VyVng0ObpcOQTJ4B0O0vB02RDDfreo6x2y5tfuU8bVr5VuXsjgxrXXa3E8KQG n2hLDSOu2dP2ubPKH9UcUTYLvpqcIxWjU7ZlybNJzo1gAdlRNJyjmqVzlSdp2gg6dj/2+9UU4V09o rx58H0csdh1flGA5aCeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1onB78-003mHi-3S; Tue, 25 Oct 2022 04:00:30 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onB75-003mHM-1v for linux-arm-kernel@lists.infradead.org; Tue, 25 Oct 2022 04:00:28 +0000 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 ams.source.kernel.org (Postfix) with ESMTPS id 5E401B8068D; Tue, 25 Oct 2022 04:00:22 +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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221024_210027_271740_CA1622D9 X-CRM114-Status: UNSURE ( 9.24 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7D5CC04A95 for ; Tue, 25 Oct 2022 04:00:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230436AbiJYEA3 (ORCPT ); Tue, 25 Oct 2022 00:00:29 -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 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.