Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1609450pxb; Thu, 4 Mar 2021 16:15:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJwInDAGr5uH7jqyoVPy2udszQfhMqD/HDGsYNOrWMz7pFVd+wEpR7uH4F8WxdDR1cr+NFPZ X-Received: by 2002:a02:cd33:: with SMTP id h19mr6755498jaq.88.1614903342359; Thu, 04 Mar 2021 16:15:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614903342; cv=none; d=google.com; s=arc-20160816; b=Hj6N9NaqRRIjvt7gmtmN6uio9uQXKJ37lediXALXhXWq54HyjInplc8vuQAP7LeJRx ZRdEeOS2R4zC1bwyXwz28oJoG097qUHXAahopkYr48e/7jnWr3yvduDwEqR/K/ixTMCu m9FvHALR3+h63aXynWRjtwn6kk0Ft0vhTOv7MzJgPqHrVvO1HgKJhiim8byqiF3qmb3i tCUllK97YN6vFr1c/hrf8l/T+Ro8BwQK/LGyTCqBCbGT5XKmyC/oDGRxC0u8ulugADL+ OrkVmnv9DLldoEFF+OCzlxJdJER+xjDoa/2AZWLEfVipG0kaUapR6km/KLm8zlm2JPsn bvOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=dz4HVxPFRsN1cnfQpnjYobcM1PQp099TOEiThhLCLGc=; b=ueTL36GTkiZOQKVE7WaojUpFA4RJpgX7nLITHtOTsJh7Lu4zoYTBbNmZdvCV/CAOIc 4EbqOdwb8gXr/bW1+RRGJImavD0VqNxIi1fgulZEBwklBjrva0wTEn/BcKbh1hlJ32Xh rEvNlM8x1rLxzA+NXTF/U2RKM2QRgyYiZlEq5y4AwXnaP+hvtalc2V6W+X/94zKtHT4z Fp9X53L4kSSlXi5TkXFs2rtNlWLKgprOEXQVMtTTF/8t9Cf8ld3tqtocPqj/mDeoAMBy aytyZty8nieXWEj8qpkf0WWb7rvxZrMPfOzGQEgsS8EoSIxNzZnEbilSpcsMqkumy29L SHaA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u11si927373jai.48.2021.03.04.16.15.29; Thu, 04 Mar 2021 16:15:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234852AbhCDP1s (ORCPT + 99 others); Thu, 4 Mar 2021 10:27:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234864AbhCDP10 (ORCPT ); Thu, 4 Mar 2021 10:27:26 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 960DAC061760 for ; Thu, 4 Mar 2021 07:26:46 -0800 (PST) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lHprr-00015l-Vn; Thu, 04 Mar 2021 16:26:24 +0100 Received: from pengutronix.de (unknown [IPv6:2a03:f580:87bc:d400:3b3:61f5:ff65:ce3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id B552A5EDCD1; Thu, 4 Mar 2021 15:26:19 +0000 (UTC) Date: Thu, 4 Mar 2021 16:26:18 +0100 From: Marc Kleine-Budde To: Dario Binacchi Cc: linux-kernel@vger.kernel.org, Alexander Stein , Federico Vaga , "David S. Miller" , Jakub Kicinski , Oliver Hartkopp , Vincent Mailhol , Wolfgang Grandegger , YueHaibing , Zhang Qilong , linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH v4 5/6] can: c_can: prepare to up the message objects number Message-ID: <20210304152618.rqajqmzcqqhszfem@pengutronix.de> References: <20210302215435.18286-1-dariobin@libero.it> <20210302215435.18286-6-dariobin@libero.it> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="wgmmyfwmn76i5d4s" Content-Disposition: inline In-Reply-To: <20210302215435.18286-6-dariobin@libero.it> X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: mkl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --wgmmyfwmn76i5d4s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 02.03.2021 22:54:34, Dario Binacchi wrote: > diff --git a/drivers/net/can/c_can/c_can.c b/drivers/net/can/c_can/c_can.c > index 77b9aee56154..0052ba5197e0 100644 > --- a/drivers/net/can/c_can/c_can.c > +++ b/drivers/net/can/c_can/c_can.c [...] > -struct net_device *alloc_c_can_dev(void) > +struct net_device *alloc_c_can_dev(int msg_obj_num) > { > struct net_device *dev; > struct c_can_priv *priv; > + int msg_obj_tx_num =3D msg_obj_num / 2; > =20 > - dev =3D alloc_candev(sizeof(struct c_can_priv), C_CAN_MSG_OBJ_TX_NUM); > + dev =3D alloc_candev(sizeof(*priv) + sizeof(u32) * msg_obj_tx_num, > + msg_obj_tx_num); I've converted this to make use of the struct_size() macro: + dev =3D alloc_candev(struct_size(priv, dlc, msg_obj_tx_num), + msg_obj_tx_num); regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung West/Dortmund | Phone: +49-231-2826-924 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | --wgmmyfwmn76i5d4s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEK3kIWJt9yTYMP3ehqclaivrt76kFAmBA/BgACgkQqclaivrt 76m4zwgAny/+Z6viYUgp3sOUmSnJzENe19yvsk7JUDQ10FUvBTGDASIHY9qEg+Sn nJ1EDa8d37+SO7SYusaiogXzxV61vnZSmvfrzERCN8kH4jVRscNXd6tD12P04FDS 6Jj+Oks0+hYL0+9r8qzR9NPZzoxWqWbUyGk4tEnYFQ84LALZjmWpEeOv/ORKv6UI KJPTl1asXcVOj1gyq0AvAHaND0Ei+t2lmej5iA4dxxdi8dIt1nYq+tDo8IGl5jqa cPaP4jKopOHMaOgwYzpPieG4NXoBvai3XxfxjP+ZWUB70MU3YfP5JCn0m+tqAOsh bshqNyienPr57S0oyUuXkt9zikG61w== =LgIH -----END PGP SIGNATURE----- --wgmmyfwmn76i5d4s--