Re: [PATCH net-next 04/33] can: esd_usb: Replace initializer macros used for struct can_bittiming_const

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 21, 2023 at 03:28:45PM +0200, Marc Kleine-Budde wrote:
> From: Frank Jungclaus <frank.jungclaus@xxxxxx>
> 
> 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@xxxxxxxxxxxxxx/
> Suggested-by: Vincent MAILHOL <mailhol.vincent@xxxxxxxxxx>
> Signed-off-by: Frank Jungclaus <frank.jungclaus@xxxxxx>
> Link: https://lore.kernel.org/r/20230519195600.420644-3-frank.jungclaus@xxxxxx
> [mkl: esd_usb2_set_bittiming() use esd_usb_2_bittiming_const instead of priv->can.bittiming_const]
> Signed-off-by: Marc Kleine-Budde <mkl@xxxxxxxxxxxxxx>

...

> @@ -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




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux