Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752392AbZJPVy1 (ORCPT ); Fri, 16 Oct 2009 17:54:27 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751989AbZJPVy0 (ORCPT ); Fri, 16 Oct 2009 17:54:26 -0400 Received: from exprod6ob117.obsmtp.com ([64.18.1.38]:52020 "HELO psmtp.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1751844AbZJPVy0 convert rfc822-to-8bit (ORCPT ); Fri, 16 Oct 2009 17:54:26 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT Subject: [PATCH] kernel/sys.c: fix "warning: do-while statement is not a compound statement" noise Date: Fri, 16 Oct 2009 17:54:31 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] kernel/sys.c: fix "warning: do-while statement is not a compound statement" noise Thread-Index: AcpOqz2DZ7s5etYgSlmzymzbqP6WgQ== From: "H Hartley Sweeten" To: X-OriginalArrivalTime: 16 Oct 2009 21:54:29.0505 (UTC) FILETIME=[3C82A710:01CA4EAB] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1669 Lines: 56 do_each_thread/while_each_thread wrap a block of code that is in this format: for (...) do ... while If curly braces do not surround the inner loop the following warning is generated by sparse: warning: do-while statement is not a compound statement Fix the warning by adding the braces. Signed-off-by: H Hartley Sweeten --- diff --git a/kernel/sys.c b/kernel/sys.c index 255475d..33edb1e 100644 --- a/kernel/sys.c +++ b/kernel/sys.c @@ -190,10 +190,10 @@ SYSCALL_DEFINE3(setpriority, int, which, int, who, int, niceval) !(user = find_user(who))) goto out_unlock; /* No processes for this user */ - do_each_thread(g, p) + do_each_thread(g, p) { if (__task_cred(p)->uid == who) error = set_one_prio(p, niceval, error); - while_each_thread(g, p); + } while_each_thread(g, p); if (who != cred->uid) free_uid(user); /* For find_user() */ break; @@ -253,13 +253,13 @@ SYSCALL_DEFINE2(getpriority, int, which, int, who) !(user = find_user(who))) goto out_unlock; /* No processes for this user */ - do_each_thread(g, p) + do_each_thread(g, p) { if (__task_cred(p)->uid == who) { niceval = 20 - task_nice(p); if (niceval > retval) retval = niceval; } - while_each_thread(g, p); + } while_each_thread(g, p); if (who != cred->uid) free_uid(user); /* for find_user() */ break; -- 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/