[PATCH] Cleanup: replace prefered with preferred

Mark Salyzyn salyzyn at android.com
Tue Oct 22 21:41:45 UTC 2019


Replace all occurrences of prefered with preferred to make future
checkpatch.pl's happy.  A few places the incorrect spelling is
matched with the correct spelling to preserve existing user space API.

Signed-off-by: Mark Salyzyn <salyzyn at android.com>
---
 Documentation/networking/ip-sysctl.txt        |   2 +-
 .../firmware/efi/libstub/efi-stub-helper.c    |   2 +-
 .../gpu/drm/amd/display/dc/inc/compressor.h   |   4 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.c           |   2 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_kms.h           |   2 +-
 drivers/media/usb/uvc/uvc_video.c             |   6 +-
 fs/nfs/nfs4xdr.c                              |   2 +-
 include/linux/ipv6.h                          |   2 +-
 include/net/addrconf.h                        |   4 +-
 include/net/if_inet6.h                        |   2 +-
 include/net/ndisc.h                           |   8 +-
 include/uapi/linux/if_addr.h                  |   5 +-
 include/uapi/linux/ipv6.h                     |   4 +-
 include/uapi/linux/sysctl.h                   |   4 +-
 include/uapi/linux/usb/video.h                |   5 +-
 kernel/sysctl_binary.c                        |   3 +-
 net/6lowpan/ndisc.c                           |   4 +-
 net/ipv4/devinet.c                            |  20 ++--
 net/ipv6/addrconf.c                           | 113 ++++++++++--------
 19 files changed, 112 insertions(+), 82 deletions(-)

diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index 49e95f438ed7..eab3d20fc016 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -1792,7 +1792,7 @@ temp_valid_lft - INTEGER
 	valid lifetime (in seconds) for temporary addresses.
 	Default: 604800 (7 days)
 
-temp_prefered_lft - INTEGER
+temp_preferred_lft - INTEGER
 	Preferred lifetime (in seconds) for temporary addresses.
 	Default: 86400 (1 day)
 
diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c
index 3caae7f2cf56..0b0ae3844a8f 100644
--- a/drivers/firmware/efi/libstub/efi-stub-helper.c
+++ b/drivers/firmware/efi/libstub/efi-stub-helper.c
@@ -717,7 +717,7 @@ efi_status_t efi_relocate_kernel(efi_system_table_t *sys_table_arg,
 	 * The EFI firmware loader could have placed the kernel image
 	 * anywhere in memory, but the kernel has restrictions on the
 	 * max physical address it can run at.  Some architectures
-	 * also have a prefered address, so first try to relocate
+	 * also have a preferred address, so first try to relocate
 	 * to the preferred address.  If that fails, allocate as low
 	 * as possible while respecting the required alignment.
 	 */
diff --git a/drivers/gpu/drm/amd/display/dc/inc/compressor.h b/drivers/gpu/drm/amd/display/dc/inc/compressor.h
index 7a147a9762a0..a8448f8e85d6 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/compressor.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/compressor.h
@@ -126,9 +126,9 @@ struct fbc_requested_compressed_size {
 	unsigned int   min_size_alignment;
 	union {
 		struct {
-			/* Above preferedSize must be allocated in FB pool */
+			/* Above preferred_size must be allocated in FB pool */
 			unsigned int preferred_must_be_framebuffer_pool : 1;
-			/* Above minSize must be allocated in FB pool */
+			/* Above min_size must be allocated in FB pool */
 			unsigned int min_must_be_framebuffer_pool : 1;
 		} bits;
 		unsigned int flags;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
index f47d5710cc95..c8ac6968221a 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
@@ -2306,7 +2306,7 @@ int vmw_du_connector_fill_modes(struct drm_connector *connector,
 	}
 
 	drm_connector_list_update(connector);
-	/* Move the prefered mode first, help apps pick the right mode. */
+	/* Move the preferred mode first, help apps pick the right mode. */
 	drm_mode_sort(&connector->modes);
 
 	return 1;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
index 3ee03227607c..335d9484e28f 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.h
@@ -355,7 +355,7 @@ struct vmw_display_unit {
 	unsigned unit;
 
 	/*
-	 * Prefered mode tracking.
+	 * Preferred mode tracking.
 	 */
 	unsigned pref_width;
 	unsigned pref_height;
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c
index 8fa77a81dd7f..0096e6aacdb4 100644
--- a/drivers/media/usb/uvc/uvc_video.c
+++ b/drivers/media/usb/uvc/uvc_video.c
@@ -276,13 +276,13 @@ static int uvc_get_video_ctrl(struct uvc_streaming *stream,
 	if (size >= 34) {
 		ctrl->dwClockFrequency = get_unaligned_le32(&data[26]);
 		ctrl->bmFramingInfo = data[30];
-		ctrl->bPreferedVersion = data[31];
+		ctrl->bPreferredVersion = data[31];
 		ctrl->bMinVersion = data[32];
 		ctrl->bMaxVersion = data[33];
 	} else {
 		ctrl->dwClockFrequency = stream->dev->clock_frequency;
 		ctrl->bmFramingInfo = 0;
-		ctrl->bPreferedVersion = 0;
+		ctrl->bPreferredVersion = 0;
 		ctrl->bMinVersion = 0;
 		ctrl->bMaxVersion = 0;
 	}
@@ -325,7 +325,7 @@ static int uvc_set_video_ctrl(struct uvc_streaming *stream,
 	if (size >= 34) {
 		put_unaligned_le32(ctrl->dwClockFrequency, &data[26]);
 		data[30] = ctrl->bmFramingInfo;
-		data[31] = ctrl->bPreferedVersion;
+		data[31] = ctrl->bPreferredVersion;
 		data[32] = ctrl->bMinVersion;
 		data[33] = ctrl->bMaxVersion;
 	}
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index ab07db0f07cd..4befb5a40218 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -4768,7 +4768,7 @@ static int decode_attr_pnfstype(struct xdr_stream *xdr, uint32_t *bitmap,
 }
 
 /*
- * The prefered block size for layout directed io
+ * The preferred block size for layout directed io
  */
 static int decode_attr_layout_blksize(struct xdr_stream *xdr, uint32_t *bitmap,
 				      uint32_t *res)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index ea7c7906591e..5d0fc10e9842 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -26,7 +26,7 @@ struct ipv6_devconf {
 	__s32		mldv2_unsolicited_report_interval;
 	__s32		use_tempaddr;
 	__s32		temp_valid_lft;
-	__s32		temp_prefered_lft;
+	__s32		temp_preferred_lft;
 	__s32		regen_max_retry;
 	__s32		max_desync_factor;
 	__s32		max_addresses;
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 3f62b347b04a..754b16f7fd03 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -43,7 +43,7 @@ struct prefix_info {
 #error "Please fix <asm/byteorder.h>"
 #endif
 	__be32			valid;
-	__be32			prefered;
+	__be32			preferred;
 	__be32			reserved2;
 
 	struct in6_addr		prefix;
@@ -121,7 +121,7 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
 				 struct inet6_dev *in6_dev,
 				 const struct in6_addr *addr, int addr_type,
 				 u32 addr_flags, bool sllao, bool tokenized,
-				 __u32 valid_lft, u32 prefered_lft);
+				 __u32 valid_lft, u32 preferred_lft);
 
 static inline void addrconf_addr_eui48_base(u8 *eui, const char *const addr)
 {
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index a01981d7108f..9055b024d439 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -41,7 +41,7 @@ struct inet6_ifaddr {
 
 	/* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
 	__u32			valid_lft;
-	__u32			prefered_lft;
+	__u32			preferred_lft;
 	refcount_t		refcnt;
 	spinlock_t		lock;
 
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index b2f715ca0567..9791347f30e4 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -189,7 +189,7 @@ void __ndisc_fill_addr_option(struct sk_buff *skb, int type, void *data,
  *			       struct in6_addr *addr,
  *			       int addr_type, u32 addr_flags,
  *			       bool sllao, bool tokenized,
- *			       __u32 valid_lft, u32 prefered_lft,
+ *			       __u32 valid_lft, u32 preferred_lft,
  *			       bool dev_addr_generated):
  *     This function is called when a RA messages is received with valid
  *     PIO option fields and an IPv6 address will be added to the interface
@@ -218,7 +218,7 @@ struct ndisc_ops {
 				       struct in6_addr *addr,
 				       int addr_type, u32 addr_flags,
 				       bool sllao, bool tokenized,
-				       __u32 valid_lft, u32 prefered_lft,
+				       __u32 valid_lft, u32 preferred_lft,
 				       bool dev_addr_generated);
 };
 
@@ -298,7 +298,7 @@ static inline void ndisc_ops_prefix_rcv_add_addr(struct net *net,
 						 int addr_type, u32 addr_flags,
 						 bool sllao, bool tokenized,
 						 __u32 valid_lft,
-						 u32 prefered_lft,
+						 u32 preferred_lft,
 						 bool dev_addr_generated)
 {
 	if (dev->ndisc_ops && dev->ndisc_ops->prefix_rcv_add_addr)
@@ -306,7 +306,7 @@ static inline void ndisc_ops_prefix_rcv_add_addr(struct net *net,
 						    addr, addr_type,
 						    addr_flags, sllao,
 						    tokenized, valid_lft,
-						    prefered_lft,
+						    preferred_lft,
 						    dev_addr_generated);
 }
 #endif
diff --git a/include/uapi/linux/if_addr.h b/include/uapi/linux/if_addr.h
index dfcf3ce0097f..7ad3fbe110c0 100644
--- a/include/uapi/linux/if_addr.h
+++ b/include/uapi/linux/if_addr.h
@@ -57,7 +57,10 @@ enum {
 #define IFA_F_STABLE_PRIVACY	0x800
 
 struct ifa_cacheinfo {
-	__u32	ifa_prefered;
+	union {
+		__u32	ifa_preferred;
+		__u32	ifa_prefered __attribute__((deprecated)); /* NOTYPO */
+	} __attribute__((packed));
 	__u32	ifa_valid;
 	__u32	cstamp; /* created timestamp, hundredths of seconds */
 	__u32	tstamp; /* updated timestamp, hundredths of seconds */
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h
index 9c0f4a92bcff..04d0ddefc32c 100644
--- a/include/uapi/linux/ipv6.h
+++ b/include/uapi/linux/ipv6.h
@@ -148,7 +148,9 @@ enum {
 	DEVCONF_RTR_SOLICIT_DELAY,
 	DEVCONF_USE_TEMPADDR,
 	DEVCONF_TEMP_VALID_LFT,
-	DEVCONF_TEMP_PREFERED_LFT,
+	DEVCONF_TEMP_PREFERRED_LFT,
+	DEVCONF_TEMP_PREFERED_LFT __attribute__((deprecated)) = /* NOTYPO */
+		DEVCONF_TEMP_PREFERRED_LFT,
 	DEVCONF_REGEN_MAX_RETRY,
 	DEVCONF_MAX_DESYNC_FACTOR,
 	DEVCONF_MAX_ADDRESSES,
diff --git a/include/uapi/linux/sysctl.h b/include/uapi/linux/sysctl.h
index 87aa2a6d9125..f76993d874fe 100644
--- a/include/uapi/linux/sysctl.h
+++ b/include/uapi/linux/sysctl.h
@@ -557,7 +557,9 @@ enum {
 	NET_IPV6_RTR_SOLICIT_DELAY=10,
 	NET_IPV6_USE_TEMPADDR=11,
 	NET_IPV6_TEMP_VALID_LFT=12,
-	NET_IPV6_TEMP_PREFERED_LFT=13,
+	NET_IPV6_TEMP_PREFERRED_LFT = 13,
+	NET_IPV6_TEMP_PREFERED_LFT __attribute__((deprecated)) = /* NOTYPO */
+		NET_IPV6_TEMP_PREFERRED_LFT,
 	NET_IPV6_REGEN_MAX_RETRY=14,
 	NET_IPV6_MAX_DESYNC_FACTOR=15,
 	NET_IPV6_MAX_ADDRESSES=16,
diff --git a/include/uapi/linux/usb/video.h b/include/uapi/linux/usb/video.h
index d854cb19c42c..59167f0ed5c1 100644
--- a/include/uapi/linux/usb/video.h
+++ b/include/uapi/linux/usb/video.h
@@ -448,7 +448,10 @@ struct uvc_streaming_control {
 	__u32 dwMaxPayloadTransferSize;
 	__u32 dwClockFrequency;
 	__u8  bmFramingInfo;
-	__u8  bPreferedVersion;
+	union {
+		__u8 bPreferredVersion;
+		__u8 bPreferedVersion __attribute__((deprecated)); /* NOTYPO */
+	} __attribute__((__packed__));
 	__u8  bMinVersion;
 	__u8  bMaxVersion;
 } __attribute__((__packed__));
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c
index 73c132095a7b..78c4f363c84b 100644
--- a/kernel/sysctl_binary.c
+++ b/kernel/sysctl_binary.c
@@ -513,7 +513,8 @@ static const struct bin_table bin_net_ipv6_conf_var_table[] = {
 	{ CTL_INT,	NET_IPV6_RTR_SOLICIT_DELAY,		"router_solicitation_delay" },
 	{ CTL_INT,	NET_IPV6_USE_TEMPADDR,			"use_tempaddr" },
 	{ CTL_INT,	NET_IPV6_TEMP_VALID_LFT,		"temp_valid_lft" },
-	{ CTL_INT,	NET_IPV6_TEMP_PREFERED_LFT,		"temp_prefered_lft" },
+	{ CTL_INT,	NET_IPV6_TEMP_PREFERRED_LFT,		"temp_preferred_lft" },
+	{ CTL_INT,	NET_IPV6_TEMP_PREFERRED_LFT,		"temp_prefered_lft" }, /* NOTYPO */
 	{ CTL_INT,	NET_IPV6_REGEN_MAX_RETRY,		"regen_max_retry" },
 	{ CTL_INT,	NET_IPV6_MAX_DESYNC_FACTOR,		"max_desync_factor" },
 	{ CTL_INT,	NET_IPV6_MAX_ADDRESSES,			"max_addresses" },
diff --git a/net/6lowpan/ndisc.c b/net/6lowpan/ndisc.c
index 16be8f8b2f8c..467f2b492772 100644
--- a/net/6lowpan/ndisc.c
+++ b/net/6lowpan/ndisc.c
@@ -201,7 +201,7 @@ static void lowpan_ndisc_prefix_rcv_add_addr(struct net *net,
 					     int addr_type, u32 addr_flags,
 					     bool sllao, bool tokenized,
 					     __u32 valid_lft,
-					     u32 prefered_lft,
+					     u32 preferred_lft,
 					     bool dev_addr_generated)
 {
 	int err;
@@ -212,7 +212,7 @@ static void lowpan_ndisc_prefix_rcv_add_addr(struct net *net,
 		err = addrconf_prefix_rcv_add_addr(net, dev, pinfo, in6_dev,
 						   addr, addr_type, addr_flags,
 						   sllao, tokenized, valid_lft,
-						   prefered_lft);
+						   preferred_lft);
 		if (err)
 			ND_PRINTK(2, warn,
 				  "RA: could not add a short address based address for prefix: %pI6c\n",
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
index a4b5bd4d2c89..d20ce5648e37 100644
--- a/net/ipv4/devinet.c
+++ b/net/ipv4/devinet.c
@@ -790,7 +790,7 @@ static void check_lifetime(struct work_struct *work)
 }
 
 static void set_ifa_lifetime(struct in_ifaddr *ifa, __u32 valid_lft,
-			     __u32 prefered_lft)
+			     __u32 preferred_lft)
 {
 	unsigned long timeout;
 
@@ -802,7 +802,7 @@ static void set_ifa_lifetime(struct in_ifaddr *ifa, __u32 valid_lft,
 	else
 		ifa->ifa_flags |= IFA_F_PERMANENT;
 
-	timeout = addrconf_timeout_fixup(prefered_lft, HZ);
+	timeout = addrconf_timeout_fixup(preferred_lft, HZ);
 	if (addrconf_finite_timeout(timeout)) {
 		if (timeout == 0)
 			ifa->ifa_flags |= IFA_F_DEPRECATED;
@@ -814,7 +814,7 @@ static void set_ifa_lifetime(struct in_ifaddr *ifa, __u32 valid_lft,
 }
 
 static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh,
-				       __u32 *pvalid_lft, __u32 *pprefered_lft,
+				       __u32 *pvalid_lft, __u32 *ppreferred_lft,
 				       struct netlink_ext_ack *extack)
 {
 	struct nlattr *tb[IFA_MAX+1];
@@ -885,12 +885,12 @@ static struct in_ifaddr *rtm_to_ifaddr(struct net *net, struct nlmsghdr *nlh,
 		struct ifa_cacheinfo *ci;
 
 		ci = nla_data(tb[IFA_CACHEINFO]);
-		if (!ci->ifa_valid || ci->ifa_prefered > ci->ifa_valid) {
+		if (!ci->ifa_valid || ci->ifa_preferred > ci->ifa_valid) {
 			err = -EINVAL;
 			goto errout_free;
 		}
 		*pvalid_lft = ci->ifa_valid;
-		*pprefered_lft = ci->ifa_prefered;
+		*ppreferred_lft = ci->ifa_preferred;
 	}
 
 	return ifa;
@@ -925,11 +925,11 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct in_ifaddr *ifa;
 	struct in_ifaddr *ifa_existing;
 	__u32 valid_lft = INFINITY_LIFE_TIME;
-	__u32 prefered_lft = INFINITY_LIFE_TIME;
+	__u32 preferred_lft = INFINITY_LIFE_TIME;
 
 	ASSERT_RTNL();
 
-	ifa = rtm_to_ifaddr(net, nlh, &valid_lft, &prefered_lft, extack);
+	ifa = rtm_to_ifaddr(net, nlh, &valid_lft, &preferred_lft, extack);
 	if (IS_ERR(ifa))
 		return PTR_ERR(ifa);
 
@@ -938,7 +938,7 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
 		/* It would be best to check for !NLM_F_CREATE here but
 		 * userspace already relies on not having to provide this.
 		 */
-		set_ifa_lifetime(ifa, valid_lft, prefered_lft);
+		set_ifa_lifetime(ifa, valid_lft, preferred_lft);
 		if (ifa->ifa_flags & IFA_F_MCAUTOJOIN) {
 			int ret = ip_mc_config(net->ipv4.mc_autojoin_sk,
 					       true, ifa);
@@ -965,7 +965,7 @@ static int inet_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
 			ifa->ifa_rt_priority = new_metric;
 		}
 
-		set_ifa_lifetime(ifa, valid_lft, prefered_lft);
+		set_ifa_lifetime(ifa, valid_lft, preferred_lft);
 		cancel_delayed_work(&check_lifetime_work);
 		queue_delayed_work(system_power_efficient_wq,
 				&check_lifetime_work, 0);
@@ -1639,7 +1639,7 @@ static int put_cacheinfo(struct sk_buff *skb, unsigned long cstamp,
 
 	ci.cstamp = cstamp_delta(cstamp);
 	ci.tstamp = cstamp_delta(tstamp);
-	ci.ifa_prefered = preferred;
+	ci.ifa_preferred = preferred;
 	ci.ifa_valid = valid;
 
 	return nla_put(skb, IFA_CACHEINFO, sizeof(ci), &ci);
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
index 34ccef18b40e..00813e251c28 100644
--- a/net/ipv6/addrconf.c
+++ b/net/ipv6/addrconf.c
@@ -201,7 +201,7 @@ static struct ipv6_devconf ipv6_devconf __read_mostly = {
 	.rtr_solicit_delay	= MAX_RTR_SOLICITATION_DELAY,
 	.use_tempaddr		= 0,
 	.temp_valid_lft		= TEMP_VALID_LIFETIME,
-	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
+	.temp_preferred_lft	= TEMP_PREFERRED_LIFETIME,
 	.regen_max_retry	= REGEN_MAX_RETRY,
 	.max_desync_factor	= MAX_DESYNC_FACTOR,
 	.max_addresses		= IPV6_MAX_ADDRESSES,
@@ -255,7 +255,7 @@ static struct ipv6_devconf ipv6_devconf_dflt __read_mostly = {
 	.rtr_solicit_delay	= MAX_RTR_SOLICITATION_DELAY,
 	.use_tempaddr		= 0,
 	.temp_valid_lft		= TEMP_VALID_LIFETIME,
-	.temp_prefered_lft	= TEMP_PREFERRED_LIFETIME,
+	.temp_preferred_lft	= TEMP_PREFERRED_LIFETIME,
 	.regen_max_retry	= REGEN_MAX_RETRY,
 	.max_desync_factor	= MAX_DESYNC_FACTOR,
 	.max_addresses		= IPV6_MAX_ADDRESSES,
@@ -1112,7 +1112,7 @@ ipv6_add_addr(struct inet6_dev *idev, struct ifa6_config *cfg,
 	if (!(cfg->ifa_flags & IFA_F_NODAD))
 		ifa->flags |= IFA_F_TENTATIVE;
 	ifa->valid_lft = cfg->valid_lft;
-	ifa->prefered_lft = cfg->preferred_lft;
+	ifa->preferred_lft = cfg->preferred_lft;
 	ifa->cstamp = ifa->tstamp = jiffies;
 	ifa->tokenized = false;
 
@@ -1358,7 +1358,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp,
 	/* recalculate max_desync_factor each time and update
 	 * idev->desync_factor if it's larger
 	 */
-	cnf_temp_preferred_lft = READ_ONCE(idev->cnf.temp_prefered_lft);
+	cnf_temp_preferred_lft = READ_ONCE(idev->cnf.temp_preferred_lft);
 	max_desync_factor = min_t(__u32,
 				  idev->cnf.max_desync_factor,
 				  cnf_temp_preferred_lft - regen_advance);
@@ -1377,7 +1377,7 @@ static int ipv6_create_tempaddr(struct inet6_ifaddr *ifp,
 	cfg.valid_lft = min_t(__u32, ifp->valid_lft,
 			      idev->cnf.temp_valid_lft + age);
 	cfg.preferred_lft = cnf_temp_preferred_lft + age - idev->desync_factor;
-	cfg.preferred_lft = min_t(__u32, ifp->prefered_lft, cfg.preferred_lft);
+	cfg.preferred_lft = min_t(__u32, ifp->preferred_lft, cfg.preferred_lft);
 
 	cfg.plen = ifp->prefix_len;
 	tmp_tstamp = ifp->tstamp;
@@ -2087,7 +2087,7 @@ void addrconf_dad_failure(struct sk_buff *skb, struct inet6_ifaddr *ifp)
 			.plen = ifp->prefix_len,
 			.ifa_flags = ifp->flags,
 			.valid_lft = ifp->valid_lft,
-			.preferred_lft = ifp->prefered_lft,
+			.preferred_lft = ifp->preferred_lft,
 			.scope = ifp->scope,
 		};
 
@@ -2481,7 +2481,7 @@ static struct inet6_dev *addrconf_add_dev(struct net_device *dev)
 
 static void manage_tempaddrs(struct inet6_dev *idev,
 			     struct inet6_ifaddr *ifp,
-			     __u32 valid_lft, __u32 prefered_lft,
+			     __u32 valid_lft, __u32 preferred_lft,
 			     bool create, unsigned long now)
 {
 	u32 flags;
@@ -2490,7 +2490,7 @@ static void manage_tempaddrs(struct inet6_dev *idev,
 	read_lock_bh(&idev->lock);
 	/* update all temporary addresses in the list */
 	list_for_each_entry(ift, &idev->tempaddr_list, tmp_list) {
-		int age, max_valid, max_prefered;
+		int age, max_valid, max_preferred;
 
 		if (ifp != ift->ifpub)
 			continue;
@@ -2508,23 +2508,23 @@ static void manage_tempaddrs(struct inet6_dev *idev,
 		if (max_valid < 0)
 			max_valid = 0;
 
-		max_prefered = idev->cnf.temp_prefered_lft -
-			       idev->desync_factor - age;
-		if (max_prefered < 0)
-			max_prefered = 0;
+		max_preferred = idev->cnf.temp_preferred_lft -
+				idev->desync_factor - age;
+		if (max_preferred < 0)
+			max_preferred = 0;
 
 		if (valid_lft > max_valid)
 			valid_lft = max_valid;
 
-		if (prefered_lft > max_prefered)
-			prefered_lft = max_prefered;
+		if (preferred_lft > max_preferred)
+			preferred_lft = max_preferred;
 
 		spin_lock(&ift->lock);
 		flags = ift->flags;
 		ift->valid_lft = valid_lft;
-		ift->prefered_lft = prefered_lft;
+		ift->preferred_lft = preferred_lft;
 		ift->tstamp = now;
-		if (prefered_lft > 0)
+		if (preferred_lft > 0)
 			ift->flags &= ~IFA_F_DEPRECATED;
 
 		spin_unlock(&ift->lock);
@@ -2557,7 +2557,7 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
 				 struct inet6_dev *in6_dev,
 				 const struct in6_addr *addr, int addr_type,
 				 u32 addr_flags, bool sllao, bool tokenized,
-				 __u32 valid_lft, u32 prefered_lft)
+				 __u32 valid_lft, u32 preferred_lft)
 {
 	struct inet6_ifaddr *ifp = ipv6_get_ifaddr(net, addr, dev, 1);
 	int create = 0, update_lft = 0;
@@ -2569,7 +2569,7 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
 			.plen = pinfo->prefix_len,
 			.ifa_flags = addr_flags,
 			.valid_lft = valid_lft,
-			.preferred_lft = prefered_lft,
+			.preferred_lft = preferred_lft,
 			.scope = addr_type & IPV6_ADDR_SCOPE_MASK,
 		};
 
@@ -2624,14 +2624,14 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
 			 *  whether the valid lifetime is also reset or
 			 *  ignored."
 			 *
-			 * So we should always update prefered_lft here.
+			 * So we should always update preferred_lft here.
 			 */
 			update_lft = 1;
 		}
 
 		if (update_lft) {
 			ifp->valid_lft = valid_lft;
-			ifp->prefered_lft = prefered_lft;
+			ifp->preferred_lft = preferred_lft;
 			ifp->tstamp = now;
 			flags = ifp->flags;
 			ifp->flags &= ~IFA_F_DEPRECATED;
@@ -2642,7 +2642,7 @@ int addrconf_prefix_rcv_add_addr(struct net *net, struct net_device *dev,
 		} else
 			spin_unlock_bh(&ifp->lock);
 
-		manage_tempaddrs(in6_dev, ifp, valid_lft, prefered_lft,
+		manage_tempaddrs(in6_dev, ifp, valid_lft, preferred_lft,
 				 create, now);
 
 		in6_ifa_put(ifp);
@@ -2657,7 +2657,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
 {
 	struct prefix_info *pinfo;
 	__u32 valid_lft;
-	__u32 prefered_lft;
+	__u32 preferred_lft;
 	int addr_type, err;
 	u32 addr_flags = 0;
 	struct inet6_dev *in6_dev;
@@ -2680,9 +2680,9 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
 		return;
 
 	valid_lft = ntohl(pinfo->valid);
-	prefered_lft = ntohl(pinfo->prefered);
+	preferred_lft = ntohl(pinfo->preferred);
 
-	if (prefered_lft > valid_lft) {
+	if (preferred_lft > valid_lft) {
 		net_warn_ratelimited("addrconf: prefix option has invalid lifetime\n");
 		return;
 	}
@@ -2787,7 +2787,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
 						   &addr, addr_type,
 						   addr_flags, sllao,
 						   tokenized, valid_lft,
-						   prefered_lft);
+						   preferred_lft);
 		if (err)
 			goto put;
 
@@ -2797,7 +2797,7 @@ void addrconf_prefix_rcv(struct net_device *dev, u8 *opt, int len, bool sllao)
 		ndisc_ops_prefix_rcv_add_addr(net, dev, pinfo, in6_dev, &addr,
 					      addr_type, addr_flags, sllao,
 					      tokenized, valid_lft,
-					      prefered_lft,
+					      preferred_lft,
 					      dev_addr_generated);
 	}
 	inet6_prefix_notify(RTM_NEWPREFIX, in6_dev, pinfo);
@@ -4422,7 +4422,7 @@ static void addrconf_verify_rtnl(void)
 			 * IFA_F_PERMANENT has a non-infinity life time.
 			 */
 			if ((ifp->flags & IFA_F_PERMANENT) &&
-			    (ifp->prefered_lft == INFINITY_LIFE_TIME))
+			    (ifp->preferred_lft == INFINITY_LIFE_TIME))
 				continue;
 
 			spin_lock(&ifp->lock);
@@ -4435,11 +4435,13 @@ static void addrconf_verify_rtnl(void)
 				in6_ifa_hold(ifp);
 				ipv6_del_addr(ifp);
 				goto restart;
-			} else if (ifp->prefered_lft == INFINITY_LIFE_TIME) {
+			} else if (ifp->preferred_lft == INFINITY_LIFE_TIME) {
 				spin_unlock(&ifp->lock);
 				continue;
-			} else if (age >= ifp->prefered_lft) {
-				/* jiffies - ifp->tstamp > age >= ifp->prefered_lft */
+			} else if (age >= ifp->preferred_lft) {
+				/* jiffies - ifp->tstamp > age >=
+				 *	ifp->preferred_lft
+				 */
 				int deprecate = 0;
 
 				if (!(ifp->flags&IFA_F_DEPRECATED)) {
@@ -4466,10 +4468,13 @@ static void addrconf_verify_rtnl(void)
 					ifp->idev->cnf.dad_transmits *
 					NEIGH_VAR(ifp->idev->nd_parms, RETRANS_TIME) / HZ;
 
-				if (age >= ifp->prefered_lft - regen_advance) {
+				if (age >= ifp->preferred_lft - regen_advance) {
 					struct inet6_ifaddr *ifpub = ifp->ifpub;
-					if (time_before(ifp->tstamp + ifp->prefered_lft * HZ, next))
-						next = ifp->tstamp + ifp->prefered_lft * HZ;
+					if (time_before(ifp->tstamp +
+							ifp->preferred_lft * HZ,
+							next))
+						next = ifp->tstamp +
+						       ifp->preferred_lft * HZ;
 					if (!ifp->regen_count && ifpub) {
 						ifp->regen_count++;
 						in6_ifa_hold(ifp);
@@ -4486,13 +4491,20 @@ static void addrconf_verify_rtnl(void)
 						rcu_read_lock_bh();
 						goto restart;
 					}
-				} else if (time_before(ifp->tstamp + ifp->prefered_lft * HZ - regen_advance * HZ, next))
-					next = ifp->tstamp + ifp->prefered_lft * HZ - regen_advance * HZ;
+				} else if (time_before(ifp->tstamp +
+						       ifp->preferred_lft * HZ -
+						       regen_advance * HZ,
+						       next))
+					next = ifp->tstamp +
+					       ifp->preferred_lft * HZ -
+					       regen_advance * HZ;
 				spin_unlock(&ifp->lock);
 			} else {
-				/* ifp->prefered_lft <= ifp->valid_lft */
-				if (time_before(ifp->tstamp + ifp->prefered_lft * HZ, next))
-					next = ifp->tstamp + ifp->prefered_lft * HZ;
+				/* ifp->preferred_lft <= ifp->valid_lft */
+				if (time_before(ifp->tstamp +
+						ifp->preferred_lft * HZ, next))
+					next = ifp->tstamp +
+					       ifp->preferred_lft * HZ;
 				spin_unlock(&ifp->lock);
 			}
 		}
@@ -4665,7 +4677,7 @@ static int inet6_addr_modify(struct inet6_ifaddr *ifp, struct ifa6_config *cfg)
 	ifp->flags |= cfg->ifa_flags;
 	ifp->tstamp = jiffies;
 	ifp->valid_lft = cfg->valid_lft;
-	ifp->prefered_lft = cfg->preferred_lft;
+	ifp->preferred_lft = cfg->preferred_lft;
 
 	if (cfg->rt_priority && cfg->rt_priority != ifp->rt_priority)
 		ifp->rt_priority = cfg->rt_priority;
@@ -4755,7 +4767,7 @@ inet6_rtm_newaddr(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 		ci = nla_data(tb[IFA_CACHEINFO]);
 		cfg.valid_lft = ci->ifa_valid;
-		cfg.preferred_lft = ci->ifa_prefered;
+		cfg.preferred_lft = ci->ifa_preferred;
 	}
 
 	dev =  __dev_get_by_index(net, ifm->ifa_index);
@@ -4825,7 +4837,7 @@ static int put_cacheinfo(struct sk_buff *skb, unsigned long cstamp,
 
 	ci.cstamp = cstamp_delta(cstamp);
 	ci.tstamp = cstamp_delta(tstamp);
-	ci.ifa_prefered = preferred;
+	ci.ifa_preferred = preferred;
 	ci.ifa_valid = valid;
 
 	return nla_put(skb, IFA_CACHEINFO, sizeof(ci), &ci);
@@ -4888,8 +4900,8 @@ static int inet6_fill_ifaddr(struct sk_buff *skb, struct inet6_ifaddr *ifa,
 		goto error;
 
 	if (!((ifa->flags&IFA_F_PERMANENT) &&
-	      (ifa->prefered_lft == INFINITY_LIFE_TIME))) {
-		preferred = ifa->prefered_lft;
+	      (ifa->preferred_lft == INFINITY_LIFE_TIME))) {
+		preferred = ifa->preferred_lft;
 		valid = ifa->valid_lft;
 		if (preferred != INFINITY_LIFE_TIME) {
 			long tval = (jiffies - ifa->tstamp)/HZ;
@@ -5394,7 +5406,7 @@ static inline void ipv6_store_devconf(struct ipv6_devconf *cnf,
 		jiffies_to_msecs(cnf->mldv2_unsolicited_report_interval);
 	array[DEVCONF_USE_TEMPADDR] = cnf->use_tempaddr;
 	array[DEVCONF_TEMP_VALID_LFT] = cnf->temp_valid_lft;
-	array[DEVCONF_TEMP_PREFERED_LFT] = cnf->temp_prefered_lft;
+	array[DEVCONF_TEMP_PREFERRED_LFT] = cnf->temp_preferred_lft;
 	array[DEVCONF_REGEN_MAX_RETRY] = cnf->regen_max_retry;
 	array[DEVCONF_MAX_DESYNC_FACTOR] = cnf->max_desync_factor;
 	array[DEVCONF_MAX_ADDRESSES] = cnf->max_addresses;
@@ -5644,7 +5656,7 @@ static int inet6_set_iftoken(struct inet6_dev *idev, struct in6_addr *token)
 		spin_lock(&ifp->lock);
 		if (ifp->tokenized) {
 			ifp->valid_lft = 0;
-			ifp->prefered_lft = 0;
+			ifp->preferred_lft = 0;
 		}
 		spin_unlock(&ifp->lock);
 	}
@@ -5915,7 +5927,7 @@ static int inet6_fill_prefix(struct sk_buff *skb, struct inet6_dev *idev,
 
 	if (nla_put(skb, PREFIX_ADDRESS, sizeof(pinfo->prefix), &pinfo->prefix))
 		goto nla_put_failure;
-	ci.preferred_time = ntohl(pinfo->prefered);
+	ci.preferred_time = ntohl(pinfo->preferred);
 	ci.valid_time = ntohl(pinfo->valid);
 	if (nla_put(skb, PREFIX_CACHEINFO, sizeof(ci), &ci))
 		goto nla_put_failure;
@@ -6561,8 +6573,15 @@ static const struct ctl_table addrconf_sysctl[] = {
 		.proc_handler	= proc_dointvec,
 	},
 	{
+		.procname	= "temp_preferred_lft",
+		.data		= &ipv6_devconf.temp_preferred_lft,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= proc_dointvec,
+	},
+	{ /* DEPRECATED */
 		.procname	= "temp_prefered_lft",
-		.data		= &ipv6_devconf.temp_prefered_lft,
+		.data		= &ipv6_devconf.temp_preferred_lft,
 		.maxlen		= sizeof(int),
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec,
-- 
2.23.0.866.gb869b98d4c-goog



More information about the amd-gfx mailing list