Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp20747002rwd; Thu, 29 Jun 2023 06:36:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4OTsQyPYauxfmJXbTR/9L22dx7DVJoRHEufF8bFx66V7DL2tYMHP09N2zxGaRNK/IkXKrF X-Received: by 2002:a05:6a21:328a:b0:110:b7fb:2c92 with SMTP id yt10-20020a056a21328a00b00110b7fb2c92mr5584465pzb.11.1688045770585; Thu, 29 Jun 2023 06:36:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688045770; cv=pass; d=google.com; s=arc-20160816; b=SJKcHuEjPJtC6ZCUBvr7dV+hqjGCGK3gDPxWJOw69h//agMxcsg7urEbrcd78K0Snl 3/Aqt1N4WVtl2eJafhxoU8SxfQNdZSO2Wmht8kPsvZcgQ3LeUrXwZ/W6J0xMebkFx5cz pTAptguHO+8uukgEuTdy06mVZGVRw7Pqj+E2tfgD35zo3YlKhmqp0RZM+jTfbqueCRIm KwAGLt98rht2zjponXImWId7AwyUnYbGqu8GEnS9IqWm0jsTX4h7Zb22Pc2ID+92Roz8 e1rDyiUPX6Sojxrbdawc42h5raqR6EIBg6eqCSD+D8JWIjc3O+A7OESIg0wssbOboN1B 2Q/g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature:dkim-signature; bh=Mmei1fd5hcPzZD68NDIaOA1/GqbWdzzfhrtQuA8T9ro=; fh=ILpDVa+Tx9hOs1XNGSwNAmfehLNhV6pOc5ICV+JF9Jo=; b=VQl9IoDezGYtoC20cN01UjpTk+AZyxOGcdGzpbE6oy5pB/ONWMEdd0zT2jTVEO4DDG yj3tc62TcKx5jCNyn6eNDmtLk3Y1Eilv3p8f87XKW4mRA43T1jiRyB2tYd5dZf/J0T0Q BBoSU/5Z+igCmuy+uHd6LM8wBQ9IQ6hfXVjDILTpPXm4ss56dsGL9tzBBvldu2DJgCVt KxG5ZM2FGP0bspgQ3cTcXkpdW6OUatIfL4V1p3usHOkfX1zHK75mxIH/oO7+NanuRpdo M/YmKg9w+sKs2u57LadmScm8Y75HA9kzd8P3aIwSNKHIBvWs8GWW0/1DpABAG3+Ea+wt NvjA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=h1QzXcz0; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pkIu8Mou; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i24-20020aa787d8000000b0066e96a581c3si9065642pfo.5.2023.06.29.06.35.57; Thu, 29 Jun 2023 06:36:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=h1QzXcz0; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=pkIu8Mou; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232017AbjF2N0K (ORCPT + 99 others); Thu, 29 Jun 2023 09:26:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231953AbjF2N0F (ORCPT ); Thu, 29 Jun 2023 09:26:05 -0400 Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 456F930EF; Thu, 29 Jun 2023 06:26:04 -0700 (PDT) Received: from pps.filterd (m0246617.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35TAoteb007206; Thu, 29 Jun 2023 13:25:30 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=message-id : date : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding : mime-version; s=corp-2023-03-30; bh=Mmei1fd5hcPzZD68NDIaOA1/GqbWdzzfhrtQuA8T9ro=; b=h1QzXcz0SmTymNffJeuj87tsAftd+h5h2qADU+6/QGcfGZpdi+mfXT8puy8ZRPr6EvXT 7pFRZOwUv8SyUnnCzgGZDehPsTn6ye86LZbDJcUnsZytSJzKW1ZJi/sFdr6kE8Vy7KBm Y+iAuGtVeDBAblsCQ6CacgQOhcNguvoDPJ5mApfR37fpx839VYtcY3fadlZCl031y8W9 j1OElngLcv3YZWHND6cRFO2vjc6FeaYRBXbwTAsQqY9r4OWJ1qyDuF4MQD0K9tLal3qf 3loyGdIR249KbNxDD2TJINGFs2rrhHX4+WWqTeALJMw6K+Pk25kSw2Ge6B3CzqGUnFOu bg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rds1uc5tq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Jun 2023 13:25:30 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35TCijYa004146; Thu, 29 Jun 2023 13:25:28 GMT Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam02lp2049.outbound.protection.outlook.com [104.47.56.49]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxddkbs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Jun 2023 13:25:28 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T4HQrwpVzi0KWWa1Q6h5R7nq9hZwAUWRDjdtVSrsn0cp39XyGLCO5quWYHE39BByEKpAVJU6Wr0JV2iOxq1FfRFK0jBCff1PePlQDcv06iS9SSOSIqNlfQSTTmgYLj/diXOrPTxVdon049sYfrt5s6t6wNvp2+5f9qjPPuzoQAxrlNDTwZ9JoBstRQMu/nQzg4zPVrPJ2BOodD2wfGVs9VSFxe8Bvo+Ko5+iAdB0UdkStbbGuKyBROyQQBcH/kvpsnMiak3Z7gZFe6YtxgoH0AxqSOX8u8ADG2B7XIhTMoDYMtArkSHkTEEu4L+q8p/J9IKZnlkrTPdZ+ZrXLHEOoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Mmei1fd5hcPzZD68NDIaOA1/GqbWdzzfhrtQuA8T9ro=; b=cfccCAibGK9kIRNxWOx3Zn1UAZ0l/8La7h40n/ihY9OWtTKFIYLswyakmacmzqUKRo8ReDgVY1DtERoigwbV8GaIdCwffZn29CmMHI03Oud4ESnv57tYpZhbxpTMEp2vsJ2hcCohUfWz2xXJ2ZlPQJBCOxaX0h9XJBnaB8MKEFrSWsvF9AXWfNoR9wFdOF8IhLeBHSYfZYGDK0Y3LLavNc6vZkX+wSR0DstbwxTEfj/CaJ6kSBzeuP1N0AaSFCYXQJsLydaaEbAbsfZbM71LNahOLX/U0IPSnV2FDLpMxM/cFEgqGRpMZ9s2Zu8ZpnfOQ6JoEe3R/Ue6sa2EcoUxaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Mmei1fd5hcPzZD68NDIaOA1/GqbWdzzfhrtQuA8T9ro=; b=pkIu8Mouu8BS9GHlWydzv/5eoIdbp72bIKHhwGixC46Xd6Zy0f8usFbGlF40SCAOWuERVrsCUes8wIf3WioLrKnsG+vyoQbQ/tmFLrNfcWuzzfrS7X7ESoDs6xrXigo61SqOOKeSdGg1bYE4bsoMCaPlPe/g6ZRcOVkRJvTtsPI= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by BLAPR10MB5169.namprd10.prod.outlook.com (2603:10b6:208:331::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.15; Thu, 29 Jun 2023 13:25:26 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::8b8f:b4b1:bb78:b048]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::8b8f:b4b1:bb78:b048%5]) with mapi id 15.20.6521.024; Thu, 29 Jun 2023 13:25:25 +0000 Message-ID: <47ca905e-4431-6388-d1f7-1007a964811b@oracle.com> Date: Thu, 29 Jun 2023 08:25:19 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v24 02/10] drivers/base: refactor memory.c to use .is_visible() Content-Language: en-US To: linux-kernel@vger.kernel.org, david@redhat.com, osalvador@suse.de, corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, bhe@redhat.com, ebiederm@xmission.com, kexec@lists.infradead.org Cc: hpa@zytor.com, gregkh@linuxfoundation.org, rafael@kernel.org, vgoyal@redhat.com, dyoung@redhat.com, lf32.dev@gmail.com, akpm@linux-foundation.org, naveen.n.rao@linux.vnet.ibm.com, zohar@linux.ibm.com, bhelgaas@google.com, vbabka@suse.cz, tiwai@suse.de, seanjc@google.com, linux@weissschuh.net, vschneid@redhat.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, sourabhjain@linux.ibm.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com References: <20230628185215.40707-1-eric.devolder@oracle.com> <20230628185215.40707-3-eric.devolder@oracle.com> From: Eric DeVolder In-Reply-To: <20230628185215.40707-3-eric.devolder@oracle.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: SJ0PR03CA0150.namprd03.prod.outlook.com (2603:10b6:a03:33c::35) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB4531:EE_|BLAPR10MB5169:EE_ X-MS-Office365-Filtering-Correlation-Id: 810190e2-aa84-4b5d-b4fc-08db78a44c92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rluCiGe96BCKTef9Ac8CUt+z5Lbs4he6SOnoSyeQixketMqeDbZ0vN3yXtbSR5YwWTqAyEc/NQlsHC9pPC0VRibML542VxyaCq6gTRVy5xcMiw5aFn2jLH9RLJV4Ybdy40eW1dsMgVcQOtE3lX/pmi3hw4h4M3yEaTMas0YzinI3za65dv/bsu+44r010+NI8LnAHwob2JPoDXgF71G/v7AM+FYD5+vUB35b1RE2f2Ys7aCfWWebxswHFooEWMZ0Fa8nRwiAaCn5Yc4MqCJnCIAMVd8E4mO7Dn7qx03iXmOvmTbEa55Kk3tsJkuH6/L5OeinRIdmSLJgtFRmZ90QFpZdTokLZqC3+4UN3YGTwBfc4HsA1GSxkIFk8wqRddXQOAsYopCH2/KtvUVV7fxPCWjTbBxQ3A34XGaOuTOeKQqMrHtKxEYIVYUwlRx3HaoNZvDwUAmPjv74kxUMcNOgcAtT/eM/kQmV/9p16PfkzOEALqLhWhU18a78tjuYJBZ/SNmkibjW3BHTrPa/ev0CCDD9pK4J3HsTW9EKCkCfOYd1sOtUd7y8tuGMCwuqLzsUhfgcyEbHIfWQWso7Y4s70mQv3heczrTi8S/LowPOd4eJkluuqKQFHF58ATRSqQ5gB9WjG4LJiAbjcV0ziYy9zNfobvcI7SGaAwwzVJo8lPX67NHCsXMpDoCcWTF4GkMs X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR10MB4531.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(366004)(396003)(136003)(346002)(376002)(39860400002)(451199021)(2616005)(83380400001)(31696002)(86362001)(2906002)(38100700002)(36756003)(8936002)(41300700001)(921005)(6486002)(8676002)(107886003)(5660300002)(478600001)(316002)(6666004)(66476007)(66946007)(31686004)(66556008)(186003)(4326008)(53546011)(7406005)(6512007)(26005)(7416002)(6506007)(142923001)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8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VWZranVudGJh?= =?utf-8?B?QkxtcWkvdXZKRjNxK2pkWERscms0RDdhdHV6NU5pbTJRTDZJMXI2UDVzWCtW?= =?utf-8?B?RUlUVUk5a0VlQjVzUlhKNDZ1V2V5bzJWN0I2Zk1RazdHVGJSUE5OaVZqQVRr?= =?utf-8?B?YytqNm5paTcrQ1dPeldHY1hMVE9FbzI2dVY0Y1pCczg3RnFqQ1pJbVlRWU85?= =?utf-8?B?SWtTZkVkTW93bVRNVkY1eFZNaXNUcnI4VXprZDdRRkZ6NU1yeGdmVUZGaHNa?= =?utf-8?B?UThBeTcrOUtsU3F6YlBHWEt4YjFEeHg5cDJaT0tHK2NuTm9tK2F0TTdpZzlD?= =?utf-8?B?WEF2SEJtaG1FMGRSZTlnOU1Dc0hta1hjblI0K05lYXRWbkNtS2lJVEZqU05r?= =?utf-8?B?QlNldE14dWNKcHd1OGpZRG5LakRtVWxvdnBNVzlCWWJMRTFtR3lpaCsxL2tK?= =?utf-8?B?SldRU1hwRm1qa29TOVl0VUk3UGkrYzhMMVpqU2NiYkx6T3JkdFduZFp6VTc4?= =?utf-8?B?K29lT3VEZ1Boc3F4N2hGQXdaZ3pCdmZlMVFxK2tMZjluL1c2VHI2clNmVTdl?= =?utf-8?B?czYxRDRXY2hJU0RJckZzY0psVmdlM3R3NG05c0FOaHQxYXo0RG1jQnVqVXhu?= =?utf-8?Q?Xs30JybVC14=3D?= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 810190e2-aa84-4b5d-b4fc-08db78a44c92 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2023 13:25:25.8961 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: JR16Ruqmr8abB3Xraj3QPlQuuk3B+5rljBNxYTFeZUzMdK+MVGwZ8j6aRH+4+qZaqHKLc8uYvG6QadgHguB+ZebM/l+dx73BhAJf5K5LiWE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB5169 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-29_03,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 malwarescore=0 mlxscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306290120 X-Proofpoint-GUID: WqWHW3LPL0gxKYIMEr5dZEHAmC-LwHdY X-Proofpoint-ORIG-GUID: WqWHW3LPL0gxKYIMEr5dZEHAmC-LwHdY X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I still need to convert the ifdefs within the functions to IS_ENABLED(), my apologies. eric On 6/28/23 13:52, Eric DeVolder wrote: > Greg Kroah-Hartman requested that this file use the .is_visible() > method instead of #ifdefs for the attributes in memory.c. > > static struct attribute *memory_memblk_attrs[] = { > &dev_attr_phys_index.attr, > &dev_attr_state.attr, > &dev_attr_phys_device.attr, > &dev_attr_removable.attr, > #ifdef CONFIG_MEMORY_HOTREMOVE > &dev_attr_valid_zones.attr, > #endif > NULL > }; > > and > > static struct attribute *memory_root_attrs[] = { > #ifdef CONFIG_ARCH_MEMORY_PROBE > &dev_attr_probe.attr, > #endif > > #ifdef CONFIG_MEMORY_FAILURE > &dev_attr_soft_offline_page.attr, > &dev_attr_hard_offline_page.attr, > #endif > > &dev_attr_block_size_bytes.attr, > &dev_attr_auto_online_blocks.attr, > NULL > }; > > To that end: > - the .is_visible() method is implemented, and IS_ENABLED(), rather > than #ifdef, is used to determine the visibility of the attribute. > - the DEVICE_ATTR_xx() attributes are moved outside of #ifdefs, so that > those structs are always present for the memory_memblk_attrs[] and > memory_root_attrs[]. > - the #ifdefs guarding the attributes in the memory_memblk_attrs[] and > memory_root_attrs[] are moved to the corresponding callback function; > as the callback function must exist now that the attribute is always > compiled-in (though not necessarily visible). > > No functionality change intended. > > Signed-off-by: Eric DeVolder > --- > drivers/base/memory.c | 78 +++++++++++++++++++++++++++++++++++-------- > 1 file changed, 65 insertions(+), 13 deletions(-) > > diff --git a/drivers/base/memory.c b/drivers/base/memory.c > index b456ac213610..f03eda7e1c9c 100644 > --- a/drivers/base/memory.c > +++ b/drivers/base/memory.c > @@ -405,10 +405,12 @@ static int print_allowed_zone(char *buf, int len, int nid, > > return sysfs_emit_at(buf, len, " %s", zone->name); > } > +#endif > > static ssize_t valid_zones_show(struct device *dev, > struct device_attribute *attr, char *buf) > { > +#ifdef CONFIG_MEMORY_HOTREMOVE > struct memory_block *mem = to_memory_block(dev); > unsigned long start_pfn = section_nr_to_pfn(mem->start_section_nr); > unsigned long nr_pages = PAGES_PER_SECTION * sections_per_block; > @@ -444,9 +446,11 @@ static ssize_t valid_zones_show(struct device *dev, > out: > len += sysfs_emit_at(buf, len, "\n"); > return len; > +#else > + return 0; > +#endif > } > static DEVICE_ATTR_RO(valid_zones); > -#endif > > static DEVICE_ATTR_RO(phys_index); > static DEVICE_ATTR_RW(state); > @@ -496,10 +500,10 @@ static DEVICE_ATTR_RW(auto_online_blocks); > * as well as ppc64 will do all of their discovery in userspace > * and will require this interface. > */ > -#ifdef CONFIG_ARCH_MEMORY_PROBE > static ssize_t probe_store(struct device *dev, struct device_attribute *attr, > const char *buf, size_t count) > { > +#ifdef CONFIG_ARCH_MEMORY_PROBE > u64 phys_addr; > int nid, ret; > unsigned long pages_per_block = PAGES_PER_SECTION * sections_per_block; > @@ -527,12 +531,13 @@ static ssize_t probe_store(struct device *dev, struct device_attribute *attr, > out: > unlock_device_hotplug(); > return ret; > +#else > + return 0; > +#endif > } > > static DEVICE_ATTR_WO(probe); > -#endif > > -#ifdef CONFIG_MEMORY_FAILURE > /* > * Support for offlining pages of memory > */ > @@ -542,6 +547,7 @@ static ssize_t soft_offline_page_store(struct device *dev, > struct device_attribute *attr, > const char *buf, size_t count) > { > +#ifdef CONFIG_MEMORY_FAILURE > int ret; > u64 pfn; > if (!capable(CAP_SYS_ADMIN)) > @@ -551,6 +557,9 @@ static ssize_t soft_offline_page_store(struct device *dev, > pfn >>= PAGE_SHIFT; > ret = soft_offline_page(pfn, 0); > return ret == 0 ? count : ret; > +#else > + return 0; > +#endif > } > > /* Forcibly offline a page, including killing processes. */ > @@ -558,6 +567,7 @@ static ssize_t hard_offline_page_store(struct device *dev, > struct device_attribute *attr, > const char *buf, size_t count) > { > +#ifdef CONFIG_MEMORY_FAILURE > int ret; > u64 pfn; > if (!capable(CAP_SYS_ADMIN)) > @@ -569,11 +579,13 @@ static ssize_t hard_offline_page_store(struct device *dev, > if (ret == -EOPNOTSUPP) > ret = 0; > return ret ? ret : count; > +#else > + return 0; > +#endif > } > > static DEVICE_ATTR_WO(soft_offline_page); > static DEVICE_ATTR_WO(hard_offline_page); > -#endif > > /* See phys_device_show(). */ > int __weak arch_get_memory_phys_device(unsigned long start_pfn) > @@ -611,14 +623,35 @@ static struct attribute *memory_memblk_attrs[] = { > &dev_attr_state.attr, > &dev_attr_phys_device.attr, > &dev_attr_removable.attr, > -#ifdef CONFIG_MEMORY_HOTREMOVE > &dev_attr_valid_zones.attr, > -#endif > NULL > }; > > +static umode_t > +memory_memblk_attr_is_visible(struct kobject *kobj, > + struct attribute *attr, int unused) > +{ > + umode_t mode = attr->mode; > + > + if (attr == &dev_attr_phys_index.attr) > + return mode; > + if (attr == &dev_attr_state.attr) > + return mode; > + if (attr == &dev_attr_phys_device.attr) > + return mode; > + if (attr == &dev_attr_removable.attr) > + return mode; > + if (IS_ENABLED(CONFIG_MEMORY_HOTREMOVE)) { > + if (attr == &dev_attr_valid_zones.attr) > + return mode; > + } > + > + return 0; > +} > + > static const struct attribute_group memory_memblk_attr_group = { > .attrs = memory_memblk_attrs, > + .is_visible = memory_memblk_attr_is_visible, > }; > > static const struct attribute_group *memory_memblk_attr_groups[] = { > @@ -878,22 +911,41 @@ void remove_memory_block_devices(unsigned long start, unsigned long size) > } > > static struct attribute *memory_root_attrs[] = { > -#ifdef CONFIG_ARCH_MEMORY_PROBE > &dev_attr_probe.attr, > -#endif > - > -#ifdef CONFIG_MEMORY_FAILURE > &dev_attr_soft_offline_page.attr, > &dev_attr_hard_offline_page.attr, > -#endif > - > &dev_attr_block_size_bytes.attr, > &dev_attr_auto_online_blocks.attr, > NULL > }; > > +static umode_t > +memory_root_attr_is_visible(struct kobject *kobj, > + struct attribute *attr, int unused) > +{ > + umode_t mode = attr->mode; > + > + if (IS_ENABLED(CONFIG_ARCH_MEMORY_PROBE)) { > + if (attr == &dev_attr_probe.attr) > + return mode; > + } > + if (IS_ENABLED(CONFIG_MEMORY_FAILURE)) { > + if (attr == &dev_attr_soft_offline_page.attr) > + return mode; > + if (attr == &dev_attr_hard_offline_page.attr) > + return mode; > + } > + if (attr == &dev_attr_block_size_bytes.attr) > + return mode; > + if (attr == &dev_attr_auto_online_blocks.attr) > + return mode; > + > + return 0; > +} > + > static const struct attribute_group memory_root_attr_group = { > .attrs = memory_root_attrs, > + .is_visible = memory_root_attr_is_visible, > }; > > static const struct attribute_group *memory_root_attr_groups[] = {