From patchwork Mon Oct 24 11:29:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8573 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp418226wru; Mon, 24 Oct 2022 05:14:17 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4S9vodsDRBspk8gLAAOMyY7tTB76fSGFleDJln3D6IqvdTqYlpYdX9l380y10EDdx5IEUS X-Received: by 2002:a05:6402:e87:b0:456:c93c:5361 with SMTP id h7-20020a0564020e8700b00456c93c5361mr29687706eda.88.1666613657643; Mon, 24 Oct 2022 05:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613657; cv=none; d=google.com; s=arc-20160816; b=f/JSE1PmpJjT+lXxiv6lx5m4x4dHX15AjnGWBdPhOPMEezPseTh6BZMwb1vBtWUVn9 oMKezTqIqL7bkobedKoE0nqfRtO2BdMR7/pLhEJ2u8Q6dVqWMTbyckx1dFOxXS09i2/o hKLKV+YzXKhBBi1RGcpM1+un5czHCfx99969WoyFMl41BVr1LGjrqxRIAzXOzICjUymF tdhq+eu24ndbUJEilo18/d5TobPaasVbek5CMyC0d8tKdzcbHvAaw0L0DERKJ15Q2D6y osZt+ycOC2ZhuKFl3H0ANbYNfykmDiHzCbLDJRuzP1rsRn6/BP4lTZ7N+hWAah9p28pc UDDA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Kvf1wUbNwSVSBWwIV5fL8bkIuY3EWSCL26/lalVKqzk=; b=LCCmxo2wAw0073LWLYtyN+19yyIdh25xS2EWjN/nQSS1UV29VVfjohCMNzEW2Nno8e rwNimt3SFZOntGvneqmMJyABcQEVKaZFK9s8bLH7d99Zbmv9kkjDnEBWrePSgQC1tGLS WKrElnT3LT9+qI0j5oi5DUJjypxnpe2E11ylp18Q4JGD/GP9loDI56BulKRvcghuciL2 fv3/TZkbrt8ekOxw8+GcOcHoiqYjecMpqiSpfpY+z4k3s/6Fzf4MFHoFNk6yzFxLFL/I tHa4nLZmn8knKKlVbZ9tlstEDceHLLzAxVLzab823+0S45iWbtmT6dRuUSqPTnHkJNTM vXDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Xx7t/ysN"; 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=linuxfoundation.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g24-20020a056402115800b00446fdce2a62si24712109edw.420.2022.10.24.05.13.52; Mon, 24 Oct 2022 05:14:17 -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=@linuxfoundation.org header.s=korg header.b="Xx7t/ysN"; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230097AbiJXMCw (ORCPT + 99 others); Mon, 24 Oct 2022 08:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232747AbiJXL7r (ORCPT ); Mon, 24 Oct 2022 07:59:47 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F0597C1D3; Mon, 24 Oct 2022 04:49:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 0EDCDCE131E; Mon, 24 Oct 2022 11:46:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 252E9C433D6; Mon, 24 Oct 2022 11:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611993; bh=H6SVqnoMJtqjUi9uRgeMH0tCUlsjckGSZG/7dl6Ssrk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xx7t/ysNByAmnPx6/oj8uGp+46OBAHGx0Dpfoj0Spt2SiCjf8QgpDVwE3nHsUX7BA 0R0brQkLYZerVVXIOyFbHeCkC43DwBONvMno6yJxs1+g8D/odT/de1bDM3uJ9b32sP E1ECNYicggRxDmxZS6OwbDuXaEiPfQ9r9MOxO7h8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Lukas Straub , Richard Weinberger , Sasha Levin , Randy Dunlap Subject: [PATCH 4.14 029/210] um: Cleanup compiler warning in arch/x86/um/tls_32.c Date: Mon, 24 Oct 2022 13:29:06 +0200 Message-Id: <20221024112957.908052740@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747571082739977596?= X-GMAIL-MSGID: =?utf-8?q?1747571082739977596?= From: Lukas Straub [ Upstream commit d27fff3499671dc23a08efd01cdb8b3764a391c4 ] arch.tls_array is statically allocated so checking for NULL doesn't make sense. This causes the compiler warning below. Remove the checks to silence these warnings. ../arch/x86/um/tls_32.c: In function 'get_free_idx': ../arch/x86/um/tls_32.c:68:13: warning: the comparison will always evaluate as 'true' for the address of 'tls_array' will never be NULL [-Waddress] 68 | if (!t->arch.tls_array) | ^ In file included from ../arch/x86/um/asm/processor.h:10, from ../include/linux/rcupdate.h:30, from ../include/linux/rculist.h:11, from ../include/linux/pid.h:5, from ../include/linux/sched.h:14, from ../arch/x86/um/tls_32.c:7: ../arch/x86/um/asm/processor_32.h:22:31: note: 'tls_array' declared here 22 | struct uml_tls_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; | ^~~~~~~~~ ../arch/x86/um/tls_32.c: In function 'get_tls_entry': ../arch/x86/um/tls_32.c:243:13: warning: the comparison will always evaluate as 'true' for the address of 'tls_array' will never be NULL [-Waddress] 243 | if (!t->arch.tls_array) | ^ ../arch/x86/um/asm/processor_32.h:22:31: note: 'tls_array' declared here 22 | struct uml_tls_struct tls_array[GDT_ENTRY_TLS_ENTRIES]; | ^~~~~~~~~ Signed-off-by: Lukas Straub Acked-by: Randy Dunlap # build-tested Signed-off-by: Richard Weinberger Signed-off-by: Sasha Levin --- arch/x86/um/tls_32.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/arch/x86/um/tls_32.c b/arch/x86/um/tls_32.c index 5bd949da7a4a..b69ab2409430 100644 --- a/arch/x86/um/tls_32.c +++ b/arch/x86/um/tls_32.c @@ -65,9 +65,6 @@ static int get_free_idx(struct task_struct* task) struct thread_struct *t = &task->thread; int idx; - if (!t->arch.tls_array) - return GDT_ENTRY_TLS_MIN; - for (idx = 0; idx < GDT_ENTRY_TLS_ENTRIES; idx++) if (!t->arch.tls_array[idx].present) return idx + GDT_ENTRY_TLS_MIN; @@ -242,9 +239,6 @@ static int get_tls_entry(struct task_struct *task, struct user_desc *info, { struct thread_struct *t = &task->thread; - if (!t->arch.tls_array) - goto clear; - if (idx < GDT_ENTRY_TLS_MIN || idx > GDT_ENTRY_TLS_MAX) return -EINVAL;