From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A0A90C433E1 for ; Tue, 19 May 2020 16:46:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7E8AA20842 for ; Tue, 19 May 2020 16:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589906789; bh=sM5TWkuZbJDY4NlTw1WOM/771f8ZCEnuLZQAsc0iAdQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=wQeNwl29KIVmmC+vAu8817lCGdFwvHvDVaIFoug4KVAPmsGctiByaQ08l9qH8CQYP FjddcowvkXojzEoT0Nhtb3C2beCjUBUWXlTBshnFVtD6FI18SpYQQr+SdHL9ic3raH vm5VY5QIXXImpCX/o+2A7sjQX92gqJdwBXpMJmnI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729370AbgESQq3 (ORCPT ); Tue, 19 May 2020 12:46:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728953AbgESQqZ (ORCPT ); Tue, 19 May 2020 12:46:25 -0400 Received: from mail-lj1-x241.google.com (mail-lj1-x241.google.com [IPv6:2a00:1450:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7990FC08C5C2 for ; Tue, 19 May 2020 09:46:23 -0700 (PDT) Received: by mail-lj1-x241.google.com with SMTP id m18so459513ljo.5 for ; Tue, 19 May 2020 09:46:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TC0qAtFd13O2JOLCB7SFLNnsJ0TrRRfShJMVEYLbwy0=; b=BM7rNRUOZPJu6CqIZoTyNHsH3OhfbJ7v4lyTa1sXCfThZdyIW2MAwpqUoVdCrwYJYJ M+8yUvqSB1mogas+2iJO8jLleH/wb+mxdAsp/6H+RxHZ44GfbLZBQMjsb0UkWlV6SNKA VToCUizM9QTTj9Opl/oBOtfqOQD3JZAH4FWEo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=TC0qAtFd13O2JOLCB7SFLNnsJ0TrRRfShJMVEYLbwy0=; b=rzoOvetV1VkTWMEB2h0W4hNomx8msEObBLyVVHiT1GA/3dUocemMAcfG2zvwadVBLe 3Zt48gvp7092Pi5vbRxJ9B0VCtWnc5qTIUpDsdzMKwrue6QAvfucPvfHVX4dwjRSUf0B ZzRoNC878JSLKMo2n9jk+zJy+X+P3G/aQzShgASHM1OIuWMimNEGrFDjk8FmInW78/ZP HfeGVRwqQkWT3HwHGHdtXcet72O9vbihca//y/thLqPry6EUqipDjzXIIx7AKTzo6TW8 2eIpKA61dhGvJjwR2nuWkiMR6vwwgBK2QMTsfi71TSc/SuaJnlZMK6DQt53vYIbzWoDd z1zQ== X-Gm-Message-State: AOAM532/WbIQebz6NZHQsUqF7eiNxNumLuUH0ota4fKJhOaIk7IkjGrM u0/p5tV0F5lSpLst51rfNNl50HhDCho= X-Google-Smtp-Source: ABdhPJwn7XXEhURWPHoj3eODmDvvQHhH9nG3nzs0h5qDySNbmqhAvFHxpOq5lKrChB+bdYLLeE/rFw== X-Received: by 2002:a05:651c:319:: with SMTP id a25mr161019ljp.209.1589906781102; Tue, 19 May 2020 09:46:21 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id q16sm10457886lfp.9.2020.05.19.09.46.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 May 2020 09:46:19 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id u6so452608ljl.6 for ; Tue, 19 May 2020 09:46:18 -0700 (PDT) X-Received: by 2002:a2e:8956:: with SMTP id b22mr218841ljk.16.1589906778412; Tue, 19 May 2020 09:46:18 -0700 (PDT) MIME-Version: 1.0 References: <20200519134449.1466624-1-hch@lst.de> <20200519134449.1466624-13-hch@lst.de> <20200519164146.GA28313@lst.de> In-Reply-To: <20200519164146.GA28313@lst.de> From: Linus Torvalds Date: Tue, 19 May 2020 09:46:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 12/20] maccess: remove strncpy_from_unsafe To: Christoph Hellwig Cc: "the arch/x86 maintainers" , Alexei Starovoitov , Daniel Borkmann , Masami Hiramatsu , Andrew Morton , linux-parisc@vger.kernel.org, linux-um , Netdev , bpf@vger.kernel.org, Linux-MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Tue, May 19, 2020 at 9:41 AM Christoph Hellwig wrote: > > I had a lot of folks complaining about things like: > > #ifdef CONFIG_FOO > if (foo) > do_stuff(); > else > #endif > do_something_else(); > > which I personally don't mind at all, so I switched to this style. Well, I don't particularly like that style either, it is _very_ easy to get wrong when you edit it later (and various indentation checkers tend to be very unhappy about it too). But that's why I like trying to just make simple helper functions instead. Yeah, it's often a few more lines of code (if only because of the extra function definition etc), but with good naming and sane arguments those few extra lines can also help make it much more understandable in the process, and it gives you a nice place to add commentary for the really odd cases (comments inside code that then does other things often make things just harder to see). Linus