Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp3840260pxb; Fri, 11 Feb 2022 08:53:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJzU18jZ5f1gYS//UkpwDgq1Z/Mor0XUNZfC5ZZRGe01wd1aKTDtX3GChXOn7GLVTxVXUNlK X-Received: by 2002:a17:90a:f184:: with SMTP id bv4mr1273797pjb.117.1644598398499; Fri, 11 Feb 2022 08:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644598398; cv=none; d=google.com; s=arc-20160816; b=0kjjbGwKqjS5DyHdaS1+RBrpgjAXs8lO+D5Hr/BEtYaCxDO4YcBfnppET7pWuTumUb NgMhT9xfwQXOTZdjReGRZHE4SMEq+gqjY33AdUFEv2v6oIWVRns3ZPUnZnehg/pBBhHd 8oGay8zvVAkeZPT5RVHi16XjaSHosCsMfVv5pCwIsemj7lsJUH64uhSF8aG4CP24D6aZ NFSFILEp3CjzYcJD+jBes7IVnaOloYxSAL8yWVf7UKk31Yw7DMx/WDx8w9SLmiYziQs3 EhM9KIT2f8g62s5ywE9EK/pgrylc12jvngYRgy4+5JiQyAcs3WtGoQu0dklSg+1mV+vQ DE6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=TsWuj4G2wG0NYWunOJp94Bw96tULZSSzToHFuSeHINA=; b=wTGnzNWiGPAc2i/6W7UP6KkNKiTu0Cxl57DYK3reWcJGN+GIZPTiV+1TQNAGmXLBhO XSEkghFl8t90xJ17rMXDpCa+SAyMbHyGeLZ3V2Zq0Z8WgeyJPex5crUJhdMzSQ+eqdyl UlsEzdCSxEzR8uQNy8P8fGW0aUEDccqulvpGz4jUY42VcaKOmrnlcWJ8/+0I8W/+qH2Y URVQ59/zeJ0NEDl6mBqPJxIvF/IyT57gRm6CkQgwzr9zJyFRZE3olAv5oWnK/un7TTd+ 9fCSEwfhkO404nJtaRp9R6gTXvYoBw16SUa60WtTs+8wUrmNTBZTqWPlr0nfuDkXLrWY MRaw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n3si20652173pff.351.2022.02.11.08.53.04; Fri, 11 Feb 2022 08:53:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347946AbiBKIFz (ORCPT + 99 others); Fri, 11 Feb 2022 03:05:55 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232328AbiBKIFw (ORCPT ); Fri, 11 Feb 2022 03:05:52 -0500 X-Greylist: delayed 1080 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 11 Feb 2022 00:05:50 PST Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B2FC9D69; Fri, 11 Feb 2022 00:05:50 -0800 (PST) Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 21B7dKQZ012095; Fri, 11 Feb 2022 01:39:21 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 21B7dJjv012092; Fri, 11 Feb 2022 01:39:19 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 11 Feb 2022 01:39:19 -0600 From: Segher Boessenkool To: Kees Cook Cc: Christophe Leroy , linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, Arnd Bergmann , Greg Kroah-Hartman , Helge Deller , linux-kernel@vger.kernel.org, "James E.J. Bottomley" , linux-mm@kvack.org, Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v3 04/12] powerpc: Prepare func_desc_t for refactorisation Message-ID: <20220211073919.GW614@gate.crashing.org> References: <86c393ce0a6f603f94e6d2ceca08d535f654bb23.1634457599.git.christophe.leroy@csgroup.eu> <202202101653.9128E58B84@keescook> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202202101653.9128E58B84@keescook> User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 10, 2022 at 04:54:52PM -0800, Kees Cook wrote: > On Sun, Oct 17, 2021 at 02:38:17PM +0200, Christophe Leroy wrote: (edited:) > > +typedef struct { > > + unsigned long addr; > > +} func_desc_t; > > > > static func_desc_t func_desc(unsigned long addr) > > { > > + return (func_desc_t){addr}; > There's only 1 element in the struct, so okay, but it hurt my eyes a > little. I would have been happier with: > > return (func_desc_t){ .addr = addr; }; > > But of course that also looks bonkers because it starts with "return". > So no matter what I do my eyes bug out. ;) The usual way to avoid convoluted constructs is to name more factors. So: static func_desc_t func_desc(unsigned long addr) { func_desc_t desc = {}; desc.addr = addr; return desc; } Segher