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]
Date:   Sun, 29 Jan 2017 16:35:36 +0100
From:   Richard Cochran <richardcochran@...il.com>
To:     Sudarsana Kalluru <Sudarsana.Kalluru@...ium.com>
Cc:     davem@...emloft.net, netdev@...r.kernel.org, Yuval.Mintz@...ium.com
Subject: Re: [PATCH net-next v2 2/2] qede: Add driver support for PTP.

On Sat, Jan 28, 2017 at 11:28:23PM -0800, Sudarsana Kalluru wrote:
> +/**
> + * qede_ptp_adjfreq
> + * @ptp: the ptp clock structure
> + * @ppb: parts per billion adjustment from base
> + *
> + * Adjust the frequency of the ptp cycle counter by the
> + * indicated ppb from the base frequency.
> + */
> +static int qede_ptp_adjfreq(struct ptp_clock_info *info, s32 ppb)
> +{
> +	struct qede_ptp *ptp = container_of(info, struct qede_ptp, clock_info);
> +	struct qede_dev *edev = ptp->edev;
> +	int rc;
> +
> +	__qede_lock(edev);
> +	if (edev->state == QEDE_STATE_OPEN) {
> +		spin_lock_bh(&ptp->lock);
> +		rc = ptp->ops->adjfreq(edev->cdev, ppb);

Why add this extra layer of indirection?

You could put these this test into qed_ptp_hw_adjfreq() and register
that function directly.

> +		spin_unlock_bh(&ptp->lock);
> +	} else {
> +		DP_ERR(edev, "PTP adjfreq called while interface is down\n");
> +		return -EFAULT;
> +	}
> +	__qede_unlock(edev);
> +
> +	return rc;
> +}

Thanks,
Richard

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ