From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f182.google.com (mail-dy1-f182.google.com [74.125.82.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 28E2C2C21F2 for ; Wed, 1 Apr 2026 19:42:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775072557; cv=none; b=EQZoCDCJEffxdp6+ZSq9f4aug979EbaEHrmfrq6X7SgaOxAHRti3KyP1TgviR5FW9hzFezBkqBd9F1PTZacviBGTU60KK3GZc6CtpfV8Hrve4mmSvrnwC+QA+xWkharKEDPwy/eCxciRVm6nKfj0s3QTsDwE+slitRJawJrKjfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775072557; c=relaxed/simple; bh=v+cBNmhbm5mabwqBk+pZs4t8xoEzWBvOm6ccJDYbv7M=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mroSc8jgJnUpNU/rJrwX3ZFjRwu2Zf1SMWSQTdYCnp4xPe9BZwMpiZ1ni8WSv2OUwJP0Fw43y0blL1bbNOg3rNXX5GyNqVaITWaSzlzFijLKttQWFJ+rahp6gkiWzvDPQX5RQNDISBX56dU2ygsgcCJY50C+GvinM3slIKt4NNU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lyfMkOX2; arc=none smtp.client-ip=74.125.82.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lyfMkOX2" Received: by mail-dy1-f182.google.com with SMTP id 5a478bee46e88-2b4520f6b32so274186eec.0 for ; Wed, 01 Apr 2026 12:42:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1775072555; x=1775677355; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=9h5fy07niid+t8VGZrO1qpKizyxs/YVZejLLsfnKM2U=; b=lyfMkOX2AL846s6at0y9DktjFummp5l2dlM1MqX3LyEuCD58IXGPRvyIC5S37rA+fD nkEGpX6IZ3bgZrKpc564/o9B5ZhJ+zHNpNqyiwNpxN92PBwOy2zHj4HuHWzt7X41tPNZ D6OKP3/TL02fTsZ+exvCjM6sefb8TlhBdWHMS5TIhFW+AVt1CIlCggQ30pq+zSuqD3NI tU4xlwoIKShbruD4FSUKG52w8PjKXWZmKABgdERbI9fSbnhlZnQjJYUTwV52lwvyi4Lv NCzTtpK3VsiuQUdzI2+uStF/SwctMrCx8x35/WbONq+e/wvF/YMbBwTSMdFsWRSHpz+I jxCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1775072555; x=1775677355; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9h5fy07niid+t8VGZrO1qpKizyxs/YVZejLLsfnKM2U=; b=nQH0aLffvKn1UdrEEDJKNM61hzhszXohO1+bvSCeCni9uvyEnk3jrQvzRxHSwOsN8B ucmyVXd/9YCpZum/bIIiObTKBGch9XarvTG4xqHkN2LDe5v+mCWXx15cH/JAFAy6bsPx 3II7XQcpiHeOHmaebtVRhcyATabM3jJ+To3UPdY8IlmTLB2QxGNCGgBzvNf9l29PX4I6 gFhAe/usymQ86x7vnwrXBSCpitV+XmSXuVbnLgK9OW01EJq/vzDPcoFBtKJL7pC8ruYs Za9ZK92zdw2wQIqaziL4sVNpb+s9GXo3fKTH/BcNIEM6b2nv+lMt7pH6Vj1yITFK8o2z +HrQ== X-Forwarded-Encrypted: i=1; AJvYcCXZsqi6EeIPD2tlQL/1ibiu0tNmE/ptzelZFInXO2Ced5oVyOqvU3BW1959QpWq7PNtUs9OEyR8U0sV4cY=@vger.kernel.org X-Gm-Message-State: AOJu0YzUroB1XWXmOTJOsMau4IETTQUKU/7zdAUSOoIf0PXTQwpRYD0M GQCBr3KYKBmkj+wI/Neg2JCYUwfPO3/I9jn4G56hgCAUYfEfds4EypB9 X-Gm-Gg: ATEYQzwhpDzfUi6IyyebtffELvxh5NeKPDkfquaQH2O08I/tsyU0D6j6BEVVyDvSd6A mjwlRnLdLt+RRT9sVStCbOV8tuUeYBkgGS3+uV7X49kkMHEQhajvAUNCTCI5qegzmT+ADPbGBZ8 fdHmIqAr6ORYsO9V7T6lWxud9ZWCeP1i3zG3Qyg3R1ugqsi/hteyJW8e8p3WilZ4tkPbv6iMnZX 3T++dfQcQpF+agM83ezxZaCwPUkmkJ5Y9bC8kg1yXZhvVcejgcWfIcSWQnOslYIuomuyj/+eos1 jJSYa3MfLifWpXN/VboMltOqKQhzYlAnm9ayf3rHY1nCHYlCQOaeH5AgFnnNtB8u9VyHOXp+3u5 uPIlW612dTON0IbJtZ2rEYyN0UPjiZuToW8i2tUavguo2RokFfpx4QLJVsYZ9ZLlqhFj/vlCV4T coBq/j8Rys0NvcXKdniClM/lTg/eqyXU2IqIGXndcvQLOdg8QJN+fda6NHfuJRsmpO7LjzOlBpi wY= X-Received: by 2002:a05:7301:3d10:b0:2c4:61be:1d33 with SMTP id 5a478bee46e88-2c930e6bcfdmr2226102eec.6.1775072555175; Wed, 01 Apr 2026 12:42:35 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:5f38:4c97:ec41:caa0]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2ca793eecd1sm540639eec.10.2026.04.01.12.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Apr 2026 12:42:34 -0700 (PDT) Date: Wed, 1 Apr 2026 12:42:31 -0700 From: Dmitry Torokhov To: Lee Jones Cc: Matti Vaittinen , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 2/2] mfd: rohm-bd718x7: Use software nodes for gpio-keys Message-ID: References: <20260324-rohm-software-nodes-v3-0-edde5a0324d5@gmail.com> <20260324-rohm-software-nodes-v3-2-edde5a0324d5@gmail.com> <852bc121-3d7b-42bc-9a99-cd226e8bf3e0@gmail.com> <20260401105930.GL3795166@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260401105930.GL3795166@google.com> On Wed, Apr 01, 2026 at 11:59:30AM +0100, Lee Jones wrote: > On Wed, 01 Apr 2026, Matti Vaittinen wrote: > > > On 27/03/2026 18:10, Dmitry Torokhov wrote: > > > On Fri, Mar 27, 2026 at 12:55:55PM +0200, Matti Vaittinen wrote: > > > > On 25/03/2026 02:54, Dmitry Torokhov wrote: > > > > > + > > > > > + node_group = (const struct software_node *[]){ > > > > > + &nodes[0], > > > > > + &nodes[1], > > > > > + NULL > > > > > + }; > > > > > > > > Hmm. I suppose I was not explaining myself well. When I asked for a > > > > temporary variable, I was hoping to get rid of this syntax. Something like: > > > > const struct software_node *node_group[3]; > > > > > > > > node_group[0] = &nodes[0]; > > > > node_group[1] = &nodes[1]; > > > > node_group[2] = NULL; > > > > > > > > would look more familiar to me. Well, I suppose I can live with this if it > > > > is Ok to Lee though. Let's see if he has an opinion. > > > > > > This is simply a compound literal, part of the C standard since C99. It > > > allows skip explicitly declaring the dimensions of the node_group[] > > > array (which is "far" away from where we initialize it and it > > > potentially may get out of sync). > > > > > > We have quite a few in the kernel, DEFINE_RES_IRQ() and others for > > > example are compound literals under the hood. > > > > Yes. But ones I've seen have been wrapped in macros. I don't think I've seen > > open-coded one written directly to a call-site (although that's what the > > macros end up). Hence, this is not something I see typically when reading > > drivers. > > > > But as I said, if this is fine with Lee, I can live with this too :) > > My personal preference is to avoid the use of compound literals for > structs inside functions. > I assume use of macros like DEFINE_RES_IRQ() is still OK? Thanks. -- Dmitry