Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757252AbbH0WX2 (ORCPT ); Thu, 27 Aug 2015 18:23:28 -0400 Received: from casper.infradead.org ([85.118.1.10]:52884 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714AbbH0WXX (ORCPT ); Thu, 27 Aug 2015 18:23:23 -0400 Date: Fri, 28 Aug 2015 00:23:20 +0200 From: Peter Zijlstra To: Chuck Ebbert Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] static-keys: Better error checking for static_key_enable/disable Message-ID: <20150827222320.GA16853@twins.programming.kicks-ass.net> References: <20150827165713.7fc9ff4c@as> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150827165713.7fc9ff4c@as> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 790 Lines: 16 On Thu, Aug 27, 2015 at 04:57:13PM -0400, Chuck Ebbert wrote: > The warnings for static_key_enable/disable don't catch common > errors. For example, starting with a default enabled key and > calling enable doesn't cause a warning until the next enable > or disable. Check explicitly for zero or one instead of allowing > both values in every case. Generated code should be smaller too. I explicitly intended to allow multiple consecutive static_key_enable() calls (same for disable). If its already enabled, calling enable should be a no-op. -- 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/