* [PATCH] ptp: ptp_clock: Fix coding style issues
@ 2023-03-25 16:31 Shinu Chandran
2023-03-26 7:47 ` Bagas Sanjaya
2023-03-28 0:47 ` Jakub Kicinski
0 siblings, 2 replies; 4+ messages in thread
From: Shinu Chandran @ 2023-03-25 16:31 UTC (permalink / raw)
To: richardcochran; +Cc: netdev, linux-kernel, Shinu Chandran
Fixed coding style issues
Signed-off-by: Shinu Chandran <s4superuser@gmail.com>
---
drivers/ptp/ptp_clock.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
index 62d4d29e7c05..8fe7f2ce9705 100644
--- a/drivers/ptp/ptp_clock.c
+++ b/drivers/ptp/ptp_clock.c
@@ -129,6 +129,7 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct __kernel_timex *tx)
err = ops->adjtime(ops, delta);
} else if (tx->modes & ADJ_FREQUENCY) {
long ppb = scaled_ppm_to_ppb(tx->freq);
+
if (ppb > ops->max_adj || ppb < -ops->max_adj)
return -ERANGE;
err = ops->adjfine(ops, tx->freq);
@@ -278,11 +279,13 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
/* Register a new PPS source. */
if (info->pps) {
struct pps_source_info pps;
+
memset(&pps, 0, sizeof(pps));
snprintf(pps.name, PPS_MAX_NAME_LEN, "ptp%d", index);
pps.mode = PTP_PPS_MODE;
pps.owner = info->owner;
ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
+
if (IS_ERR(ptp->pps_source)) {
err = PTR_ERR(ptp->pps_source);
pr_err("failed to register pps source\n");
@@ -347,9 +350,8 @@ static int unregister_vclock(struct device *dev, void *data)
int ptp_clock_unregister(struct ptp_clock *ptp)
{
- if (ptp_vclock_in_use(ptp)) {
+ if (ptp_vclock_in_use(ptp))
device_for_each_child(&ptp->dev, NULL, unregister_vclock);
- }
ptp->defunct = 1;
wake_up_interruptible(&ptp->tsev_wq);
--
2.35.6
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ptp: ptp_clock: Fix coding style issues
2023-03-25 16:31 [PATCH] ptp: ptp_clock: Fix coding style issues Shinu Chandran
@ 2023-03-26 7:47 ` Bagas Sanjaya
2023-03-28 0:47 ` Jakub Kicinski
1 sibling, 0 replies; 4+ messages in thread
From: Bagas Sanjaya @ 2023-03-26 7:47 UTC (permalink / raw)
To: Shinu Chandran, richardcochran; +Cc: netdev, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1906 bytes --]
On Sat, Mar 25, 2023 at 10:01:35PM +0530, Shinu Chandran wrote:
> diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
> index 62d4d29e7c05..8fe7f2ce9705 100644
> --- a/drivers/ptp/ptp_clock.c
> +++ b/drivers/ptp/ptp_clock.c
> @@ -129,6 +129,7 @@ static int ptp_clock_adjtime(struct posix_clock *pc, struct __kernel_timex *tx)
> err = ops->adjtime(ops, delta);
> } else if (tx->modes & ADJ_FREQUENCY) {
> long ppb = scaled_ppm_to_ppb(tx->freq);
> +
> if (ppb > ops->max_adj || ppb < -ops->max_adj)
> return -ERANGE;
> err = ops->adjfine(ops, tx->freq);
> @@ -278,11 +279,13 @@ struct ptp_clock *ptp_clock_register(struct ptp_clock_info *info,
> /* Register a new PPS source. */
> if (info->pps) {
> struct pps_source_info pps;
> +
> memset(&pps, 0, sizeof(pps));
> snprintf(pps.name, PPS_MAX_NAME_LEN, "ptp%d", index);
> pps.mode = PTP_PPS_MODE;
> pps.owner = info->owner;
> ptp->pps_source = pps_register_source(&pps, PTP_PPS_DEFAULTS);
> +
> if (IS_ERR(ptp->pps_source)) {
> err = PTR_ERR(ptp->pps_source);
> pr_err("failed to register pps source\n");
> @@ -347,9 +350,8 @@ static int unregister_vclock(struct device *dev, void *data)
>
> int ptp_clock_unregister(struct ptp_clock *ptp)
> {
> - if (ptp_vclock_in_use(ptp)) {
> + if (ptp_vclock_in_use(ptp))
> device_for_each_child(&ptp->dev, NULL, unregister_vclock);
> - }
>
> ptp->defunct = 1;
> wake_up_interruptible(&ptp->tsev_wq);
Two style fixes in one patch (blank lines and braces). Please split
them into each individual patches in a series.
But hey, shouldn't checkpatch complain about one-line brace block?
And also, the patch subject should have been [PATCH net-next]
(targetting next Linux release) or [PATCH net] (targetting current
release).
Thanks!
--
An old man doll... just what I always wanted! - Clara
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ptp: ptp_clock: Fix coding style issues
2023-03-25 16:31 [PATCH] ptp: ptp_clock: Fix coding style issues Shinu Chandran
2023-03-26 7:47 ` Bagas Sanjaya
@ 2023-03-28 0:47 ` Jakub Kicinski
2023-03-28 3:29 ` Richard Cochran
1 sibling, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2023-03-28 0:47 UTC (permalink / raw)
To: Shinu Chandran; +Cc: richardcochran, netdev, linux-kernel
On Sat, 25 Mar 2023 22:01:35 +0530 Shinu Chandran wrote:
> Fixed coding style issues
If Richard acks we'll take it but as a general rule we try to avoid
taking pure formatting changes in networking. Too much churn.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ptp: ptp_clock: Fix coding style issues
2023-03-28 0:47 ` Jakub Kicinski
@ 2023-03-28 3:29 ` Richard Cochran
0 siblings, 0 replies; 4+ messages in thread
From: Richard Cochran @ 2023-03-28 3:29 UTC (permalink / raw)
To: Jakub Kicinski; +Cc: Shinu Chandran, netdev, linux-kernel
On Mon, Mar 27, 2023 at 05:47:46PM -0700, Jakub Kicinski wrote:
> On Sat, 25 Mar 2023 22:01:35 +0530 Shinu Chandran wrote:
> > Fixed coding style issues
>
> If Richard acks we'll take it but as a general rule we try to avoid
> taking pure formatting changes in networking. Too much churn.
Yeah its pointless churn.
NAK on this as the visual impression is not at all improved IMO.
Thanks,
Richard
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-03-28 3:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-25 16:31 [PATCH] ptp: ptp_clock: Fix coding style issues Shinu Chandran
2023-03-26 7:47 ` Bagas Sanjaya
2023-03-28 0:47 ` Jakub Kicinski
2023-03-28 3:29 ` Richard Cochran
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).