Skip to content

Commit

Permalink
ptp: fix format string mismatch in ptp_sysfs.c
Browse files Browse the repository at this point in the history
Fix format string mismatch in ptp_sysfs.c. Use %u for unsigned int.

Fixes: 73f3706 ("ptp: support ptp physical/virtual clocks conversion")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Yangbo Lu authored and David S. Miller committed Jul 5, 2021
1 parent 55eac20 commit f6a175c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/ptp/ptp_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ static ssize_t n_vclocks_show(struct device *dev,
if (mutex_lock_interruptible(&ptp->n_vclocks_mux))
return -ERESTARTSYS;

size = snprintf(page, PAGE_SIZE - 1, "%d\n", ptp->n_vclocks);
size = snprintf(page, PAGE_SIZE - 1, "%u\n", ptp->n_vclocks);

mutex_unlock(&ptp->n_vclocks_mux);

Expand Down Expand Up @@ -252,7 +252,7 @@ static ssize_t max_vclocks_show(struct device *dev,
struct ptp_clock *ptp = dev_get_drvdata(dev);
ssize_t size;

size = snprintf(page, PAGE_SIZE - 1, "%d\n", ptp->max_vclocks);
size = snprintf(page, PAGE_SIZE - 1, "%u\n", ptp->max_vclocks);

return size;
}
Expand Down

0 comments on commit f6a175c

Please sign in to comment.