Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ef5ba4af authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'irda-next'



Chunyan Zhang says:

====================
irda: Use ktime_t instead of timeval

This patch-set removed all uses of timeval and used ktime_t instead if
needed, since 32-bit time types will break in the year 2038.

This patch-set also used the ktime_xxx functions accordingly.
e.g.
* Used ktime_get to get the current time instead of do_gettimeofday.
* And, used ktime_us_delta to get the elapsed time directly.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents f3cd7a26 497ec1f2
Loading
Loading
Loading
Loading
+3 −8
Original line number Original line Diff line number Diff line
@@ -1462,17 +1462,12 @@ static netdev_tx_t ali_ircc_fir_hard_xmit(struct sk_buff *skb,
		if (mtt) 
		if (mtt) 
		{
		{
			/* Check how much time we have used already */
			/* Check how much time we have used already */
			do_gettimeofday(&self->now);
			diff = ktime_us_delta(ktime_get(), self->stamp);
			
			diff = self->now.tv_usec - self->stamp.tv_usec;
			/* self->stamp is set from ali_ircc_dma_receive_complete() */
			/* self->stamp is set from ali_ircc_dma_receive_complete() */
							
							
			pr_debug("%s(), ******* diff = %d *******\n",
			pr_debug("%s(), ******* diff = %d *******\n",
				 __func__, diff);
				 __func__, diff);


			if (diff < 0) 
				diff += 1000000;
			
			/* Check if the mtt is larger than the time we have
			/* Check if the mtt is larger than the time we have
			 * already used by all the protocol processing
			 * already used by all the protocol processing
			 */
			 */
@@ -1884,7 +1879,7 @@ static int ali_ircc_dma_receive_complete(struct ali_ircc_cb *self)
			 * reduce the min turn time a bit since we will know
			 * reduce the min turn time a bit since we will know
			 * how much time we have used for protocol processing
			 * how much time we have used for protocol processing
			 */
			 */
			do_gettimeofday(&self->stamp);
			self->stamp = ktime_get();


			skb = dev_alloc_skb(len+1);
			skb = dev_alloc_skb(len+1);
			if (skb == NULL)  
			if (skb == NULL)  
+2 −3
Original line number Original line Diff line number Diff line
@@ -22,7 +22,7 @@
#ifndef ALI_IRCC_H
#ifndef ALI_IRCC_H
#define ALI_IRCC_H
#define ALI_IRCC_H


#include <linux/time.h>
#include <linux/ktime.h>


#include <linux/spinlock.h>
#include <linux/spinlock.h>
#include <linux/pm.h>
#include <linux/pm.h>
@@ -209,8 +209,7 @@ struct ali_ircc_cb {
	
	
	unsigned char rcvFramesOverflow;
	unsigned char rcvFramesOverflow;
		
		
	struct timeval stamp;
	ktime_t stamp;
	struct timeval now;


	spinlock_t lock;           /* For serializing operations */
	spinlock_t lock;           /* For serializing operations */
	
	
+0 −3
Original line number Original line Diff line number Diff line
@@ -24,7 +24,6 @@
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/types.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/ioport.h>


@@ -163,8 +162,6 @@ struct au1k_private {
	iobuff_t rx_buff;
	iobuff_t rx_buff;


	struct net_device *netdev;
	struct net_device *netdev;
	struct timeval stamp;
	struct timeval now;
	struct qos_info qos;
	struct qos_info qos;
	struct irlap_cb *irlap;
	struct irlap_cb *irlap;


+2 −8
Original line number Original line Diff line number Diff line
@@ -495,18 +495,12 @@ static netdev_tx_t irda_usb_hard_xmit(struct sk_buff *skb,
		mtt = irda_get_mtt(skb);
		mtt = irda_get_mtt(skb);
		if (mtt) {
		if (mtt) {
			int diff;
			int diff;
			do_gettimeofday(&self->now);
			diff = ktime_us_delta(ktime_get(), self->stamp);
			diff = self->now.tv_usec - self->stamp.tv_usec;
#ifdef IU_USB_MIN_RTT
#ifdef IU_USB_MIN_RTT
			/* Factor in USB delays -> Get rid of udelay() that
			/* Factor in USB delays -> Get rid of udelay() that
			 * would be lost in the noise - Jean II */
			 * would be lost in the noise - Jean II */
			diff += IU_USB_MIN_RTT;
			diff += IU_USB_MIN_RTT;
#endif /* IU_USB_MIN_RTT */
#endif /* IU_USB_MIN_RTT */
			/* If the usec counter did wraparound, the diff will
			 * go negative (tv_usec is a long), so we need to
			 * correct it by one second. Jean II */
			if (diff < 0)
				diff += 1000000;


		        /* Check if the mtt is larger than the time we have
		        /* Check if the mtt is larger than the time we have
			 * already used by all the protocol processing
			 * already used by all the protocol processing
@@ -869,7 +863,7 @@ static void irda_usb_receive(struct urb *urb)
	 * reduce the min turn time a bit since we will know
	 * reduce the min turn time a bit since we will know
	 * how much time we have used for protocol processing
	 * how much time we have used for protocol processing
	 */
	 */
        do_gettimeofday(&self->stamp);
	self->stamp = ktime_get();


	/* Check if we need to copy the data to a new skb or not.
	/* Check if we need to copy the data to a new skb or not.
	 * For most frames, we use ZeroCopy and pass the already
	 * For most frames, we use ZeroCopy and pass the already
+2 −3
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@
 *
 *
 *****************************************************************************/
 *****************************************************************************/


#include <linux/time.h>
#include <linux/ktime.h>


#include <net/irda/irda.h>
#include <net/irda/irda.h>
#include <net/irda/irda_device.h>      /* struct irlap_cb */
#include <net/irda/irda_device.h>      /* struct irlap_cb */
@@ -157,8 +157,7 @@ struct irda_usb_cb {
	char *speed_buff;		/* Buffer for speed changes */
	char *speed_buff;		/* Buffer for speed changes */
	char *tx_buff;
	char *tx_buff;


	struct timeval stamp;
	ktime_t stamp;
	struct timeval now;


	spinlock_t lock;		/* For serializing Tx operations */
	spinlock_t lock;		/* For serializing Tx operations */


Loading