Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp349197rdb; Thu, 21 Dec 2023 10:50:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVkqgNEYJ0al4hmpCYb0dIpQXbGEU8geUVIKpv3YSB+volZ9A78utOqxTAqztMEhTdhe3w X-Received: by 2002:a17:903:606:b0:1d3:f8ca:754e with SMTP id kg6-20020a170903060600b001d3f8ca754emr91033plb.26.1703184650004; Thu, 21 Dec 2023 10:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703184649; cv=none; d=google.com; s=arc-20160816; b=ByCwCw5QwV7MmuoZZJq2FM/SD4dCxdL0rDAm2B3nA4JPiRkcMDoXuzy4ToftkuoZeY fhwlqmd0/ECVeEg+vqA+TOHpTNV3s00CFNUf+jnUnZ3S8YRxkP6NgsRzbni8f3Dr9llm bj4ms7zhvxFOI7RJG3SMkLoyuuOTEHUNYHvD6xMAr/+my5KOAjkztJKvb9PAYwBmQ8u0 0S+Cv9vB3eHtivLFRHo4hS4efEQwpQxAUAsFeJ6GD5gRvH12wOXelPMXceHWUy9Mrsu5 R+dAQiNwDesGYQZNwKCQEYeLvYn+MfOQQyZNiz8Gb0P1PFPxjTevJ1Nhxbxtgstl00xi Q1PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=tOmKqIn6W7z+rgmBQ78sMx0aZEwQC8hdhsv42OVTCrs=; fh=NA2IZTsBFwjREUcds8Nt2e3faPWWUm3ShfnoxYpp9Xc=; b=nCh0dnRFXbXuhLKC6oAO7SW0b91R4WvVyZHrTkZBmtDPG6+EvrGjJhYQZLXqaITo+6 1W8VzwUOK++SPY7DwArn+ifRGsEUI5M0emA6aM75QUo8PvjMac5wuPXYlJLWqm1Vfzw0 cXE9ulk3+qGMKZAINriGIeHOAjd5Jk6eXtU1eNnFkobrSNx6optXpE5hV6kRt6HVY9Tr PD/DXaggqKxh+E6p/B6URKD9cqeYkS2fjwesXVsM0kYueGlVv9hVQJaLqw0lEXGj6CuM ECA7y8Ypbw9UB4K+6xox9IW70pqlQuz7rzPhSga/3+3uL4PyMFSBNzSHDqoB/NXyPw2G naSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="ouzU/g0P"; spf=pass (google.com: domain of linux-kernel+bounces-8953-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8953-linux.lists.archive=gmail.com@vger.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 o1-20020a170902d4c100b001d39babcf08si1343753plg.431.2023.12.21.10.50.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Dec 2023 10:50:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-8953-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=@bgdev-pl.20230601.gappssmtp.com header.s=20230601 header.b="ouzU/g0P"; spf=pass (google.com: domain of linux-kernel+bounces-8953-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-8953-linux.lists.archive=gmail.com@vger.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 A9AAB2835AB for ; Thu, 21 Dec 2023 18:50:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 705A8651B7; Thu, 21 Dec 2023 18:50:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bgdev-pl.20230601.gappssmtp.com header.i=@bgdev-pl.20230601.gappssmtp.com header.b="ouzU/g0P" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) (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 636C065191 for ; Thu, 21 Dec 2023 18:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=bgdev.pl Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=bgdev.pl Received: by mail-vs1-f43.google.com with SMTP id ada2fe7eead31-4668c57cec8so128200137.3 for ; Thu, 21 Dec 2023 10:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1703184627; x=1703789427; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tOmKqIn6W7z+rgmBQ78sMx0aZEwQC8hdhsv42OVTCrs=; b=ouzU/g0PxDkJObI+xeDj58zkEPfto/ASbdxyXGldGSCuKwhSwJSbwHRZxalWbDgsDs LaV3SGtZSIPducWBbu0ujdGbkO9sX12Egxx+Q3ivEorOuGvj5QWD2tuMn8ZyimgHCnRJ MXqaTCGoDnu0l3XyuBwIbsymCr99GXHXrx3PBfy45WzSBE7K0OM80tn7UbqWcdcwg0jY /FskD8FoOTRaSGPoRJqTguorTSMx4vC9IR/zUYbtOwSSawRouyly6VaeWJGH9iSRzdzG +ICPRzL1cc9127QqGp16tGmbNKd7Nu+FkvmRmh6Mvk4KI9OgNSBZaFzovZ4NnuDxnpnu A7jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703184627; x=1703789427; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tOmKqIn6W7z+rgmBQ78sMx0aZEwQC8hdhsv42OVTCrs=; b=Lh/sZZ+7qS/9Cuwic72hMMlP/H3Ulg5FoT222mFSkIxxN4Q0e83QB9CewZnqpI3Jt4 E+YB6bsNidSpZz2iq5eq5o6gcgSag/rxbv09wRKY7FA2iSjMggKRd0gGdZtYD5+f9R7B v5CBKWkKSsfL1nJIIhI+TfEsDf2m3THHqfEuO1qYU6gBbMDdng+iFDwzPQY9hmFAR2Tz Q+ZceHV4GLvRlKuEkc6X8Nc/6Tv/AvGFSue8zek6ncD3aFh2He8h1yewkVpp/DNcLhoH MRzZXInFE+sgk3iDklj7OQRy7eBjvFLkUlMiH+W9V3gjIHkqPkxcKsGyjI/FhQgDu6va xXyg== X-Gm-Message-State: AOJu0YwzS/Cmc5S+Sz6TUgQLeoP/OFi4CfH3Eldy8Nd5hwo2dtYFs/QM bZ4H+p1KOQICo3cNTakvZj2Uv7/pDby8czFeP2YE/7POG7lbsw== X-Received: by 2002:a1f:72cd:0:b0:4b6:c299:4a8f with SMTP id n196-20020a1f72cd000000b004b6c2994a8fmr75309vkc.5.1703184627299; Thu, 21 Dec 2023 10:50:27 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20231219201102.41639-1-brgl@bgdev.pl> In-Reply-To: From: Bartosz Golaszewski Date: Thu, 21 Dec 2023 19:50:16 +0100 Message-ID: Subject: Re: [RFC PATCH] gpiolib: remove extra_checks To: Andy Shevchenko Cc: Linus Walleij , Kent Gibson , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Dec 21, 2023 at 5:13=E2=80=AFPM Andy Shevchenko wrote: > > On Thu, Dec 21, 2023 at 02:00:39PM +0100, Bartosz Golaszewski wrote: > > On Thu, Dec 21, 2023 at 1:52=E2=80=AFPM Andy Shevchenko > > wrote: > > > On Thu, Dec 21, 2023 at 10:26:03AM +0100, Bartosz Golaszewski wrote: > > > > On Wed, Dec 20, 2023 at 4:28=E2=80=AFPM Linus Walleij wrote: > > ... > > > > > Defining DEBUG makes sense to > > > > enable dev_dbg() messages. > > > > > > Exactly! > > > > > > > CONFIG_DEBUG_GPIO is used by one driver > > > > > > By all drivers which are using pr_debug() / dev_dbg(). > > > I am using it a lot in my development process (actually I have it ena= bled > > > in all my kernel configurations). > > > > I'm not saying we should remove it. It'll stay defined in the Makefile > > and remain seamless for debug messages. I just want to get rid of that > > ugly extra_checks variable which has very little impact. > > I agree that extra_checks is unusual (or as Linus put it "non-standard") > thingy. And I agree that removal is for good. > > My question here solely about that WARN_ON(). Do we need it always be ena= bled > or not? > I think it makes sense. If you're freeing a non-requested descriptor then you clearly are doing something wrong and the system should yell. Bart > > > > to enable code that can lead to undefined behavior (should it maybe= be > > > > #if 0?). > > > > > > I don't know what you are talking about here. > > > > I'm talking about drivers/gpio/gpio-tps65219.c and its usage of > > CONFIG_DEBUG_GPIO. > > Oh, that one should probably be > > #if 0 > ... > #endif > > or > > if (0) { > ... > } > > -- > With Best Regards, > Andy Shevchenko > >