Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5960847pxb; Mon, 14 Feb 2022 11:45:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJw3EqA6iOoy3jcUv52h4+gbvIflClFBnrR23oqenuF7WKNtzNp06HuizzeQ523i0Ss5d/j8 X-Received: by 2002:a17:903:2cb:: with SMTP id s11mr457634plk.112.1644867940951; Mon, 14 Feb 2022 11:45:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644867940; cv=none; d=google.com; s=arc-20160816; b=KxYS7aKIpu4e1j3ZbV3vWXc04yNp6pfPBFvOV6JRPfQz2XUIjjSPrlEsxiF1TICNOS DeIj8jvsddnjxQJG4bnYZskLoptylg89R7kxRvwTRLcfkswEmwyYGBcLHfjrnAuUwZQp Ph5EfZn1skWTUspU/5RZQfO5Pj0zrMNo8ZBFR+fuwQsDJS6yqCf95i11d8TX2LqSQIlN jdqij9CL3F7iKuiJGi/Vun/7q/GNWRmaguW7GUPFrXNIcEwR5kad7Gs9Qckyq7EBHWtg aWWwLT1nRL3jKRFp4iJ/0TV4Ufv4pWJ9BdBExGzsl1NJ+BiZapWB/+Pai1PCMzQkFq4s LIxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rPrWFBc38mGJFtLb2gbD5L01P7KXnY8iPoadiCq+HkU=; b=k/Z2jhN7T1mOSgwi9slhosuY9Cqbi/v+EawxPUP+imS9XyjXxrX1vfukY3P8ogiqCW vkANQQbNu0V9JyOnW6cBtG77KDFU/sQbjPjU0KHjzzciK1N6kGVg0Lbmz3yhfdhWGpbe SZdhYcLQxrBd9KyAzq0xw8XWoE7E8x/g4u/wRHjfv+WUD6ylxAOrIqw+WWvPB9u8gzNe 3tUT6dyv7PwUMzWSBsZ3e9oLjrNf85PONYJfRyytZK8NbOKBe6O1CKqMm8L7FtUhDih5 5A/2jRR+DqqwUeHoDhvQZKLuwj4P6kD8CH7OZO38zHd8O/ohFnXKj688QpQzFI56A086 X/hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=EVcj3F8o; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id q13si34715396pfl.35.2022.02.14.11.45.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:45:40 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=EVcj3F8o; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 836A6119862; Mon, 14 Feb 2022 11:30:35 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353539AbiBNMvJ (ORCPT + 99 others); Mon, 14 Feb 2022 07:51:09 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:43378 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233616AbiBNMvH (ORCPT ); Mon, 14 Feb 2022 07:51:07 -0500 Received: from mail.skyhub.de (mail.skyhub.de [IPv6:2a01:4f8:190:11c2::b:1457]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A95B4BFCD; Mon, 14 Feb 2022 04:50:59 -0800 (PST) Received: from zn.tnic (dslb-088-067-221-104.088.067.pools.vodafone-ip.de [88.67.221.104]) (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 C2F331EC04AD; Mon, 14 Feb 2022 13:50:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1644843053; 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=rPrWFBc38mGJFtLb2gbD5L01P7KXnY8iPoadiCq+HkU=; b=EVcj3F8oOVaWD2sYUJEfdns4GuIPqxsKFpuiRIVuBy6UKUdd2FF98dscuyrJ0ywPRl348W mLWEc/9pHa9uGWHDF0axKLex/OAm3F4wa+g+pzsQ2CoM6xMhFyx9hSlQ3sPWmiH2MNNA4G 6DSalWaPfa0zoJqxgXvzBj1h8e5u1qw= Date: Mon, 14 Feb 2022 13:50:54 +0100 From: Borislav Petkov To: Yazen Ghannam Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, mchehab@kernel.org, tony.luck@intel.com, james.morse@arm.com, rric@kernel.org, Smita.KoralahalliChannabasappa@amd.com Subject: Re: [PATCH v4 16/24] EDAC/amd64: Define function to make space for CS ID Message-ID: References: <20220127204115.384161-1-yazen.ghannam@amd.com> <20220127204115.384161-17-yazen.ghannam@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220127204115.384161-17-yazen.ghannam@amd.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 On Thu, Jan 27, 2022 at 08:41:07PM +0000, Yazen Ghannam wrote: > +static void expand_bits(u8 start_bit, u8 num_bits, u64 *value) > +{ > + u64 temp1, temp2; > + > + if (start_bit == 0) { As always if (!) for 0/NULL tests. > + *value <<= num_bits; > + return; > + } > + > + temp1 = *value & GENMASK_ULL(start_bit - 1, 0); > + temp2 = (*value & GENMASK_ULL(63, start_bit)) << num_bits; > + *value = temp1 | temp2; > +} > + > +static void make_space_for_cs_id_simple(struct addr_ctx *ctx) > +{ > + u8 num_intlv_bits = ctx->intlv_num_chan; > + > + num_intlv_bits += ctx->intlv_num_dies; > + num_intlv_bits += ctx->intlv_num_sockets; > + expand_bits(ctx->intlv_addr_bit, num_intlv_bits, &ctx->ret_addr); > +} void functions but they return values through their pointer arguments? I'm sure you can design those better. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette