Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1811330rbb; Tue, 27 Feb 2024 01:43:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWe90AN0MSUSSpeHeiQwyPmtaoR6aVt3BSB7e0F/ieE+N/YA05GFgk7Ma8CcarxNUnpLhhEF8IYkVUUlB7A6gNH6vQMxa5bbKRqcKvVvw== X-Google-Smtp-Source: AGHT+IHAmw1aJmy2LyEdv8w1LZ4DjQCcfHQ+9XFVpZIcCMSLAndNUluHVgdo4TE1F8J18VxBTrFR X-Received: by 2002:a17:90a:43a3:b0:299:5ad:cc28 with SMTP id r32-20020a17090a43a300b0029905adcc28mr8600858pjg.26.1709026982666; Tue, 27 Feb 2024 01:43:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709026982; cv=pass; d=google.com; s=arc-20160816; b=Idkj9Dkuwq9Q9db3PEOXUrRRMlsb3tJ9kS/nC+UVY4rjE+QsnhdhwK9CoS9nNmMo59 bvz8nsHXkNAm4KBKEHyWevZtL8FiWQZFay8WOo9SMgBSCdpeW7QsEpzdqw2NZWXvhM7j 5En8W9Cb8tOcwaUiTnorFxuP1mZtGO9sUN5WoyHHKKsb7hCPZo2T9emXqmF69eX3akRi UrfcaMnRCu4+KbAa+9dXW8BYpwfgmYW72woBtrAfym3vjHt72GZmmzLmxnqE4dfu9sHD PKknuntqNBxjWJictg+K0EKYwAJzbwKZxMvcdJpix26Ofuducd5M0XwkDAkoPVTw+CTE 6i4w== ARC-Message-Signature: i=2; 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=yHPFRl2mqSgcoxbtbCsPH8G6VO/2zl4zaTGrgQVkBF8=; fh=AQZBlUs0i6NAowKZf30goGB0qCrUHdorB+CgR3NvZFg=; b=R0e1UC8cMPMAL4mQPw1xKh+k5LCOX33C0DIZsbDWfNpSaxprL+6agwNzW6IVPN7uFc 0MXpY6HHtAGyof2wZPuhKjy2s22DrJsmH44OBgkxPG6+fW4hhCeSbVL9UkhYEiT8pDmA NYMfCia2urIHNBu2Ik0QGMt+3wwAAL8OsMdcK5G8/+BXn16RCZZcWJyLMeD332lWtRUR NKPPb8EeCTD/uVlINZ7ZIoI6SWAL7GKdVV7lmKxuoKbWVjks2PE8P2y0IzHlgjEUKRo2 HorsjBCYSKxwMwC2vovO3r1iXev39qwnVJHBsz1wRk5JsheWsoe2Oh2SNuBXl+CXWdHj ixJA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gkJES54X; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-82981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id a72-20020a63904b000000b005dcc8a4590esi5081165pge.680.2024.02.27.01.43.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 01:43:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gkJES54X; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-82981-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 3EE4128268E for ; Tue, 27 Feb 2024 09:43:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 08E17137C5B; Tue, 27 Feb 2024 09:41:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="gkJES54X" Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com [209.85.219.175]) (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 6DB94137C4D for ; Tue, 27 Feb 2024 09:41:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.175 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709026896; cv=none; b=TtX2QYKXIvUuI7yB5F7sYIdrZL9r6BXoI7xxN1K/8vO8XqH6LkxqE1Cwq5mvdCqyPPs0OceKfc2nStk9svopxwd3skJ+qc53J4tGGBhlO9H40idU9COtq6l/8D06mW2bkAwzwJND3nmO5lo7gdPe5BgPePHvOhGqhrRbQkPWcUs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709026896; c=relaxed/simple; bh=yHPFRl2mqSgcoxbtbCsPH8G6VO/2zl4zaTGrgQVkBF8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=fuQ8KRPwnrAhawnusmnLfLnR6YDd4c2MKmzDlag9wdH0Cnj/+U81Ujf3q7WY8m7J7Rnf773lYzyOcmbrMnZat8Z22rutV01/rlQc2axFaYVmloN0l5S1f/xwcfvIcHFwG5nAftgZcKJV3wRIsixOi3IPl0PX44f0hIHi4D/KSQU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=gkJES54X; arc=none smtp.client-ip=209.85.219.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f175.google.com with SMTP id 3f1490d57ef6-dcbef31a9dbso2002515276.1 for ; Tue, 27 Feb 2024 01:41:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709026893; x=1709631693; 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=yHPFRl2mqSgcoxbtbCsPH8G6VO/2zl4zaTGrgQVkBF8=; b=gkJES54X6z2V6FfkRt94mZbhrUhv3HDpu1mp9xSGhDjpD7QsqhEndJFC45VCxMmWhN xDxlQ6QAY6k3dK1qyBVYZLaekuHs7uKKqHFWWPyFBRYjBoXVpAiWM35vekbvOYUShyZT wp8M0OHdWkqVaLimEN2RXtsnvD3TB/3KpeqiXhETLJtrj/Aw2T6m0sF0cgzut9qZ+/Cf jVR55yYGp+xR7PBUing82MEGNrbaSnQquIDrhtu26fNkkdqyQogepxNIWuTWHTn3saRE WYW0YItsGIYRxXEYgeWjXt/VZeCIbqmlmY+eVSMrO+M3iCrixaiNX7OLLkzQxLz+P8kK sq3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709026893; x=1709631693; 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=yHPFRl2mqSgcoxbtbCsPH8G6VO/2zl4zaTGrgQVkBF8=; b=jC0WlRu+ljsgzuH6NGA9dhB7+uMQG4tIPuKO/kzpfoMNnrKwG5K4sdKxk2TEgvIVVs JRbaTqCGNSktBEzrytr23ds/D/4lLloBAUBXUViuc9OaOEpV8vfh9pXycSv63Wpub/9c znXU158TdZkFPPfScC8ei7/cL6KUCSRbeXJ/cdOCLOs+EQKkrZSUh49P3b9vP8hk5ijK NDnTEh/hneFhn+c9+MaKGmYo+L9Fx3ftXGEm/qYZph/UZa77HhcW/c9D0SmuZVuPIVsg Xn7zTLNqym7nf8yuKpmHFfFGV6a2mhPflLg043zZDmCdLJqMu9ycPaKtHf/nd6uzNu1J O66Q== X-Forwarded-Encrypted: i=1; AJvYcCUuAdgMAb9SntYbsSFU5UBQR/7crSs8XgVS9xFlbYgwEv/WmdGqIC5nk0MgBsDwoGeQ+5Dcrn5773uRfckDgVK4WLUAku8y759L1ho2 X-Gm-Message-State: AOJu0YxAa9Ud1N6IVgKzOGSZKqNhnrbCv4aLzRAQQY5vug1dJP/vDQ2o SSoDlQpRmZ+f6vDqDtj6U9aXmzxwRVMvcVdtJOq1hblByPAjeoz+1ROXmWKkEwn3/MQguMPTj3l arUzxlO6F7HpB+w/5hRXvtFn5IJfxpq2pKv8peg== X-Received: by 2002:a25:d60e:0:b0:dcc:3a3:9150 with SMTP id n14-20020a25d60e000000b00dcc03a39150mr1769321ybg.22.1709026893169; Tue, 27 Feb 2024 01:41:33 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240221213208.17914-1-andriy.shevchenko@linux.intel.com> In-Reply-To: <20240221213208.17914-1-andriy.shevchenko@linux.intel.com> From: Linus Walleij Date: Tue, 27 Feb 2024 10:41:21 +0100 Message-ID: Subject: Re: [rfc, PATCH v1 1/1] gpiolib: Get rid of never false gpio_is_valid() calls To: Andy Shevchenko Cc: Bartosz Golaszewski , Arnd Bergmann , 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 Wed, Feb 21, 2024 at 10:32=E2=80=AFPM Andy Shevchenko wrote: > In the cases when gpio_is_valid() is called with unsigned parameter > the result is always true in the GPIO library code, hence the check > for false won't ever be true. Get rid of such calls. > > While at it, move GPIO device base to be unsigned to clearly show > it won't ever be negative. This requires a new definition for the > maximum GPIO number in the system. > > Signed-off-by: Andy Shevchenko Looks right to me: Reviewed-by: Linus Walleij I guess it's related to the patch where we dropped and ARCH_NR_GPIOS because after that a lot if the semantics were removed from this function, but it's not quite a fix more of a cleanup. Yours, Linus Walleij