From patchwork Tue Nov 7 16:55:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikolay Borisov X-Patchwork-Id: 162680 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:aa0b:0:b0:403:3b70:6f57 with SMTP id k11csp365168vqo; Tue, 7 Nov 2023 08:55:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjoxEF0JHmTxJnSZPFzuB3g/dQn7+sDPpo+7iAkM9/u53+j0ZNs7PjCWmxtbBSFDMDt5KC X-Received: by 2002:a05:6358:33a1:b0:168:e364:70af with SMTP id i33-20020a05635833a100b00168e36470afmr44197960rwd.25.1699376140375; Tue, 07 Nov 2023 08:55:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699376140; cv=none; d=google.com; s=arc-20160816; b=Hy+3lD6spei8PT1zexjI9rPUFHC0L+7yvCiqXoxvUi/zUEgjcXjnpVXprVsyD7DsG6 cWU/cfPz2tF3dZgrX9x2+lfETLezWOwZZVfg+lccDyCrgfRa/byoZVmxc2q7Pa99XS4R YabFJy1RA94ywdb/es/gHMOF24+IHkOe2vXh5wJJh6xY616c/CNouE3Y2FQNC8oZm9Yd 72lNzuLacDZK5rpyxmEbqMRSbt9RLuyJ3XlTDA1DqotnlKeGqtOlzxCQFP27gKzKKn/9 n6UPhBluhAWOqe1dajxbM6muXph2XZAE8POVXB8mLtLfkoYQEHBrCy+XVAVPOLTK+i1K rLgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=8YR5IGNzGB11lqau+yV+L6ykZhJX5tp/evzkhWrEHQk=; fh=7X/CMbncQYW721D/XGeQXtOPAhDOi229FYlAtknZ184=; b=VFhitqZ/skyytuBjAV3hR9tc72/r/dz3o71pIPuAoZcTWYFK9cxbuGAUPxygmgDp6d hxmrQKIJD+ARA59SBa6P+x1cGW1xQ+7/JgcesgWdJjwpT8oVG8TpzwTIqJD4KFtvNPrX Tme/TNXdaFTkiRHjxhiSokxtReQHnvTCvY3U6G8bo4B3ILBKhn3iY+S798yiEozfqfhh FcDb0IDDOUci8H0hJyyWfnXggLQO1LOGzpe38xNZGivKS6KIuj//n3dp8vODIqVHQgfF TISQAJV7F51uv9X0t7MGjMSS/5ssYq0vtcHbQuEoF6sMUik0qrRMTrotlZwEpB7FgOAB Tadw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=UyvKFRK2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bg26-20020a056a02011a00b00563d74b6347si2508579pgb.863.2023.11.07.08.55.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 08:55:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=UyvKFRK2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 910A2827C19D; Tue, 7 Nov 2023 08:55:39 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229738AbjKGQzi (ORCPT + 32 others); Tue, 7 Nov 2023 11:55:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjKGQzh (ORCPT ); Tue, 7 Nov 2023 11:55:37 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D9B0693; Tue, 7 Nov 2023 08:55:34 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 434CC1F37C; Tue, 7 Nov 2023 16:55:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1699376133; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=8YR5IGNzGB11lqau+yV+L6ykZhJX5tp/evzkhWrEHQk=; b=UyvKFRK2tBb95knrq8Oe+GkLZujLkjmbW2yLtFKf3/4cx65dyc3yWLdWDOIIo76wEZ2VuX 3DS42Kma4cdafZJxNH/NM7sjKQYgZ3mWCp2GppuYmKLmfTnnVVvlGOTzs8lZllvorIcCxT U78DUmg41RgGMTT7KTAKly4UirgYjx8= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E1658132FD; Tue, 7 Nov 2023 16:55:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id y2KmNARsSmUURwAAMHmgww (envelope-from ); Tue, 07 Nov 2023 16:55:32 +0000 From: Nikolay Borisov To: bp@alien8.de Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, Nikolay Borisov Subject: [PATCH] x86/mce: Remove redundant check from mce_device_create() Date: Tue, 7 Nov 2023 18:55:29 +0200 Message-Id: <20231107165529.407349-1-nik.borisov@suse.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 07 Nov 2023 08:55:39 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781925035850817757 X-GMAIL-MSGID: 1781925035850817757 mce_device_create() is called only from mce_cpu_online() which in turn will be called iff mce is available. That is, at the time of mce_device_create() call it's guaranteed that mce is available. No need to duplicate this check so let's remove it. Signed-off-by: Nikolay Borisov --- arch/x86/kernel/cpu/mce/core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 7b397370b4d6..71999f97a3c8 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -2568,9 +2568,6 @@ static int mce_device_create(unsigned int cpu) int err; int i, j; - if (!mce_available(&boot_cpu_data)) - return -EIO; - dev = per_cpu(mce_device, cpu); if (dev) return 0;