Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758832AbXIBT4Q (ORCPT ); Sun, 2 Sep 2007 15:56:16 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752567AbXIBTz6 (ORCPT ); Sun, 2 Sep 2007 15:55:58 -0400 Received: from pentafluge.infradead.org ([213.146.154.40]:37273 "EHLO pentafluge.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbXIBTz5 (ORCPT ); Sun, 2 Sep 2007 15:55:57 -0400 Date: Mon, 3 Sep 2007 01:39:04 +0530 (IST) From: Satyam Sharma X-X-Sender: satyam@enigma.security.iitk.ac.in To: Linux Kernel Mailing List cc: Greg Banks , Olaf Kirch , David Miller , netdev@vger.kernel.org Subject: [PATCH -mm] sunrpc svc: Shut up bogus uninitialized variable warning In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="464262402-445849459-1188763748=:29617" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1993 Lines: 57 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --464262402-445849459-1188763748=:29617 Content-Type: TEXT/PLAIN; charset=iso-2022-jp net/sunrpc/svc.c: In function ‘__svc_create_thread’: net/sunrpc/svc.c:550: warning: ‘oldmask.bits[0u]’ may be used uninitialized in this function is a bogus warning, but gcc isn't smart enough to see why. We cannot just reorganize the code in the function, because we want the set_cpus_allowed() restore to happen only after the kernel_thread() is forked. Alas, we have to use cpus_clear() to initialize oldmask instead to keep gcc happy. Also add some comments to describe what's happening in the function. Signed-off-by: Satyam Sharma --- net/sunrpc/svc.c | 7 +++++++ 1 file changed, 7 insertions(+) --- linux-2.6.23-rc4-mm1/net/sunrpc/svc.c‾fix 2007-09-02 22:55:25.000000000 +0530 +++ linux-2.6.23-rc4-mm1/net/sunrpc/svc.c 2007-09-02 23:03:45.000000000 +0530 @@ -568,17 +568,24 @@ __svc_create_thread(svc_thread_fn func, rqstp->rq_server = serv; rqstp->rq_pool = pool; + /* Only to prevent gcc warning */ + cpus_clear(oldmask); + + /* Temporarily change CPU affinity before forking svc thread */ if (serv->sv_nrpools > 1) have_oldmask = svc_pool_map_set_cpumask(pool->sp_id, &oldmask); + /* Will inherit current->cpus_allowed */ error = kernel_thread((int (*)(void *)) func, rqstp, 0); + /* Restore old cpus_allowed */ if (have_oldmask) set_cpus_allowed(current, oldmask); if (error < 0) goto out_thread; svc_sock_update_bufs(serv); + error = 0; out: return error; --464262402-445849459-1188763748=:29617-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/