Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1099080ybl; Fri, 6 Dec 2019 11:13:56 -0800 (PST) X-Google-Smtp-Source: APXvYqw0UMdQTkGnQNVpJlzqe+P39eQGtUh9HmbAqxQhb3F+gq5ygj9e3KFHWAenJGfhho9Hdyrw X-Received: by 2002:aca:815:: with SMTP id 21mr14136647oii.52.1575659636385; Fri, 06 Dec 2019 11:13:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575659636; cv=none; d=google.com; s=arc-20160816; b=CRpTIyp2UlgLy+orn5BODAie1wC6Iv0Wiea2TsdllTxe+tUwP1dgNQ5E4glhke4nwV pX0O7XkPveIJdfC2SnFTAONIUkk0tMl2DS53H1iyf2L+uKlxhSkIcHeqed86UzAzQUqq I3PsbaRYVNLFbBeE5H1ySWKfafuvpoAs+WQM0NEwm6e9sibjFyl7957mD59XHQmB+Yna 7nDXA6a9w9a5YpteQbyzBCN5rYsysLwfwjbPZLIFqmIUIGlaWMoylvHFJszU2tANXp1O A6iVHl0tap/6Lqo23AJR2OZ9iSsQsNIcDrKHDNEPtYzeAM6f+jXbc7iqJfl4jnSDo+o+ KEZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=RrcAlVOVB2yYv5GbEbHb5HibP1LZswj92yBtg8ufEpg=; b=fNl0ofz2jKOL/RXlsv4UDVL+LuTzqRtmLWQQUv1CiRQRez8sDfUrrluHgIWvCRPiTb gyU7GgqxwUP38Q8ApAZz7DhrYs6HZaFlBTzxo3QzCNASM8IttF5q8sIzzK8UN2Zk6VXn s4fJ4LPzYDT39u1Hbp76/nZE7YrYqGBHLhmN0EtqvKLqbaX61B3RTO1YA04H/RuCFl+9 dKrpbCsvCK8VZYQDJ15Oxza8WxwvfZuIeOcceJPxoJy5WkPJzsZ9xptPHySIYSM7WEAS 3WF935gjhVJhp9QkEtKb264uQPjhGlC4EnX4/Rq98Ifk3LjDJxjiBn6Xuzs6cfESerdi tNXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i78si7753112oib.1.2019.12.06.11.13.43; Fri, 06 Dec 2019 11:13:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726353AbfLFTNQ (ORCPT + 99 others); Fri, 6 Dec 2019 14:13:16 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:5284 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726325AbfLFTNP (ORCPT ); Fri, 6 Dec 2019 14:13:15 -0500 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB6JBvtC159073 for ; Fri, 6 Dec 2019 14:13:14 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2wq905x292-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 06 Dec 2019 14:13:14 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 6 Dec 2019 19:13:12 -0000 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 6 Dec 2019 19:13:10 -0000 Received: from d06av24.portsmouth.uk.ibm.com (d06av24.portsmouth.uk.ibm.com [9.149.105.60]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xB6JD9FC66584592 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 6 Dec 2019 19:13:09 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CC4E4203F; Fri, 6 Dec 2019 19:13:09 +0000 (GMT) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5FA8342041; Fri, 6 Dec 2019 19:13:07 +0000 (GMT) Received: from localhost.localdomain (unknown [9.85.71.21]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 6 Dec 2019 19:13:07 +0000 (GMT) Subject: Re: [PATCH v4 3/6] powerpc/fadump: reorganize /sys/kernel/fadump_* sysfs files To: Greg KH Cc: mpe@ellerman.id.au, mahesh@linux.vnet.ibm.com, hbathini@linux.ibm.com, linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org, corbet@lwn.net, linux-doc@vger.kernel.org References: <20191206122434.29587-1-sourabhjain@linux.ibm.com> <20191206122434.29587-4-sourabhjain@linux.ibm.com> <20191206124508.GA1360047@kroah.com> From: Sourabh Jain Date: Sat, 7 Dec 2019 00:43:06 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20191206124508.GA1360047@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19120619-0028-0000-0000-000003C61602 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19120619-0029-0000-0000-000024893CB2 Message-Id: <9efa9a4b-b0ce-f9b7-88b0-a74a767bbe81@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-06_06:2019-12-05,2019-12-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 lowpriorityscore=0 bulkscore=0 spamscore=0 suspectscore=0 adultscore=0 malwarescore=0 impostorscore=0 clxscore=1015 mlxlogscore=999 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-1910280000 definitions=main-1912060154 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/19 6:15 PM, Greg KH wrote: > On Fri, Dec 06, 2019 at 05:54:31PM +0530, Sourabh Jain wrote: >> +static struct kobj_attribute release_attr = __ATTR(release_mem, >> 0200, NULL, >> fadump_release_memory_store); >> -static struct kobj_attribute fadump_attr = __ATTR(fadump_enabled, >> +static struct kobj_attribute enable_attr = __ATTR(enabled, >> 0444, fadump_enabled_show, >> NULL); > > __ATTR_RO()? > >> -static struct kobj_attribute fadump_register_attr = __ATTR(fadump_registered, >> +static struct kobj_attribute register_attr = __ATTR(registered, >> 0644, fadump_register_show, >> fadump_register_store); > > __ATTR_RW()? Thanks I was not aware of these macros. > > And then use an ATTRIBUTE_GROUP() macro to create a group so that you > then can do: > >> @@ -1452,11 +1450,47 @@ static void fadump_init_files(void) >> printk(KERN_ERR "fadump: unable to create debugfs file" >> " fadump_region\n"); >> >> + rc = sysfs_create_file(fadump_kobj, &enable_attr.attr); >> + if (rc) >> + pr_err("unable to create enabled sysfs file (%d)\n", >> + rc); >> + rc = sysfs_create_file(fadump_kobj, ®ister_attr.attr); >> + if (rc) >> + pr_err("unable to create registered sysfs file (%d)\n", >> + rc); >> + if (fw_dump.dump_active) { >> + rc = sysfs_create_file(fadump_kobj, &release_attr.attr); >> + if (rc) >> + pr_err("unable to create release_mem sysfs file (%d)\n", >> + rc); >> + } > > a single call to sysfs_create_groups() here instead of trying to unwind > the mess if something went wrong. > Sure, I will replace the individual calls with a single group call. Thanks, Sourabh Jain