From patchwork Fri Jan 26 02:12:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Randy Dunlap X-Patchwork-Id: 10185019 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F2DB860211 for ; Fri, 26 Jan 2018 02:13:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CDA6B28C9D for ; Fri, 26 Jan 2018 02:13:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1C8528CBC; Fri, 26 Jan 2018 02:13:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5144728C9D for ; Fri, 26 Jan 2018 02:13:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751452AbeAZCNG (ORCPT ); Thu, 25 Jan 2018 21:13:06 -0500 Received: from merlin.infradead.org ([205.233.59.134]:39478 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbeAZCNG (ORCPT ); Thu, 25 Jan 2018 21:13:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:Date:Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=amJ48plYWhiz4qkyf9KghCFYXH0R7I7uQ5XToOL7e5U=; b=NfNuELru0UOqQBp1nuIf1cRQ7C TDhb0ocnUu4G6Mk9SQvKQ6qEgZ7h+q0pkEDjkiPpKr0za8k9AAIlvoW9EPZU76WBzLIWHRZweTc6J 8PGBYX6qaBmrffW48WUeou4YTZ0z78dRPbaXwr4leR6K7OfLu/rA8uRZdxbHUWfi3GXU23qCbIgYl hLvevjDWq2PdjBx6ZB+u9/bsxhiUj2W9tUdokvkaMg+rcLIyckkuFXTYifOnCw4RIVCQTEFuOKlsb Qq/0NcSvaicG8Pj9ILI3CbpD/nI+64yK38BLgS5+dUCFS5meGL3rdT+w3HXGArnybaBl1Xf6rKH7e MmGTCEUQ==; Received: from static-50-53-52-16.bvtn.or.frontiernet.net ([50.53.52.16] helo=dragon.site) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1eetVm-0002Sj-J1; Fri, 26 Jan 2018 02:13:03 +0000 To: Linux-Sparse , Christopher Li From: Randy Dunlap Subject: [PATCH] lib.c: early return from handle_onoff_switch() Message-ID: Date: Thu, 25 Jan 2018 18:12:54 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 Content-Language: en-US Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Randy Dunlap When handling "-Wsparse-all" in handle_onoff_switch(), once all warning flags have been set, the function can return instead of checking for "no-" or other option names because they won't be found. Just return NULL, which is what happens when handling "-Wsparse-all" anyway. Signed-off-by: Randy Dunlap Acked-by: Luc Van Oostenryck --- lib.c | 1 + 1 file changed, 1 insertion(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- sprs-2018-0119.orig/lib.c +++ sprs-2018-0119/lib.c @@ -565,6 +565,7 @@ static char **handle_onoff_switch(char * if (*warnings[i].flag != WARNING_FORCE_OFF && warnings[i].flag != &Wsparse_error) *warnings[i].flag = WARNING_ON; } + return NULL; } // Prefixes "no" and "no-" mean to turn warning off.