Skip to contentSkip to conversation

writeback: remove the unused function parameter

PATCH Applied Wang Long 3 participants 3 messages Nov 4, 2017 – Nov 6, 2017

Subsystems (2)
lore
Share & tools
lore

Wang Long

author
#0 lore raw

PATCH v2 1/1 writeback: remove the unused function parameter

The parameter struct bdi_writeback *wb is not been used in the function body. so we just remove it.

---
 include/linux/backing-dev.h | 2 +-
 mm/page-writeback.c         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/backing-dev.h +1 -1
index 1662157..186a2e7 100644
@@ -95,7 +95,7 @@ static inline s64 wb_stat_sum(struct bdi_writeback *wb, enum wb_stat_item item)
 /*
  * maximal error of a stat counter.
  */
-static inline unsigned long wb_stat_error(struct bdi_writeback *wb)
+static inline unsigned long wb_stat_error(void)
 {
 #ifdef CONFIG_SMP
 	return nr_cpu_ids * WB_STAT_BATCH;
mm/page-writeback.c +2 -2
index 0b9c5cb..9287466 100644
@@ -1543,7 +1543,7 @@ static inline void wb_dirty_limits(struct dirty_throttle_control *dtc)
 	 * actually dirty; with m+n sitting in the percpu
 	 * deltas.
 	 */
-	if (dtc->wb_thresh < 2 * wb_stat_error(wb)) {
+	if (dtc->wb_thresh < 2 * wb_stat_error()) {
 		wb_reclaimable = wb_stat_sum(wb, WB_RECLAIMABLE);
 		dtc->wb_dirty = wb_reclaimable + wb_stat_sum(wb, WB_WRITEBACK);
 	} else {
@@ -1802,7 +1802,7 @@ static void balance_dirty_pages(struct address_space *mapping,
 		 * more page. However wb_dirty has accounting errors.  So use
 		 * the larger and more IO friendly wb_stat_error.
 		 */
-		if (sdtc->wb_dirty <= wb_stat_error(wb))
+		if (sdtc->wb_dirty <= wb_stat_error())
 			break;
 
 		if (fatal_signal_pending(current))
Signature · 1 line
1.8.3.1
maintainer Reviewed-by on v2 1/1
#1 lore raw
Quoted 4 lines · Wang Long

The parameter struct bdi_writeback *wb is not been used in the function body. so we just remove it.

Looks good. You can add:

Honza

Quoted 43 lines
---
 include/linux/backing-dev.h | 2 +-
 mm/page-writeback.c         | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
include/linux/backing-dev.h +1 -1
index 1662157..186a2e7 100644
@@ -95,7 +95,7 @@ static inline s64 wb_stat_sum(struct bdi_writeback *wb, enum wb_stat_item item)
 /*
  * maximal error of a stat counter.
  */
-static inline unsigned long wb_stat_error(struct bdi_writeback *wb)
+static inline unsigned long wb_stat_error(void)
 {
 #ifdef CONFIG_SMP
 	return nr_cpu_ids * WB_STAT_BATCH;
mm/page-writeback.c +2 -2
index 0b9c5cb..9287466 100644
@@ -1543,7 +1543,7 @@ static inline void wb_dirty_limits(struct dirty_throttle_control *dtc)
 	 * actually dirty; with m+n sitting in the percpu
 	 * deltas.
 	 */
-	if (dtc->wb_thresh < 2 * wb_stat_error(wb)) {
+	if (dtc->wb_thresh < 2 * wb_stat_error()) {
 		wb_reclaimable = wb_stat_sum(wb, WB_RECLAIMABLE);
 		dtc->wb_dirty = wb_reclaimable + wb_stat_sum(wb, WB_WRITEBACK);
 	} else {
@@ -1802,7 +1802,7 @@ static void balance_dirty_pages(struct address_space *mapping,
 		 * more page. However wb_dirty has accounting errors.  So use
 		 * the larger and more IO friendly wb_stat_error.
 		 */
-		if (sdtc->wb_dirty <= wb_stat_error(wb))
+		if (sdtc->wb_dirty <= wb_stat_error())
 			break;
 
 		if (fatal_signal_pending(current))
Signature · 1 line
1.8.3.1
Signature · 8 lines
Jan Kara <[email protected]>
SUSE Labs, CR

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to [email protected].  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Acked-by on v2 1/1
#2 lore raw
In reply to Wang Long
Quoted 4 lines · Wang Long

The parameter struct bdi_writeback *wb is not been used in the function body. so we just remove it.

Thanks.

Signature · 7 lines
tejun

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