From patchwork Sun Nov 1 20:12:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 11872535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B18E314B2 for ; Sun, 1 Nov 2020 20:13:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 79E53208B6 for ; Sun, 1 Nov 2020 20:13:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79E53208B6 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=perches.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id EBF1C6B0081; Sun, 1 Nov 2020 15:13:15 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E4DC26B0082; Sun, 1 Nov 2020 15:13:15 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D107E6B0083; Sun, 1 Nov 2020 15:13:15 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0100.hostedemail.com [216.40.44.100]) by kanga.kvack.org (Postfix) with ESMTP id 9C2186B0081 for ; Sun, 1 Nov 2020 15:13:15 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 40E123628 for ; Sun, 1 Nov 2020 20:13:15 +0000 (UTC) X-FDA: 77436948750.28.skate95_1a03147272aa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin28.hostedemail.com (Postfix) with ESMTP id 1CF086C3E for ; Sun, 1 Nov 2020 20:13:15 +0000 (UTC) X-Spam-Summary: 1,0,0,e46fe5d1d5e123de,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:541:800:960:968:973:982:988:989:1260:1261:1311:1314:1345:1359:1437:1513:1515:1521:1535:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3870:3872:4321:5007:6261:7903:10004:11026:11473:11658:11914:12043:12296:12297:12438:12555:12895:12986:13069:13161:13229:13311:13357:14181:14384:14394:14664:14721:21080:21433:21451:21627:21990:30029:30054,0,RBL:216.40.41.5:@perches.com:.lbl8.mailshell.net-66.201.201.201 62.8.55.100;04y8ka97y6jqxc1usts8hkaj8ca94opepjwy856dipgspt794hff9mzmcpgyade.qpm1wox3jx3yd1e3sgondd5dzrw4rod6yswqqsrcx1ujr9egb653jqfio3kgk8x.r-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:69,LUA_SUMMARY:none X-HE-Tag: skate95_1a03147272aa X-Filterd-Recvd-Size: 5422 Received: from smtprelay.test.hostedemail.com (mail.test.hostedemail.com [216.40.41.5]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Nov 2020 20:13:14 +0000 (UTC) Received: from forelay.test.hostedemail.com (10.5.29.251.rfc1918.com [10.5.29.251]) by smtprelay01.test.hostedemail.com (Postfix) with ESMTP id 3064511CEC for ; Sun, 1 Nov 2020 20:13:14 +0000 (UTC) Received: from forelay.prod.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by fograve01.test.hostedemail.com (Postfix) with ESMTP id 1371923810 for ; Sun, 1 Nov 2020 20:13:14 +0000 (UTC) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DF71D1EF1 for ; Sun, 1 Nov 2020 20:13:03 +0000 (UTC) X-FDA: 77436948246.18.nail31_4302ca7272aa Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id B4A4C100ED3A5 for ; Sun, 1 Nov 2020 20:13:03 +0000 (UTC) X-Spam-Summary: 1,0,0,e46fe5d1d5e123de,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:541:800:960:968:973:982:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3870:3872:4321:5007:6261:7903:10004:11026:11473:11658:11914:12043:12296:12297:12438:12555:12895:12986:13069:13161:13229:13311:13357:13894:14181:14384:14394:14664:14721:21080:21433:21451:21627:21990:30029:30054,0,RBL:216.40.44.241:@perches.com:.lbl8.mailshell.net-66.201.201.201 62.8.55.100;04y8ka97y6jqxc1usts8hkaj8ca94opepjwy856dipgspt794hff9mzmcpgyade.qpm1wox3jx3yd1e3sgondd5dzrw4rod6yswqqsrcx1ujr9egb653jqfio3kgk8x.r-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:67,LUA_SUMMARY:none X-HE-Tag: nail31_4302ca7272aa X-Filterd-Recvd-Size: 3363 Received: from smtprelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Nov 2020 20:13:03 +0000 (UTC) Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay01.hostedemail.com (Postfix) with ESMTP id 1DBD0100E7B43; Sun, 1 Nov 2020 20:13:03 +0000 (UTC) X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,,RULES_HIT:41:355:379:541:800:960:968:973:982:988:989:1260:1311:1314:1345:1359:1437:1515:1534:1541:1711:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3870:3872:4321:5007:6261:7903:10004:10848:11026:11473:11658:11914:12043:12296:12297:12438:12555:12895:12986:13069:13161:13229:13311:13357:13894:14181:14384:14394:14664:14721:21080:21433:21451:21627:21990:30029:30054,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:0,LUA_SUMMARY:none X-HE-Tag: shop54_2901886272aa X-Filterd-Recvd-Size: 2255 Received: from joe-laptop.perches.com (unknown [47.151.133.149]) (Authenticated sender: joe@perches.com) by omf04.hostedemail.com (Postfix) with ESMTPA; Sun, 1 Nov 2020 20:13:02 +0000 (UTC) From: Joe Perches To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/5] mm:backing-dev: Use sysfs_emit in macro defining functions Date: Sun, 1 Nov 2020 12:12:50 -0800 Message-Id: <289a7dd0aeb738bbbf52d044778256e45fc28322.1604261483.git.joe@perches.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: References: MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The cocci script used in commit bdacbb8d04f ("mm: Use sysfs_emit for struct kobject * uses") does not convert the name##_show macro because the macro uses concatenation via ##. Convert it by hand. Signed-off-by: Joe Perches --- mm/backing-dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 408d5051d05b..e33797579338 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c @@ -150,11 +150,11 @@ static ssize_t read_ahead_kb_store(struct device *dev, #define BDI_SHOW(name, expr) \ static ssize_t name##_show(struct device *dev, \ - struct device_attribute *attr, char *page) \ + struct device_attribute *attr, char *buf) \ { \ struct backing_dev_info *bdi = dev_get_drvdata(dev); \ \ - return snprintf(page, PAGE_SIZE-1, "%lld\n", (long long)expr); \ + return sysfs_emit(buf, "%lld\n", (long long)expr); \ } \ static DEVICE_ATTR_RW(name); @@ -200,11 +200,11 @@ BDI_SHOW(max_ratio, bdi->max_ratio) static ssize_t stable_pages_required_show(struct device *dev, struct device_attribute *attr, - char *page) + char *buf) { dev_warn_once(dev, "the stable_pages_required attribute has been removed. Use the stable_writes queue attribute instead.\n"); - return snprintf(page, PAGE_SIZE-1, "%d\n", 0); + return sysfs_emit(buf, "%d\n", 0); } static DEVICE_ATTR_RO(stable_pages_required);