Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753373AbcCBNVd (ORCPT ); Wed, 2 Mar 2016 08:21:33 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:38773 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751066AbcCBNVc (ORCPT ); Wed, 2 Mar 2016 08:21:32 -0500 Date: Wed, 2 Mar 2016 14:21:27 +0100 From: Peter Zijlstra To: Arnaldo Carvalho de Melo Cc: Colin King , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] perf tests: initialize sa.sa_flags Message-ID: <20160302132127.GG6356@twins.programming.kicks-ass.net> References: <1456923322-29697-1-git-send-email-colin.king@canonical.com> <20160302125901.GF6356@twins.programming.kicks-ass.net> <20160302130350.GO3604@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160302130350.GO3604@kernel.org> 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: 634 Lines: 19 On Wed, Mar 02, 2016 at 10:03:50AM -0300, Arnaldo Carvalho de Melo wrote: > > Would not something like: > > > > sa = (struct sigaction){ > > .sa_sigaction = segfault_handler, > > }; > > sigfillset(&sa.sa_mask); > > > > Be better? > > I thought about that, but isn't that set in stone? This would be a 4 > liner, while his is a one' :-) Dunno, you're right that its rather unlikely struct sigaction is going to grow another member, but I like the above pattern better in general, makes it harder to end up with uninitalized bits. When performance matters the above pattern isn't ideal, but that should not be a concern here.