Re: [PATCH] mm:Make the function zap_huge_pmd bool

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2015-07-02 12:08 PM, nick wrote:
> 
> 
> On 2015-07-02 12:03 PM, Theodore Ts'o wrote:
>> On Thu, Jul 02, 2015 at 09:26:21AM +0200, Michal Hocko wrote:
>>> On Wed 01-07-15 14:27:57, Nicholas Krause wrote:
>>>> This makes the function zap_huge_pmd have a return type of bool
>>>> now due to this particular function always returning one or zero
>>>> as its return value.
>>>
>>> How does this help anything? IMO this just generates a pointless churn
>>> in the code without a good reason.
>>
>> Hi Michal,
>>
>> My recommendation is to ignore patches sent by Nick.  In my experience
>> he doesn't understand code before trying to make mechanical changes,
>> and very few of his patches add any new value, and at least one that
>> he tried to send me just 2 weeks or so ago (cherry-picked to try to
>> "prove" why he had turned over a new leaf, so that I would support the
>> removal of his e-mail address from being blacklisted on
>> vger.kernel.org) was buggy, and when I asked him some basic questions
>> about what the code was doing, it was clear he had no clue how the
>> seq_file abstraction worked.  This didn't stop him from trying to
>> patch the code, and if he had tested it, it would have crashed and
>> burned instantly.
>>
>> Of course, do whatevery you want, but IMHO it's not really not worth
>> your time to deal with his patches, and if you reply, most people
>> won't see his original e-mail since the vger.kernel.org blacklist is
>> still in effect.
>>
>> Regards,
>>
>> 						- Ted
>>
> Ted,
> I looked into that patch further and would were correct it was wrong.
> However here is a bug fix for the drm driver code that somebody else
> stated was right but haven gotten a reply to from the maintainer and
> have tried resending.
> Nick
> From 2d2ddb5d9a2c4fcbae45339d4f775fcde49f36e1 Mon Sep 17 00:00:00 2001
> From: Nicholas Krause <xerofoify@xxxxxxxxx>
> Date: Wed, 13 May 2015 21:36:44 -0400
> Subject: [PATCH 1/2] gma500:Add proper use of the variable ret for the
>  function, psb_mmu_inset_pfn_sequence
> 
> This adds proper use of the variable ret by returning it
> at the end of the function, psb_mmu_inset_pfn_sequence for
> indicating to callers when an error has occurred. Further
> more remove the unneeded double setting of ret to the error
> code, -ENOMEM after checking if a call to the function,
> psb_mmu_pt_alloc_map_lock is successful.
> 
> Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
> ---
>  drivers/gpu/drm/gma500/mmu.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/gma500/mmu.c b/drivers/gpu/drm/gma500/mmu.c
> index 0eaf11c..d2c4bac 100644
> --- a/drivers/gpu/drm/gma500/mmu.c
> +++ b/drivers/gpu/drm/gma500/mmu.c
> @@ -677,10 +677,9 @@ int psb_mmu_insert_pfn_sequence(struct psb_mmu_pd *pd, uint32_t start_pfn,
>  	do {
>  		next = psb_pd_addr_end(addr, end);
>  		pt = psb_mmu_pt_alloc_map_lock(pd, addr);
> -		if (!pt) {
> -			ret = -ENOMEM;
> +		if (!pt)
>  			goto out;
> -		}
> +
>  		do {
>  			pte = psb_mmu_mask_pte(start_pfn++, type);
>  			psb_mmu_set_pte(pt, addr, pte);
> @@ -700,7 +699,7 @@ out:
>  	if (pd->hw_context != -1)
>  		psb_mmu_flush(pd->driver);
>  
> -	return 0;
> +	return ret;
>  }
>  
>  int psb_mmu_insert_pages(struct psb_mmu_pd *pd, struct page **pages,
> 
Ted,
Here are some other patches from this week and before that may be more useful then the ones applied/
acknowledged.
Nick
>From 1201c4b502ec8faef8cd4c3a6ee9dbd7d386d9cf Mon Sep 17 00:00:00 2001
From: Nicholas Krause <xerofoify@xxxxxxxxx>
Date: Sun, 7 Jun 2015 20:50:43 -0400
Subject: [RESEND PATCH] chelsio:Remove unused functions from the file, cxgb4_main.c

This removes the no longer used functions, cxgb4_enable_db_coalescing
and cxgb4_disable_db_coalescing plus the exporting of them as symbols
due to having no more users/callers of these particular functions.

Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c | 19 -------------------
 1 file changed, 19 deletions(-)

diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
index 803d91b..f996443 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c
@@ -2042,25 +2042,6 @@ out:
 }
 EXPORT_SYMBOL(cxgb4_sync_txq_pidx);
 
-void cxgb4_disable_db_coalescing(struct net_device *dev)
-{
-	struct adapter *adap;
-
-	adap = netdev2adap(dev);
-	t4_set_reg_field(adap, SGE_DOORBELL_CONTROL_A, NOCOALESCE_F,
-			 NOCOALESCE_F);
-}
-EXPORT_SYMBOL(cxgb4_disable_db_coalescing);
-
-void cxgb4_enable_db_coalescing(struct net_device *dev)
-{
-	struct adapter *adap;
-
-	adap = netdev2adap(dev);
-	t4_set_reg_field(adap, SGE_DOORBELL_CONTROL_A, NOCOALESCE_F, 0);
-}
-EXPORT_SYMBOL(cxgb4_enable_db_coalescing);
-
 int cxgb4_read_tpte(struct net_device *dev, u32 stag, __be32 *tpte)
 {
 	struct adapter *adap;
-- 
2.1.4
>From 950ace789c2cc371233ea0204e9baccfea7630bc Mon Sep 17 00:00:00 2001
From: Nicholas Krause <xerofoify@xxxxxxxxx>
Date: Mon, 29 Jun 2015 22:55:22 -0400
Subject: [PATCH] i40e:Return -ENODEV if hardware has no support for certain
 required features in the function i40e_init_pf_fcoe

This makes the function i40e_init_pf_fcoe correctly return -ENODEV
as a error return for when the underlying hardware does not have
support for FCOE or DCB rather then 0 to it's callers in order
to comply with checks run by these particular function's callers
to find out if the underlying hardware supports these features.

Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
---
 drivers/net/ethernet/intel/i40e/i40e_fcoe.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
index c8b621e..24a44dd 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_fcoe.c
@@ -273,7 +273,8 @@ out:
  * i40e_fcoe_sw_init - sets up the HW for FCoE
  * @pf: pointer to PF
  *
- * Returns 0 if FCoE is supported otherwise the error code
+ * Returns 0 if FCoE is supported otherwise  -ENODEV if
+ * the hardware does not support it
  **/
 int i40e_init_pf_fcoe(struct i40e_pf *pf)
 {
@@ -287,13 +288,13 @@ int i40e_init_pf_fcoe(struct i40e_pf *pf)
 
 	if (!pf->hw.func_caps.fcoe) {
 		dev_info(&pf->pdev->dev, "FCoE capability is disabled\n");
-		return 0;
+		return -ENODEV;
 	}
 
 	if (!pf->hw.func_caps.dcb) {
 		dev_warn(&pf->pdev->dev,
 			 "Hardware is not DCB capable not enabling FCoE.\n");
-		return 0;
+		return -ENODEV;
 	}
 
 	/* enable FCoE hash filter */
-- 
2.1.4


>From ec360ec67a5eb6a62bc5ec05b34fc867ae060a76 Mon Sep 17 00:00:00 2001
From: Nicholas Krause <xerofoify@xxxxxxxxx>
Date: Sun, 28 Jun 2015 17:38:29 -0400
Subject: [PATCH] xhci:Remove unused marco definitions from the file xhci-hub.c

This removes the unneeded marco definitions for the marcos
of XHCI_PORT_RW1S, XHCI_PORT_RW1C, XHCI_PORT_RW	 and
XHCI_PORT_RZ due to no uses of these marcos in the file
xhci-hub.c or any other related kernel source code file
related to supporting xhci host controllers.

Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
---
 drivers/usb/host/xhci-hub.c | 23 -----------------------
 1 file changed, 23 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index e75c565..fd430de 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -196,29 +196,6 @@ static unsigned int xhci_port_speed(unsigned int port_status)
  * link state, port power, port indicator state, "wake on" enable state
  */
 #define XHCI_PORT_RWS	((0xf<<5) | (1<<9) | (0x3<<14) | (0x7<<25))
-/*
- * These bits are RW; writing a 1 sets the bit, writing a 0 has no effect:
- * bit 4 (port reset)
- */
-#define	XHCI_PORT_RW1S	((1<<4))
-/*
- * These bits are RW; writing a 1 clears the bit, writing a 0 has no effect:
- * bits 1, 17, 18, 19, 20, 21, 22, 23
- * port enable/disable, and
- * change bits: connect, PED, warm port reset changed (reserved zero for USB 2.0 ports),
- * over-current, reset, link state, and L1 change
- */
-#define XHCI_PORT_RW1CS	((1<<1) | (0x7f<<17))
-/*
- * Bit 16 is RW, and writing a '1' to it causes the link state control to be
- * latched in
- */
-#define	XHCI_PORT_RW	((1<<16))
-/*
- * These bits are Reserved Zero (RsvdZ) and zero should be written to them:
- * bits 2, 24, 28:31
- */
-#define	XHCI_PORT_RZ	((1<<2) | (1<<24) | (0xf<<28))
 
 /*
  * Given a port state, this function returns a value that would result in the
-- 
2.1.4
>From afa142b9826a7108825c8b0369a302a52d4be343 Mon Sep 17 00:00:00 2001
From: Nicholas Krause <xerofoify@xxxxxxxxx>
Date: Fri, 29 May 2015 23:19:43 -0400
Subject: [PATCH RESEND] wireless: Remove no longer used function definition and prototype for the function, cfg80211_can_use_iftype_chan

This removes the function, cfg80211_can_use_iftype_chan and its
prototype from the files, core.h and util.c due to having no
more users of this function. In addition due to this function
not being exported with the marco, EXPORT_SYMBOL we have no
need to worry about this function being removed now breaking
out of tree kernel code.

Signed-off-by: Nicholas Krause <xerofoify@xxxxxxxxx>
---
 net/wireless/core.h |   7 ----
 net/wireless/util.c | 114 ----------------------------------------------------
 2 files changed, 121 deletions(-)

diff --git a/net/wireless/core.h b/net/wireless/core.h
index 801cd49..6b68c24 100644
--- a/net/wireless/core.h
+++ b/net/wireless/core.h
@@ -409,13 +409,6 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
 void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev);
 void cfg80211_process_wdev_events(struct wireless_dev *wdev);
 
-int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
-				 struct wireless_dev *wdev,
-				 enum nl80211_iftype iftype,
-				 struct ieee80211_channel *chan,
-				 enum cfg80211_chan_mode chanmode,
-				 u8 radar_detect);
-
 /**
  * cfg80211_chandef_dfs_usable - checks if chandef is DFS usable
  * @wiphy: the wiphy to validate against
diff --git a/net/wireless/util.c b/net/wireless/util.c
index 70051ab..1e4f1a5 100644
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
@@ -1619,120 +1619,6 @@ int cfg80211_check_combinations(struct wiphy *wiphy,
 }
 EXPORT_SYMBOL(cfg80211_check_combinations);
 
-int cfg80211_can_use_iftype_chan(struct cfg80211_registered_device *rdev,
-				 struct wireless_dev *wdev,
-				 enum nl80211_iftype iftype,
-				 struct ieee80211_channel *chan,
-				 enum cfg80211_chan_mode chanmode,
-				 u8 radar_detect)
-{
-	struct wireless_dev *wdev_iter;
-	int num[NUM_NL80211_IFTYPES];
-	struct ieee80211_channel
-			*used_channels[CFG80211_MAX_NUM_DIFFERENT_CHANNELS];
-	struct ieee80211_channel *ch;
-	enum cfg80211_chan_mode chmode;
-	int num_different_channels = 0;
-	int total = 1;
-	int i;
-
-	ASSERT_RTNL();
-
-	if (WARN_ON(hweight32(radar_detect) > 1))
-		return -EINVAL;
-
-	if (WARN_ON(iftype >= NUM_NL80211_IFTYPES))
-		return -EINVAL;
-
-	/* Always allow software iftypes */
-	if (rdev->wiphy.software_iftypes & BIT(iftype)) {
-		if (radar_detect)
-			return -EINVAL;
-		return 0;
-	}
-
-	memset(num, 0, sizeof(num));
-	memset(used_channels, 0, sizeof(used_channels));
-
-	num[iftype] = 1;
-
-	/* TODO: We'll probably not need this anymore, since this
-	 * should only be called with CHAN_MODE_UNDEFINED. There are
-	 * still a couple of pending calls where other chanmodes are
-	 * used, but we should get rid of them.
-	 */
-	switch (chanmode) {
-	case CHAN_MODE_UNDEFINED:
-		break;
-	case CHAN_MODE_SHARED:
-		WARN_ON(!chan);
-		used_channels[0] = chan;
-		num_different_channels++;
-		break;
-	case CHAN_MODE_EXCLUSIVE:
-		num_different_channels++;
-		break;
-	}
-
-	list_for_each_entry(wdev_iter, &rdev->wdev_list, list) {
-		if (wdev_iter == wdev)
-			continue;
-		if (wdev_iter->iftype == NL80211_IFTYPE_P2P_DEVICE) {
-			if (!wdev_iter->p2p_started)
-				continue;
-		} else if (wdev_iter->netdev) {
-			if (!netif_running(wdev_iter->netdev))
-				continue;
-		} else {
-			WARN_ON(1);
-		}
-
-		if (rdev->wiphy.software_iftypes & BIT(wdev_iter->iftype))
-			continue;
-
-		/*
-		 * We may be holding the "wdev" mutex, but now need to lock
-		 * wdev_iter. This is OK because once we get here wdev_iter
-		 * is not wdev (tested above), but we need to use the nested
-		 * locking for lockdep.
-		 */
-		mutex_lock_nested(&wdev_iter->mtx, 1);
-		__acquire(wdev_iter->mtx);
-		cfg80211_get_chan_state(wdev_iter, &ch, &chmode, &radar_detect);
-		wdev_unlock(wdev_iter);
-
-		switch (chmode) {
-		case CHAN_MODE_UNDEFINED:
-			break;
-		case CHAN_MODE_SHARED:
-			for (i = 0; i < CFG80211_MAX_NUM_DIFFERENT_CHANNELS; i++)
-				if (!used_channels[i] || used_channels[i] == ch)
-					break;
-
-			if (i == CFG80211_MAX_NUM_DIFFERENT_CHANNELS)
-				return -EBUSY;
-
-			if (used_channels[i] == NULL) {
-				used_channels[i] = ch;
-				num_different_channels++;
-			}
-			break;
-		case CHAN_MODE_EXCLUSIVE:
-			num_different_channels++;
-			break;
-		}
-
-		num[wdev_iter->iftype]++;
-		total++;
-	}
-
-	if (total == 1 && !radar_detect)
-		return 0;
-
-	return cfg80211_check_combinations(&rdev->wiphy, num_different_channels,
-					   radar_detect, num);
-}
-
 int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
 			   const u8 *rates, unsigned int n_rates,
 			   u32 *mask)
-- 
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]