Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2209713iof; Tue, 7 Jun 2022 23:17:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwjCU1wfg9mcLx1hhbF7FF6L71G+5L97EqLRU4IL5fvOPVCH5GsojYWypnbWBtvkV05gQAL X-Received: by 2002:a17:903:1c2:b0:163:ef7b:e10f with SMTP id e2-20020a17090301c200b00163ef7be10fmr32280237plh.158.1654669036003; Tue, 07 Jun 2022 23:17:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654669035; cv=none; d=google.com; s=arc-20160816; b=cMS8ZI/51ef/m0yqHDFINb95+BDdJa+FWoSfrjseDJkjpiKOR867EJpTyee+2doeww VOhbRxmYd7/4yi715AQ37MlLV1vClGHBX7X93uoqLbotjmCgLp9kRPde39Mdycc6upQD N6bM1bGP4JvIrQNX+xPDdSmCBaY8BUsvPCrLx2ySDYB2mp45gAVc31oD16iCu4aS80YD k+jmxf5y60pfrNFQr0ztqDnX9CLEVURJmSQ4rW5YT3n0frv1/ikes9AqQJDb9K3hPjKl CEFg0LgNlLv07/uE7JyQYAZzHZbV8E14U6vTzOnkALoIHBogGB6B77aKMi3YUcfHjOCw KyvQ== 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=1A5md5SqiYav+mYyxWTMoxCkClJ/zkU3OgWnKqvDm3c=; b=OCitAzBVgkDrKSV0LbcEpWtULlRlXjl42LNPzM0lMrPIc4YnuiIs4JHtLYvKIobH9e tMbZ4tx+6c29lwHBNTxT908NtjfUR+BrDhMso7kzLkFrisqGhK1zecIENx81roLX+w0+ D5IZCiFJdOkfM6ghPdge4xS4xGeQa6CBfGO6xvEqZWZwr9AvvM1W7BsM9R5OxgvGd02J 2ZBwjpycl0Svjaey22w/8tJUuEsJq5lceJL4K61Y5r8Br7shFh+Vyjf+SCyj63Hn2eRA Sb4ujnLjpmA99it1ScnJW0Qn3CA8DB4b0SgNrf7zXMBOmqJkvngNN9urVFi8i9Ec+pNF qG2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N46ZeFPh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id d1-20020a63f241000000b003db238f2a93si28036783pgk.815.2022.06.07.23.17.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 23:17:15 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=N46ZeFPh; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6FA47374EF2; Tue, 7 Jun 2022 22:38:16 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1392410AbiFHB5t (ORCPT + 99 others); Tue, 7 Jun 2022 21:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1588539AbiFGXyq (ORCPT ); Tue, 7 Jun 2022 19:54:46 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83C3BFAA44; Tue, 7 Jun 2022 16:14:17 -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 ams.source.kernel.org (Postfix) with ESMTPS id 276E2B8245D; Tue, 7 Jun 2022 23:14:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 731DCC3411C; Tue, 7 Jun 2022 23:14:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654643654; bh=HyJ/pBoolQywSI16EFt/cD0D9gnRf8vXON8lajK+0hE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=N46ZeFPhZrGOntfcSegxbZEKFrqlAdTxHgD+gMoUPhPncHMM8uEGZOjxi8Q+V/f6O 4zZ+GBKyTQMIqokmuf0/1ole1b2h53PMkgRafFtzuETA3haeq2Vimi/g2/RuCBDwni Mlzp231tNQPOfvdCG0iv7epy1pIsqSMMTU+epl5bCcbJjGER99bnPsba1N+o5KNfrZ IloRN+j1Pm3t/VGnVKEdQonjrA0MJeCyex04r1iG3FGJl90OyNgi9y7Sc6x23DJcwv Jds7aHs+0vS1mnn+UjLgNNfKwqAhvAE1IT2X3D5C6zeuN0wgN2fMPqjaImlQbpa+ED PVBZJI+eQ/rBw== Date: Tue, 7 Jun 2022 16:14:13 -0700 From: Jakub Kicinski To: Chen Lin Cc: nbd@nbd.name, john@phrozen.org, sean.wang@mediatek.com, Mark-MC.Lee@mediatek.com, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, matthias.bgg@gmail.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, alexander.duyck@gmail.com Subject: Re: [PATCH v4] net: ethernet: mtk_eth_soc: fix misuse of mem alloc interface netdev[napi]_alloc_frag Message-ID: <20220607161413.655dd63f@kernel.org> In-Reply-To: <1654558751-3702-1-git-send-email-chen45464546@163.com> References: <20220606143437.25397f08@kernel.org> <1654558751-3702-1-git-send-email-chen45464546@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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, 7 Jun 2022 07:39:11 +0800 Chen Lin wrote: > +static inline void *mtk_max_lro_buf_alloc(gfp_t gfp_mask) No need for inline, compiler will inline this anyway. > +{ > + void *data; unsigned long data; then you can move the cast from the long line to the return statement, saving us from the strange indentation. > + data = (void *)__get_free_pages(gfp_mask | > + __GFP_COMP | __GFP_NOWARN, > + get_order(mtk_max_frag_size(MTK_MAX_LRO_RX_LENGTH))); > + > + return data; > +}