Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp378349rwi; Mon, 10 Oct 2022 01:28:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM66a2h42ySgbDiT5pJ9xflGYZ//sI1E5Hjm0Jgp5IZdkiu5FdDUjDaK2QHgRQtRLt7goJ2I X-Received: by 2002:a65:6ccd:0:b0:439:2033:6ee with SMTP id g13-20020a656ccd000000b00439203306eemr15958186pgw.271.1665390487124; Mon, 10 Oct 2022 01:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665390487; cv=none; d=google.com; s=arc-20160816; b=g3S9SPhd75p7xngjMBrwuKXXNcqOeiZBTunSqbLlSUub8NF2mq8Jy3TxbCN7McaL25 aUJVopTOdxKnSLvxM0SvrBeiaPuoNTVZH3MbqfXm5TyaGpmfHs05JHxrX4rM9+v1Z3GF Q0t7Nc1rKZyLFzj8O1Zk4/5VfpzMYeLiZRlLTnaLrBeL93gxSc/SmCKuAqHhJfavo1ij C8XBN64cSYb5NAOlSaAhSygqT1IHrD6d1TCODwytmGCYBKElI3rKcxVsmrW1tCh6Yobz 5hQael+geIRnBHIL1f0z90mIpr/RvphcJ7wdmbozMTSh16KICXD4k2P5dNo+h49HxYlY 6OPQ== 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=oMbqpDJ5TYUrpPUex0g3OjD52Jl1ieIyrTfnWVGUbLI=; b=rgxXk+nEvJtUu1TSmeWl6NM0GWrOMRBQXx0dnePdY9jQT8GtQhDPxzYfeEdLubXX/D AgLYcHn5bYKRREpFwYMfH2UAIMQUvdeu08Jv0C8HklgO2KUU8uoi/M3+rw1856Nz8KqE PAfDqY+6Ewb1kmhu/4eHVvaS9QKMWcfrsHRcZsyyc4bUk+qTa1YzdZhN9SasmwQnzFFe k9oY7+hkFsVr5TQdLi+AItcgHvw9zVe2NFrgrtCKEa9NEiwnzVs7UixOyKWzciF8OmLq +ei+6s4EnqeG4qYT/GLODpkTT5tz+fr40TTshdUkA0LBRnGncFdryUGXeuCSbx/9hoIG B3aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=J7EdcCnX; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r18-20020a632b12000000b0045ff2a2f56csi7300192pgr.546.2022.10.10.01.27.55; Mon, 10 Oct 2022 01:28:07 -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=J7EdcCnX; 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 S231660AbiJJHJo (ORCPT + 99 others); Mon, 10 Oct 2022 03:09:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231235AbiJJHIm (ORCPT ); Mon, 10 Oct 2022 03:08:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB1A5F77; Mon, 10 Oct 2022 00:06:08 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1A82660E75; Mon, 10 Oct 2022 07:06:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2FBC4C433D6; Mon, 10 Oct 2022 07:06:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1665385563; bh=FMtJbvUlcZMfZJsHs+zcMqbDLnAq+to6DJYsgnmO13c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J7EdcCnXmOSAWGahPylrhrqzVKB/ODf/Xo3tzN3UNEqYZAbtOoEWIBa2z8jpUIgJj QckBtLoE14Bzi466baF1DkCUhljt/2OuwRg6vZmTc9U6+xCTjnfbb6Hl1FObpIIixi 6JbCDDEMaXJpgQRaC5Geg5CNwZijS7aFztS129AU= 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 5.19 24/48] um: Cleanup compiler warning in arch/x86/um/tls_32.c Date: Mon, 10 Oct 2022 09:05:22 +0200 Message-Id: <20221010070334.333060460@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221010070333.676316214@linuxfoundation.org> References: <20221010070333.676316214@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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 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 ac8eee093f9c..66162eafd8e8 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; @@ -240,9 +237,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; -- 2.35.1