From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DF84BC4338F for ; Wed, 11 Aug 2021 15:49:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C371460E97 for ; Wed, 11 Aug 2021 15:49:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233448AbhHKPuQ (ORCPT ); Wed, 11 Aug 2021 11:50:16 -0400 Received: from mail.skyhub.de ([5.9.137.197]:32970 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232946AbhHKPuP (ORCPT ); Wed, 11 Aug 2021 11:50:15 -0400 Received: from zn.tnic (p200300ec2f0d7c00c5d666a347f4c0f8.dip0.t-ipconnect.de [IPv6:2003:ec:2f0d:7c00:c5d6:66a3:47f4:c0f8]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 660481EC04F0; Wed, 11 Aug 2021 17:49:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1628696986; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=Zbc1Agl3LGZzQ4c2hBGGXpqbK9OXFObDT/acgb1b9io=; b=ThTDol6a0ayPm9FRQkd+ti/dDUFLYNzu9/RqRxQPZbJTNplW2qqZV6UyMsKNB4XPspWxRy s1HJH1mLvFt7UfeuqB+9AgyQoZJCLp2Kp3Wae8gmCLGiLSV/xRAOoCyIQQyD7au1kVKtLL OUzIj1Tc90fl2FbRMWSebt0L4gLhYvM= Date: Wed, 11 Aug 2021 17:50:24 +0200 From: Borislav Petkov To: James Morse Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Reinette Chatre , Thomas Gleixner , Ingo Molnar , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, Jamie Iles , D Scott Phillips OS , lcherian@marvell.com, bobo.shaobowang@huawei.com Subject: Re: [PATCH v7 16/24] x86/resctrl: Add a helper to read a closid's configuration Message-ID: References: <20210728170637.25610-1-james.morse@arm.com> <20210728170637.25610-17-james.morse@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20210728170637.25610-17-james.morse@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 05:06:29PM +0000, James Morse wrote: > +void resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d, > + u32 closid, u32 *value) > +{ > + struct rdt_hw_domain *hw_dom = resctrl_to_arch_dom(d); > + > + if (!is_mba_sc(r)) > + *value = hw_dom->ctrl_val[closid]; > + else > + *value = hw_dom->mbps_val[closid]; I don't like functions which are of void type but which still return a value through an arg pointer. Please send a cleanup ontop of the whole set converting it to return u32 as the mbps value instead. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette