lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZJPytAFaG3UFaw3i@corigine.com>
Date: Thu, 22 Jun 2023 09:05:24 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Marc Kleine-Budde <mkl@...gutronix.de>
Cc: netdev@...r.kernel.org, davem@...emloft.net, kuba@...nel.org,
	linux-can@...r.kernel.org, kernel@...gutronix.de,
	Frank Jungclaus <frank.jungclaus@....eu>,
	Vincent MAILHOL <mailhol.vincent@...adoo.fr>
Subject: Re: [PATCH net-next 04/33] can: esd_usb: Replace initializer macros
 used for struct can_bittiming_const

On Wed, Jun 21, 2023 at 03:28:45PM +0200, Marc Kleine-Budde wrote:
> From: Frank Jungclaus <frank.jungclaus@....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@...adoo.fr>
> Signed-off-by: Frank Jungclaus <frank.jungclaus@....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@...gutronix.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ