Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754175AbbLKVUb (ORCPT ); Fri, 11 Dec 2015 16:20:31 -0500 Received: from mail-qk0-f173.google.com ([209.85.220.173]:34396 "EHLO mail-qk0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbbLKVU3 convert rfc822-to-8bit (ORCPT ); Fri, 11 Dec 2015 16:20:29 -0500 MIME-Version: 1.0 In-Reply-To: References: <1449697404-21076-1-git-send-email-keescook@chromium.org> <1449697404-21076-3-git-send-email-keescook@chromium.org> Date: Fri, 11 Dec 2015 23:20:28 +0200 Message-ID: Subject: Re: [PATCH v3 2/8] lib: add "on" and "off" to strtobool From: Andy Shevchenko To: Kees Cook Cc: "linux-kernel@vger.kernel.org" , Rasmus Villemoes , Daniel Borkmann , Ingo Molnar , Andy Lutomirski , "H. Peter Anvin" , Michael Ellerman , Mathias Krause , Thomas Gleixner , "x86@kernel.org" , Arnd Bergmann , PaX Team , Emese Revfy , "kernel-hardening@lists.openwall.com" , linux-arch Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1564 Lines: 49 On Fri, Dec 11, 2015 at 8:50 PM, Kees Cook wrote: > On Fri, Dec 11, 2015 at 9:00 AM, Andy Shevchenko > wrote: >> On Wed, Dec 9, 2015 at 11:43 PM, Kees Cook wrote: >>> Several places in the kernel expect to use "on" and "off" for their >>> boolean signifiers, so add them to strtobool. >>> + if (!s) >>> + return -EINVAL; >>> + >> >> This change I think is better to do separately. Do we have even need for it? > > I'm happy to separate it, sure. I added it here because several of the > __setup and param callers do a check for !NULL input, and it made this > cleaner. Also it seems sensible to do this check anyway. OK. >>> + default: >>> + return -EINVAL; >>> + } >>> + break; >>> default: >>> return -EINVAL; >> >> Maybe in both cases >> default: >> break; >> } >> … >> } >> return -EINVAL; > > I went back and forth on this. To switch to the fall-back being EINVAL > meant I had to change all the other "breaks" into "return 0", and it > just looked ugly to me. If that is preferred, though, I'm happy to do > it. I have no strong feelings about that, I prefer whatever looks neater. -- With Best Regards, Andy Shevchenko -- 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/