Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1146323lqh; Sun, 5 May 2024 19:40:38 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXCGKdxGblw/fIMpCu2t/JVif1TSQA4NLFlZMKmZf31UinNpGPYgFleUGhlNsiEKLwl1iSulESD8ZlQ1jV0C58edkP/BfhIJLNIGkNbBg== X-Google-Smtp-Source: AGHT+IF7PFTgahQ1uGbTe7fmIHhW5skLicVulxpaG20p3psF/wHSvJ/+n8buwr/Vkvt/P/q0B8Ar X-Received: by 2002:a05:6a20:3c8e:b0:1af:5195:d035 with SMTP id b14-20020a056a203c8e00b001af5195d035mr8477966pzj.45.1714963238533; Sun, 05 May 2024 19:40:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714963238; cv=pass; d=google.com; s=arc-20160816; b=gf3bJykhx1vzLXkGmhvude6Kzry79jp9B2RGavin1NC6fsFswkHiAxHW8qoITqxy1G nInJYT3axX1ru2wPDb2PiG6bSrb/82UfSLba8lw6OF4Igv9kQBTwq5ZTXuhxFBLsq0P2 pejQSqAg+qs0I/K+Rzm4HjTwCVLwcLK9N8xOB0Jg1dN0tZTMzMFDSlrBZXxgMTtGzPxd P9ioOw0fEZti0YBZjWCvVyhkXB2xwSJxdtIkbMoDg5QxoGInh6i5ZVstblB7z4OuynhC 1f2DtbzFRSDVkQ3AHR3dmguaeC4fZdeV5BTwRSL1lBhcd7kBoQRO+bgVZ7j0swX69KzX locg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=SzoPvxCdbarJkibdx6K1x8lN0F8qOJ97Q/gf1WBFL3c=; fh=rEC4aapC2LucXJ6P9SkySMGTK56J8mEZwHGsaMwF2/U=; b=FPgNNCbaj1KitXqhhONqv+vfUdTPnW2uL/jNM73HavFaoAx2ROD4BsPUvyZ33ZrG5w 8G03q/qfMptr7HrBACBPYQph+kZeCLg/v1PVVT5E9jmKiq0Rd+QnSXYMDDb2JqnICirK UgyCxGnbhKnuSS2mJXvRUSH2kudGx4yxqrPSu0NhO/C4vAmRT0SLGkrpeZHZR6yulW2s b8WbxSd+OdtPsuxrqdG9ZK0g3/5C+oiPTzk87zpLLDCrGW+tNjESGraVVGcc+zvsfy5E Kf1puXUTyL9hzRX7VFribEScsP+wkMoKrR8inRchNeodslsVF3ZYzJxscay7LaC0O0Gi HU6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-169263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169263-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id p15-20020a170902780f00b001ed4504201csi5441284pll.447.2024.05.05.19.40.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 May 2024 19:40:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=realtek.com); spf=pass (google.com: domain of linux-kernel+bounces-169263-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169263-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 26202282664 for ; Mon, 6 May 2024 02:40:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E569A40855; Mon, 6 May 2024 02:40:30 +0000 (UTC) Received: from rtits2.realtek.com.tw (rtits2.realtek.com [211.75.126.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3AFA181; Mon, 6 May 2024 02:40:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=211.75.126.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714963230; cv=none; b=c8vRACyAJ6eXOWVy+ueTQuItpDqTC7x8pJv1WvYkp3uY2Y/kJYf+aykIIdnj4G2eoGAFgUM1w8itXviwtDaNSVnaLN7kDufnbmd++7H41yCiA88GKxA99K9+d6kbaczEqNK40mLSNGcAM2QXS4RG3GacUj05Gr/vZRj3aRf+2K0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714963230; c=relaxed/simple; bh=UzuvbpT59bSEfIj+CxmqYxw+cOAWIj3xILqoUieEs8k=; h=From:To:CC:Subject:Date:Message-ID:References:In-Reply-To: Content-Type:MIME-Version; b=aFhDg2nw1TLHJ6UP1dcLY/wO2WxReynQJwYr4Ow/nZ5eb5Rm+I+DsKD2l5mryXbAiVtBJWx5U0OnqTMCgqYgVmA5ml5bkvgSnDj35/0uSKqk7MbjDxUo7wAY5byWRlvu6CoCYHkjN8J7w23cMAnjObYHCzB9jrCCSKlukVNkkOE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com; spf=pass smtp.mailfrom=realtek.com; arc=none smtp.client-ip=211.75.126.72 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=realtek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=realtek.com X-SpamFilter-By: ArmorX SpamTrap 5.78 with qID 4462dq1tB1815379, This message is accepted by code: ctloc85258 Received: from mail.realtek.com (rtexh36506.realtek.com.tw[172.21.6.27]) by rtits2.realtek.com.tw (8.15.2/2.95/5.92) with ESMTPS id 4462dq1tB1815379 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 May 2024 10:39:52 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXH36506.realtek.com.tw (172.21.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 6 May 2024 10:39:53 +0800 Received: from RTEXMBS04.realtek.com.tw (172.21.6.97) by RTEXMBS04.realtek.com.tw (172.21.6.97) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Mon, 6 May 2024 10:39:50 +0800 Received: from RTEXMBS04.realtek.com.tw ([fe80::1a1:9ae3:e313:52e7]) by RTEXMBS04.realtek.com.tw ([fe80::1a1:9ae3:e313:52e7%5]) with mapi id 15.01.2507.035; Mon, 6 May 2024 10:39:50 +0800 From: Justin Lai To: Simon Horman CC: "kuba@kernel.org" , "davem@davemloft.net" , "edumazet@google.com" , "pabeni@redhat.com" , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "andrew@lunn.ch" , "jiri@resnulli.us" , Ping-Ke Shih , Larry Chiu Subject: RE: [PATCH net-next v17 02/13] rtase: Implement the .ndo_open function Thread-Topic: [PATCH net-next v17 02/13] rtase: Implement the .ndo_open function Thread-Index: AQHanHHZpNHx0voP+0CDD26jysJVP7GEr5aAgACdBfD//4djgIAEr/zg Date: Mon, 6 May 2024 02:39:50 +0000 Message-ID: <7d81d0f7a24a4349a53cd77f9e42ee4a@realtek.com> References: <20240502091847.65181-1-justinlai0215@realtek.com> <20240502091847.65181-3-justinlai0215@realtek.com> <20240503085257.GM2821784@kernel.org> <3199bfed19ad4e0bb8ca868b6c46588a@realtek.com> <20240503110315.GO2821784@kernel.org> In-Reply-To: <20240503110315.GO2821784@kernel.org> Accept-Language: zh-TW, en-US Content-Language: zh-TW Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 > On Fri, May 03, 2024 at 10:19:05AM +0000, Justin Lai wrote: > > > On Thu, May 02, 2024 at 05:18:36PM +0800, Justin Lai wrote: > > > > Implement the .ndo_open function to set default hardware settings > > > > and initialize the descriptor ring and interrupts. Among them, > > > > when requesting irq, because the first group of interrupts needs > > > > to process more events, the overall structure will be different > > > > from other groups of interrupts, so it needs to be processed separa= tely. > > > > > > > > Signed-off-by: Justin Lai > > > > > > Hi Justin, > > > > > > some minor feedback from my side. > > > > > > > +static int rtase_open(struct net_device *dev) { > > > > + struct rtase_private *tp =3D netdev_priv(dev); > > > > + struct rtase_int_vector *ivec =3D &tp->int_vector[0]; > > > > + const struct pci_dev *pdev =3D tp->pdev; > > > > + u16 i, j; > > > > + int ret; > > > > > > nit: please use reverse xmas tree order - longest line to shortest - > > > for local variable declarations in new Networking code. > > > > > Hi Simon, > > This is partly because ivec needs to use tp for initialization, so tp > > is placed in front of ivec, causing this situation. >=20 > Thanks Justin, >=20 > Understood. >=20 > Had I noticed that I probably wouldn't have commented as I did above. > But, FWIIW, in such cases my suggestion would be to separate the declarat= ion > from the assignment. >=20 > Something like this: >=20 > struct rtase_private *tp =3D netdev_priv(dev); > const struct pci_dev *pdev =3D tp->pdev; > struct rtase_int_vector *ivec; > u16 i, j; > int ret; >=20 > ivec =3D &tp->int_vector[0]; OK, I understand, thank you for your suggestion.