From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A79DE340D85; Tue, 9 Sep 2025 13:13:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.9 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757423595; cv=none; b=JWXD+vk91Ph37faCJF/I5J0qBhJcbyu/46isS0LyuA9N6Hqt1aDrxzSD5m4ZNcSu4ZL4JuTwzFOFyIau7cuxc/KPtc0RCRch0F4fQ7T7v5J2hTMVVevaeM044lJzYWlrikKviSk3FcLpAtFXaRWzJx2LW1Zx3stQLRJsjrX/B7I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757423595; c=relaxed/simple; bh=L6CwOVwYJN4Y/x7PmC4SNNIsn1PcLQu+MvjuP9uomWU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T2dyoFORnn1fttmBzhg1boMEPnqqU0wihWVfekorIZjP3A7KZ3FeBjoUj3l6sjsAl/ilFSmYqm5y13EbNp7HRRK6ecuugAvrJLOdvAJYW7foEjqFIkm3gikEhyyOCmvMryBf3ES/AMVRe5kGjB1np4N7rJfTs/Xyw9pOAjaFr8I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=lBTiLlyd; arc=none smtp.client-ip=198.175.65.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="lBTiLlyd" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1757423593; x=1788959593; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=L6CwOVwYJN4Y/x7PmC4SNNIsn1PcLQu+MvjuP9uomWU=; b=lBTiLlydhz6UG+xbO2+REzhWCYdJ6xubL1jpQd/sJNXdJ+9c56Rsfjxv E1YRfIpZU3iRIM9xXt0HpOi7a2TC2/4iSP9WDR91GrgU+FmXlMaMwQRrM 5N7dOAZSkE814/SCA9Vwa+IU5NFUwiO7UXUuh8MMjaJ3E838Kk5XA8B7X JL4JF4LkluYEIZFvu5AauksMWBfHKzijGMVmf7yBKgJZtdcmaAQg7pdyX D9NsW/AziOWdqlVWiR/PM+Nw61ybzkdnCQHKCdGv5U/s+q39ml8dSEMaD SITWSslEMOylt88zL9h7BZsIuMPHdcnENLTAW7HUWZRVW2bc2eeyPZ3kf Q==; X-CSE-ConnectionGUID: xmHsdx8SRxeI+rsQhOEFzw== X-CSE-MsgGUID: 0RyCS3CDRTOygfsGOQAXNg== X-IronPort-AV: E=McAfee;i="6800,10657,11531"; a="82295496" X-IronPort-AV: E=Sophos;i="6.17,312,1747724400"; d="scan'208";a="82295496" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orvoesa101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2025 06:13:13 -0700 X-CSE-ConnectionGUID: uvql51LsTAqr3Q78sqHnqg== X-CSE-MsgGUID: bZMIDd5nSnSWd1c35O6zLA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.18,251,1751266800"; d="scan'208";a="210237526" Received: from smile.fi.intel.com ([10.237.72.51]) by orviesa001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Sep 2025 06:13:08 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.98.2) (envelope-from ) id 1uvy9g-00000001Rlg-2b48; Tue, 09 Sep 2025 16:13:04 +0300 Date: Tue, 9 Sep 2025 16:13:04 +0300 From: Andy Shevchenko To: Bartosz Golaszewski Cc: Linus Walleij , Keguang Zhang , Alban Bedel , Doug Berger , Florian Fainelli , Broadcom internal kernel review list , Matthias Brugger , AngeloGioacchino Del Regno , Paul Walmsley , Samuel Holland , Yixun Lan , Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, Bartosz Golaszewski Subject: Re: [PATCH 13/15] gpio: sodaville: use new generic GPIO chip API Message-ID: References: <20250909-gpio-mmio-gpio-conv-part4-v1-0-9f723dc3524a@linaro.org> <20250909-gpio-mmio-gpio-conv-part4-v1-13-9f723dc3524a@linaro.org> Precedence: bulk X-Mailing-List: linux-mips@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Tue, Sep 09, 2025 at 01:35:04PM +0200, Bartosz Golaszewski wrote: > On Tue, Sep 9, 2025 at 1:31 PM Andy Shevchenko > wrote: > > On Tue, Sep 09, 2025 at 11:15:40AM +0200, Bartosz Golaszewski wrote: ... > > > + config = (typeof(config)){ > > > > This looks unusual. Why can't properly formed compound literal be used as in > > many other places in the kernel? > > It is correct C If it compiles, it doesn't mean it's correct C, it might be non-standard. Have you checked with the standard (note, I read that part in the past, but I may forgot the details, so I don't know the answer to this)? > and checkpatch doesn't raise any warnings. checkpatch is far from being useful in the questions like this. It false positively complains for for_each*() macros all over the kernel, for example. > It's the > same kind of argument as between kmalloc(sizeof(struct foo)) vs > kmalloc(sizeof(f)). Maybe, but it introduces a new style while all other cases use the other, _established_ style. So we have a precedent and the form the code is written in is against the de facto usage of the compound literals. > I guess it's personal taste but I like this version better. In kernel we also try to be consistent. This add inconsistency. Am I wrong? > > > + .dev = &pdev->dev, > > > + .sz = 4, > > > + .dat = sd->gpio_pub_base + GPINR, > > > + .set = sd->gpio_pub_base + GPOUTR, > > > + .dirout = sd->gpio_pub_base + GPOER, > > > + }; -- With Best Regards, Andy Shevchenko