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=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 C1D9CC433E0 for ; Tue, 19 May 2020 16:46:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5996A20829 for ; Tue, 19 May 2020 16:46:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="BM7rNRUO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5996A20829 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E078C80008; Tue, 19 May 2020 12:46:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB7B3900002; Tue, 19 May 2020 12:46:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCC6F80008; Tue, 19 May 2020 12:46:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0251.hostedemail.com [216.40.44.251]) by kanga.kvack.org (Postfix) with ESMTP id B19D7900002 for ; Tue, 19 May 2020 12:46:22 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 73261824805A for ; Tue, 19 May 2020 16:46:22 +0000 (UTC) X-FDA: 76834046604.18.sign16_71d0530c98305 X-HE-Tag: sign16_71d0530c98305 X-Filterd-Recvd-Size: 4574 Received: from mail-lf1-f68.google.com (mail-lf1-f68.google.com [209.85.167.68]) by imf39.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 May 2020 16:46:21 +0000 (UTC) Received: by mail-lf1-f68.google.com with SMTP id h188so90473lfd.7 for ; Tue, 19 May 2020 09:46:21 -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=mEvSiJDLghj3HOzOBDaqcSNVkSLKkcN+Rer9ZrZxuxXQtDV0mYiOflEttn3k1aKVDt YKeYFtv3pgSWXvU2pjFHjTFB4hQ6iGv1BFnic3CDzel0ANXCPE6HlRr3/mZXxoXI7c4z xtGDlGwIqrPFWqmOgR74tZfurnXyzIxX3u0SpgqtTZJUTNYN/k8uOCKvjZkd5Nsef81B 8EAfS0pNrOKE56xM8kWk1s4IUvqRuEl6k/TsOXmiGY8jhSHLJQCEmDJHmXI5VM27rYYv vVu7dJLgp0U5oNwR08+krKcG6yQGFvbqoK5IGoM+mYvAn1+IjJm6OJU2kiU+/QU1kOQE tCkg== X-Gm-Message-State: AOAM530YmyVAf7ozcRMWmbCiEKOQfabawXDY6YyhhFCl2HLEfns2ShX4 SCy94qiGlvcZHJhuVm9TVyQ2YcuuTKU= X-Google-Smtp-Source: ABdhPJwVsSry4ndwpAoPHRf/5Oo/+d+XQ6bGcJ/ehIZ9L15ZXncjpSgJrUa5oK519fG63urXetkp9Q== X-Received: by 2002:a19:6a10:: with SMTP id u16mr15839045lfu.105.1589906779871; Tue, 19 May 2020 09:46:19 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id d8sm9278983lfl.51.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-f170.google.com with SMTP id l15so85097lje.9 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" X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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