Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp10059102rwr; Fri, 12 May 2023 03:15:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ74x5g8cy5i5vg2PR2I0FUrF7KcGo+/330odF9+ORw1ZBebO+8VrL4cBS2FcNnXMMETPqGq X-Received: by 2002:a17:902:e5cf:b0:1ac:807b:deb1 with SMTP id u15-20020a170902e5cf00b001ac807bdeb1mr19096294plf.38.1683886537226; Fri, 12 May 2023 03:15:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683886537; cv=none; d=google.com; s=arc-20160816; b=fNLyUiccDZkwP994/VmZqqu7gvQjpUe/U0GPa7XAIbm/QvkxTGm39bc59p3dnqQHBx WvKpOkz/NAtnXd3h+brIBroBiiPfQamsNd+izg17BXzod5nvdoA3A58EcsE9aQ8cuwNf gFAFLOLrtC0kOOQNYNwRq+DOFe4gwHa/efihv/zGFGaEpt7Hv+tdCLO0bVdb5C/pCZSW 8W9mk1gvCWEvKY9MiE71SaXXCAUiow5N6z3RYA1Y4hOXr79QnTTh/YsmRhunUUe/ArZR W/NzOp6usj+nIp5+JK5FIya2BgWoL8m23lYxC9H2TRgJ5caD7vzrJa6dSCzUSQBU5mwI ZCIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=R5FsU0vvdQKuTXYmnQb/fKvraHaaia5fjLFwaOpzG0E=; b=kyiBuUW/9mFzYWN1n4ZI0UpwENjd46KL8Bp0pjsLG7nLh+e+Ubs5sow5kP/6xaKwRW 6tUu9VPN8B5kjxtJTYp0i8BgZhKOqJZ1KhcTqGwt51tsxqkZpy40qRSItKBajkeUOb1r AURgWl/8a0pX6FiwHmoRRWmY0qVcgJJBK2Z6h5jaQ8cQS5ZXtcSOg0G09tvlpHdHZ8bJ vwyYDmOuHqUjRuFZ68hKpfAN9W/nUO+5QMfebN6Ik/KdG6iKt0xtKZFcEP73lRs1ri72 HwMxJhdg6nrxZ5oPk0vk7wJmA/kiR9ThTkJb33Bi35IuaisOy//oBrS8j2KG9fdlTeAc 62Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=gKopIC0E; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a170902758500b001ab02f505efsi8442759pll.82.2023.05.12.03.15.22; Fri, 12 May 2023 03:15:37 -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=@gmail.com header.s=20221208 header.b=gKopIC0E; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240540AbjELKNs (ORCPT + 99 others); Fri, 12 May 2023 06:13:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240477AbjELKNk (ORCPT ); Fri, 12 May 2023 06:13:40 -0400 Received: from mail-pf1-x42e.google.com (mail-pf1-x42e.google.com [IPv6:2607:f8b0:4864:20::42e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CA7F124B3; Fri, 12 May 2023 03:13:10 -0700 (PDT) Received: by mail-pf1-x42e.google.com with SMTP id d2e1a72fcca58-6436e075166so7343994b3a.0; Fri, 12 May 2023 03:13:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683886389; x=1686478389; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=R5FsU0vvdQKuTXYmnQb/fKvraHaaia5fjLFwaOpzG0E=; b=gKopIC0Ejr48prllIgxRsCQpmc0UCbbE0J/p/JeQsDMnu5wwSkuLm5jJtN1x3aGEHv cf/5UKnsMWXmF6gZVZ+1xrR4MF5siAKKTPM4lWwCFJJAUPO7ksT5n1CrW+5m0aS2PlxF MAZ8nUhFUZMvni4AqwbBF9Jmmm1x2iyqIC8dSyT3L/n+7EbqeYDhib4olC/n92hzcJKv /y2ORWqodoipIrbSefE3VXRIy+6mkZNWtncp7U/YqsfphOV+nTpwnSPklWexR7tq7zoe kpH5gAqmvw2mDopFV+Qf9i8LfdeNgSJgEIOmGLtQH4ULyL2YbHojZOKrVZIIQ35q9gbu YsDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683886389; x=1686478389; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=R5FsU0vvdQKuTXYmnQb/fKvraHaaia5fjLFwaOpzG0E=; b=ApJizOSo4R2YLf9H/e9uZUIK5z1Yyur0o6/2H6M7ID/lZG+0oC/jmyVY7kwbf4S2YE LuEQPxTJ7a5+GV4We6iHbyeOV15W6AhzAfcdni8VhEKOHIr1jcwrpdQfqTlgJ5SoHqke M41FQlCjozLdQxeO5W/0tRcBNuXnLil7EhL4yWE1Y4Xy5W0t4JDvTyZhsnmDqGs4rXIk 3Ra5tNFz0JzrlMhXldIv8TQ4TfZNm4mYYaBdip83+fXSO9blXRu6LumbhyTYygOxRpq2 815Ua99v9N3FK9oNn+0etje/db725wgPIUy4QKYGaSEvsA1OBh/QFPhNgJ4XUIsPs+6v 1DpQ== X-Gm-Message-State: AC+VfDyHWjJKNOjOCM8k7jIOlcpqpGoNd1v2p/Fck4U0G+7HztWqCNu+ mlLc5LBe7G80o6RBerDB0BxWpcYAqliQJUMUduM= X-Received: by 2002:a05:6a00:248d:b0:626:29ed:941f with SMTP id c13-20020a056a00248d00b0062629ed941fmr33453173pfv.5.1683886388780; Fri, 12 May 2023 03:13:08 -0700 (PDT) MIME-Version: 1.0 References: <20230511151444.162882-1-Mikhail.Golubev-Ciuchea@opensynergy.com> In-Reply-To: From: Vincent Mailhol Date: Fri, 12 May 2023 19:12:57 +0900 Message-ID: Subject: Re: [RFC PATCH v3] can: virtio: Initial virtio CAN driver. To: Simon Horman Cc: Mikhail Golubev-Ciuchea , virtio-dev@lists.oasis-open.org, linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Wolfgang Grandegger , Marc Kleine-Budde , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , "Michael S . Tsirkin" , Jason Wang , Damir Shaikhutdinov , Harald Mommer Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Hi Simon, On Fri. 12 May 2023 at 00:45, Simon Horman wrote: > On Thu, May 11, 2023 at 05:14:44PM +0200, Mikhail Golubev-Ciuchea wrote: [...] > > +static u8 virtio_can_send_ctrl_msg(struct net_device *ndev, u16 msg_type) > > +{ > > + struct virtio_can_priv *priv = netdev_priv(ndev); > > + struct device *dev = &priv->vdev->dev; > > + struct virtqueue *vq = priv->vqs[VIRTIO_CAN_QUEUE_CONTROL]; > > + struct scatterlist sg_out[1]; > > + struct scatterlist sg_in[1]; > > + struct scatterlist *sgs[2]; > > + int err; > > + unsigned int len; > > nit: For networking code please arrange local variables in reverse xmas > tree order - longest line to shortest. Sorry for my curiosity, but where is it documented that the networking code is using reverse christmas tree style? I already inquired in the past here: https://lore.kernel.org/linux-can/CAMZ6Rq+zsC4F-mNhjKvqgPQuLhnnX1y79J=qOT8szPvkHY86VQ@mail.gmail.com/ but did not get an answer. > You can check this using: https://github.com/ecree-solarflare/xmastree If we have to check for that, then please have this patch revived and merged: https://lore.kernel.org/lkml/1478242438.1924.31.camel@perches.com/ Personally, I am not willing to apply an out of tree linter for one single use case. > In this case I think it would be: > > struct virtio_can_priv *priv = netdev_priv(ndev); > struct device *dev = &priv->vdev->dev; > struct scatterlist sg_out[1]; > struct scatterlist sg_in[1]; > struct scatterlist *sgs[2]; > struct virtqueue *vq; > unsigned int len; > int err; > > vq = priv->vqs[VIRTIO_CAN_QUEUE_CONTROL];