netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: netdev@vger.kernel.org, davem@davemloft.net, kuba@kernel.org,
	linux-can@vger.kernel.org, kernel@pengutronix.de,
	Frank Jungclaus <frank.jungclaus@esd.eu>,
	Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
Subject: Re: [PATCH net-next 04/33] can: esd_usb: Replace initializer macros used for struct can_bittiming_const
Date: Thu, 22 Jun 2023 09:05:24 +0200	[thread overview]
Message-ID: <ZJPytAFaG3UFaw3i@corigine.com> (raw)
In-Reply-To: <20230621132914.412546-5-mkl@pengutronix.de>

On Wed, Jun 21, 2023 at 03:28:45PM +0200, Marc Kleine-Budde wrote:
> From: Frank Jungclaus <frank.jungclaus@esd.eu>
> 
> Replace the macros used to initialize the members of struct
> can_bittiming_const with direct values. Then also use those struct
> members to do the calculations in esd_usb2_set_bittiming().
> 
> Link: https://lore.kernel.org/all/CAMZ6RqLaDNy-fZ2G0+QMhUEckkXLL+ZyELVSDFmqpd++aBzZQg@mail.gmail.com/
> Suggested-by: Vincent MAILHOL <mailhol.vincent@wanadoo.fr>
> Signed-off-by: Frank Jungclaus <frank.jungclaus@esd.eu>
> Link: https://lore.kernel.org/r/20230519195600.420644-3-frank.jungclaus@esd.eu
> [mkl: esd_usb2_set_bittiming() use esd_usb_2_bittiming_const instead of priv->can.bittiming_const]
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>

...

> @@ -909,18 +901,19 @@ static const struct ethtool_ops esd_usb_ethtool_ops = {
>  
>  static const struct can_bittiming_const esd_usb2_bittiming_const = {
>  	.name = "esd_usb2",
> -	.tseg1_min = ESD_USB2_TSEG1_MIN,
> -	.tseg1_max = ESD_USB2_TSEG1_MAX,
> -	.tseg2_min = ESD_USB2_TSEG2_MIN,
> -	.tseg2_max = ESD_USB2_TSEG2_MAX,
> -	.sjw_max = ESD_USB2_SJW_MAX,
> -	.brp_min = ESD_USB2_BRP_MIN,
> -	.brp_max = ESD_USB2_BRP_MAX,
> -	.brp_inc = ESD_USB2_BRP_INC,
> +	.tseg1_min = 1,
> +	.tseg1_max = 16,
> +	.tseg2_min = 1,
> +	.tseg2_max = 8,
> +	.sjw_max = 4,
> +	.brp_min = 1,
> +	.brp_max = 1024,
> +	.brp_inc = 1,
>  };
>  
>  static int esd_usb2_set_bittiming(struct net_device *netdev)
>  {
> +	const struct can_bittiming_const *btc = &esd_usb_2_bittiming_const;
>  	struct esd_usb_net_priv *priv = netdev_priv(netdev);
>  	struct can_bittiming *bt = &priv->can.bittiming;
>  	union esd_usb_msg *msg;

Hi Marc and Frank,

it seems that something might have got mixed up here,
because GCC complains that:

 drivers/net/can/usb/esd_usb.c:916:43: error: use of undeclared identifier 'esd_usb_2_bittiming_const'; did you mean 'esd_usb2_bittiming_const'?
         const struct can_bittiming_const *btc = &esd_usb_2_bittiming_const;
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~
                                                  esd_usb2_bittiming_const
 drivers/net/can/usb/esd_usb.c:902:41: note: 'esd_usb2_bittiming_const' declared here
 static const struct can_bittiming_const esd_usb2_bittiming_const = {
                                        ^
-- 
pw-bot: changes-requested


  reply	other threads:[~2023-06-22  7:05 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-21 13:28 [PATCH net-next 0/33] pull-request: can-next 2023-06-21 Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 01/33] can: kvaser_usb: Add len8_dlc support Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 02/33] can: dev: add transceiver capabilities to xilinx_can Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 03/33] can: esd_usb: Make use of existing kernel macros Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 04/33] can: esd_usb: Replace initializer macros used for struct can_bittiming_const Marc Kleine-Budde
2023-06-22  7:05   ` Simon Horman [this message]
2023-06-22  7:15     ` Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 05/33] can: esd_usb: Use consistent prefixes for macros Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 06/33] can: esd_usb: Prefix all structures with the device name Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 07/33] can: esd_usb: Replace hardcoded message length given to USB commands Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 08/33] can: esd_usb: Don't bother the user with nonessential log message Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 09/33] can: m_can: fix coding style Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 10/33] can: esd_usb: Make use of kernel macros BIT() and GENMASK() Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 11/33] can: esd_usb: Use consistent prefix ESD_USB_ for macros Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 12/33] can: sja1000: Prepare the use of a threaded handler Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 13/33] can: sja1000: Prevent overrun stalls with a soft reset on Renesas SoCs Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 14/33] can: rx-offload: fix coding style Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 15/33] can: ti_hecc: " Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 16/33] can: length: fix bitstuffing count Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 17/33] can: length: fix description of the RRS field Marc Kleine-Budde
2023-06-21 13:28 ` [PATCH net-next 18/33] can: length: refactor frame lengths definition to add size in bits Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 19/33] can: uapi: move CAN_RAW_FILTER_MAX definition to raw.h Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 20/33] can: kvaser_pciefd: Remove useless write to interrupt register Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 21/33] can: kvaser_pciefd: Remove handler for unused KVASER_PCIEFD_PACK_TYPE_EFRAME_ACK Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 22/33] can: kvaser_pciefd: Add function to set skb hwtstamps Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 23/33] can: kvaser_pciefd: Set hardware timestamp on transmitted packets Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 24/33] can: kvaser_pciefd: Define unsigned constants with type suffix 'U' Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 25/33] can: kvaser_pciefd: Remove SPI flash parameter read functionality Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 26/33] can: kvaser_pciefd: Sort includes in alphabetic order Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 27/33] can: kvaser_pciefd: Rename device ID defines Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 28/33] can: kvaser_pciefd: Change return type for kvaser_pciefd_{receive,transmit,set_tx}_irq() Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 29/33] can: kvaser_pciefd: Sort register definitions Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 30/33] can: kvaser_pciefd: Use FIELD_{GET,PREP} and GENMASK where appropriate Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 31/33] can: kvaser_pciefd: Add len8_dlc support Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 32/33] can: kvaser_pciefd: Refactor code Marc Kleine-Budde
2023-06-21 13:29 ` [PATCH net-next 33/33] can: kvaser_pciefd: Use TX FIFO size read from CAN controller Marc Kleine-Budde
2023-06-22  8:30 ` [PATCH net-next 0/33] pull-request: can-next 2023-06-21 Marc Kleine-Budde
  -- strict thread matches above, loose matches on Subject: below --
2023-06-22  8:26 [PATCH net-next 0/33] pull-request: can-next 2023-06-22 Marc Kleine-Budde
2023-06-22  8:26 ` [PATCH net-next 04/33] can: esd_usb: Replace initializer macros used for struct can_bittiming_const Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZJPytAFaG3UFaw3i@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=davem@davemloft.net \
    --cc=frank.jungclaus@esd.eu \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol.vincent@wanadoo.fr \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).