Message ID | 1400518318-12386-2-git-send-email-manuel.schoelling@gmx.de |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
On Mon, 2014-05-19 at 18:51 +0200, Manuel Schölling wrote: > To be future-proof and for better readability the time comparisons are modified > to use time_is_before_jiffies() instead of plain, error-prone math. Hi again Manuel. Just a couple of FYIs/nits: The "net: " prefix in your patch subject is a little misleading. One reading might be that the patch is to the net/ subsystem but it's for a driver. It might be better as: [PATCH] vxge: Use time_is_before_jiffies Generally, just use the last directory name for the subject prefix. ie: patching: foo/bar/baz/qux.c subject prefix is generally: [PATCH] baz: whatever changed... and a single patch to a number of different files in foo/bar/baz/*.[ch] is still [PATCH] baz: etc... Also, the time_is_(before|after)_jiffies variants are not used particularly often in the kernel. The form using of time_<foo>(jiffies, ...) is used _far_ more often (and it saves a little typing too). time_before(<foo>, jiffies) time_is_before_jiffies(<foo>) $ git grep -E -w "time_is_(before|after|before_eq|after_eq)_jiffies" | wc -l 93 $ git grep -E "\btime_(before|after|before_eq|after_eq)+\s*\(.*jiffies" | wc -l 1695 <shrug> Maybe there's some reading clarity using the time_is_(before|after)_jiffies variants. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Thanks for your hints. I tried to incorporate your points into this new version. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c index d107bcb..79f42db 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c @@ -2122,7 +2122,7 @@ static int vxge_open_vpaths(struct vxgedev *vdev) static void adaptive_coalesce_tx_interrupts(struct vxge_fifo *fifo) { fifo->interrupt_count++; - if (jiffies > fifo->jiffies + HZ / 100) { + if (time_is_before_jiffies(fifo->jiffies + HZ / 100)) { struct __vxge_hw_fifo *hw_fifo = fifo->handle; fifo->jiffies = jiffies; @@ -2150,7 +2150,7 @@ static void adaptive_coalesce_tx_interrupts(struct vxge_fifo *fifo) static void adaptive_coalesce_rx_interrupts(struct vxge_ring *ring) { ring->interrupt_count++; - if (jiffies > ring->jiffies + HZ / 100) { + if (time_is_before_jiffies(ring->jiffies + HZ / 100)) { struct __vxge_hw_ring *hw_ring = ring->handle; ring->jiffies = jiffies;
To be future-proof and for better readability the time comparisons are modified to use time_is_before_jiffies() instead of plain, error-prone math. Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de> --- drivers/net/ethernet/neterion/vxge/vxge-main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)