Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1273702lqm; Thu, 2 May 2024 09:43:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9fIMTkI5UQIRFQA7jMs4C33tD829266nnCmUpend4SCTTmK7vXBoN2YH2jt8AgjT/KkzyeDknEvn4OxJTHkWPECGd1XkqVfeGUvpMKw== X-Google-Smtp-Source: AGHT+IHXC8Brlng58FrV8aCCc9iQMDFWZZhxsrk8uRTWq+3i86Yo60zqojjk5Qk5wfEu/95B3KGL X-Received: by 2002:a05:6a20:4328:b0:1af:6a37:3b8a with SMTP id h40-20020a056a20432800b001af6a373b8amr299384pzk.16.1714668184079; Thu, 02 May 2024 09:43:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714668184; cv=pass; d=google.com; s=arc-20160816; b=Gm6id2qFgsvkNftpQ7/NAw5GzzGsbgR6EbIJZiyLbl9uAt4SIWYVr5/SiHh8CXi0o6 b9h8tqzteD4AtROTCYqBwawvgUA9YTEZ1Q81GFXYROMYzL8R3DjBVVLVcH0p70/nTGr8 vc2E3bxpdncAz0yWkalk5es0RsM4g3EriOe8TWbYVxxBWJHUpZ1DcNR0l9mG2uU4loaU 0plAtGkokwWl/wzBBRzMb9tS4FA9bVbD0hhWguv80lqprCPwUmt69itkzFiqkatScrMu kYHROq95V9lZLF4AShlRk7avNzukemuGUCIKSPQPAMk+ybXXMXz2p0K7NSlmEo8O764T TDgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=hXSvBSLTTNNdwvig97yzHVOhutaNR5W1a/0eC5+S/xM=; fh=ZgO28eZPKxynVKDME8lLAjkNqdTLBLEGFGbsDjbnjkA=; b=iNHOi2R/Ore2ziiDbSD/VqspvTjFbfcnDM0ZdnDW78fLcJt1k01bQwOy9lA43aprw8 DxHqtBFBN2/82FvbJIzJQoaV/hQcTzhy99KD/GzHx+DyScTyS6PcDmZSXF3cqmKm3+Wh AKqNrwMmepXcRWg476Q6EYIDHbNGQ5mCZHQ1AoLpcVO0+GfCb2/AqY+qkODoFg1xS9oy jEnxCgWJ03RFywhEiXslgn/R5X8cXjdwoTgv1NvM6vfjEctu8HQkDooKElK/yi1fNkwi JeDm/TbhjHWjwfCS1vceROgqLycL2KiqQUbEWJHqA2oxR1q/LILXZLBImwIXvrpowDBV mMLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TRjOtlaG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166740-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id fj15-20020a056a003a0f00b006ed5f889124si1359525pfb.133.2024.05.02.09.43.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 09:43:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166740-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TRjOtlaG; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-166740-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166740-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id ADDB3280CDD for ; Thu, 2 May 2024 16:43:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 23B4216D4CD; Thu, 2 May 2024 16:42:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TRjOtlaG" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4481928FC; Thu, 2 May 2024 16:42:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714668172; cv=none; b=Indq6ERGFZufeRx+7fKN/LVrnGQDPiiGSTGzhAdlsXIePIUCQYGJKHVzR8YID/SD8q+MTk/GiVqtG2oH9b0AFIbfyz2TRQ685AfwyhZtXhzH3iI27yFYmrcQAgWtA0xTus8aoB5ID2IBNgPEa6jXKU3C72wS1v8SoliLodUW7lA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714668172; c=relaxed/simple; bh=cj5bYAt98fbHNpOz6Lk3FAQsG3zOEVkQQT9pOnQDzFE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=V8895zxvNclFezriu1CEhxGdL+QF/MnQ1z7aoRPzYHMI9lIsOvNHvxDlHfUo00mqngwazPU+aWL0pjcumvUV72rGLNAFYQkX9PX8+sjEBBBidXLaXIUE+f+3fzDI4GB2vjZ2qQtt9Ei2jluHJbOLpIuGfhVhNgGrM94h1QrdVsI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TRjOtlaG; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA074C32789; Thu, 2 May 2024 16:42:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714668171; bh=cj5bYAt98fbHNpOz6Lk3FAQsG3zOEVkQQT9pOnQDzFE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TRjOtlaGF85tupGTKMBErbPBlfCZuvG+Nh2mzE7TWe4Bt5pvoN7vV2n6UboqGVGKH eqEK7yZtuGkH4lj5/US2yL9YCV10cJgn+Z4NEBngdaonz5aLmJ2kdKyVrnbtC0WgXd +glMCl04Yw4Rt4hfOoQTUCc/lSIDy6LCnIA432+0wAxrjVHFooZxsg+kXa18YQCOL3 BDrCR54yV2qZj5B90JJ+UL1uk/HlQUgwTLRyzIMkpt2V/FbiS+u5Pw7WUDSw0ZhD+1 vofVfAIvFf8n/BTeDKSM7GcPlT/lIqptFrtrfjM1qPWFd8lg1UiJvG/RmINGiEzty6 XnMZzUYpA+pSw== Date: Thu, 2 May 2024 17:42:44 +0100 From: Lee Jones To: Florian Fainelli Cc: Andy Shevchenko , linux-kernel@vger.kernel.org, Jarkko Nikula , Andy Shevchenko , Mika Westerberg , Jan Dabros , Andi Shyti , Jiawen Wu , Mengyuan Lou , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , Andrew Lunn , Duanqiang Wen , "open list:SYNOPSYS DESIGNWARE I2C DRIVER" , "open list:WANGXUN ETHERNET DRIVER" Subject: Re: [PATCH 2/4] mfd: intel-lpss: Utilize i2c-designware.h Message-ID: <20240502164244.GA1200070@google.com> References: <20240423233622.1494708-1-florian.fainelli@broadcom.com> <20240423233622.1494708-3-florian.fainelli@broadcom.com> <1d1467d1-b57b-4cc6-a995-4068d6741a73@broadcom.com> <20240502071751.GA5338@google.com> <6646b690-7b05-4a0e-a524-375b389ad591@broadcom.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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <6646b690-7b05-4a0e-a524-375b389ad591@broadcom.com> On Thu, 02 May 2024, Florian Fainelli wrote: > On 5/2/24 00:17, Lee Jones wrote: > > On Tue, 23 Apr 2024, Florian Fainelli wrote: > > > > > > > > > > > On 4/23/2024 5:00 PM, Andy Shevchenko wrote: > > > > Tue, Apr 23, 2024 at 04:36:20PM -0700, Florian Fainelli kirjoitti: > > > > > Rather than open code the i2c_designware string, utilize the newly > > > > > defined constant in i2c-designware.h. > > > > > > > > ... > > > > > > > > > static const struct mfd_cell intel_lpss_i2c_cell = { > > > > > - .name = "i2c_designware", > > > > > + .name = I2C_DESIGNWARE_NAME, > > > > > .num_resources = ARRAY_SIZE(intel_lpss_dev_resources), > > > > > .resources = intel_lpss_dev_resources, > > > > > }; > > > > > > > > We have tons of drivers that are using explicit naming, why is this case > > > > special? > > > > > > > > > > It is not special, just one of the 3 cases outside of drivers/i2c/busses > > > that reference a driver living under drivers/i2c/busses, as I replied in the > > > cover letter, this is a contract between the various device drivers and > > > their users, so we should have a central place where it is defined, not > > > repeated. > > > > I have always held the opinion that replacing user-facing strings with > > defines harms debugability, since grepping becomes a multi-stage > > process, often with ambiguous results (in the case of multiple > > definitions with the same name. Please keep the string in-place. > > I am not buying into that argument and the fact that Duangiang was able to > trip over the lack of an explicit contract between drivers seems like a > bigger obstacle than doing a multi-stage grep. Anyway, I have no skin in > this game, I just don't like seeing repetition and not stating contracts > between drivers more explicitly. Good thing no one is asking you to buy into it then. :) I'm not sure how or if the code that failed to match was tested or what went wrong exactly and I'm pleased that the bug was caught and fixed. However, swapping out matching strings with a define is a regression from a development perspective. One which I've felt the pain of personally in the past. I've pushed back on it before and I'm pushing back again. We're not swapping out matching strings for defines. -- Lee Jones [李琼斯]