From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48]) (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 0348D1DB15C for ; Wed, 15 Jan 2025 07:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736927295; cv=none; b=h8QtJIjZ67OUY+q76NEKS/FQkkYUb4/8P/PV8RJOP5toxbkf2rjunrz7jW1C/iDlPpAxupFoLRG9U7bmxVasx2pZ6fAzgQr6h/zHox0N3N9yLrXAIWQM+7FUNOJTgk5BbWuk7PBg++0W7CVhhUVLmjzFfttYdaB0rKngD6IOEfM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736927295; c=relaxed/simple; bh=LfjITparxecmgs/OMSXQDhOgSUALhQ5AtLzIE6/vce4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nU2D8y7PjCPqvNSrikuvs2pqw7xeITogB9x5wAFZxkPnEz6b6ZYatXEJKLGrFNj5RndnEO+lReelDhWJwHA/vxEn5uTC8YTeGgDe0F4rwHW1PYAxynod5MNNDT8drbXO0fVlV5Z4FIhhgT9HHnjN18w3AouICiGS/HnrB3iBJQs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mH7AoF70; arc=none smtp.client-ip=209.85.208.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mH7AoF70" Received: by mail-ed1-f48.google.com with SMTP id 4fb4d7f45d1cf-5d932eac638so12315815a12.1 for ; Tue, 14 Jan 2025 23:48:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1736927292; x=1737532092; 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=ECOn+cnCIb0Bi7+W4OWUT6XQNCiNMEF2qI8394m/Z0A=; b=mH7AoF70sjgQkYF299YUH4duMJCLBT9pYg6AQvaXO/FxRCbFkG1U3HOXZ+JBjpYXFN 7gyI4XrBOAmIuHcpYrBsmikVBXbeyrgZA4GnwP7IeoWV/dVOvRrYBKA4kOgwGZVE8Ovj UiniafcztvZl1nOJZQzp7CiVbQK7nkD0+TrzA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736927292; x=1737532092; 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=ECOn+cnCIb0Bi7+W4OWUT6XQNCiNMEF2qI8394m/Z0A=; b=j3m7KFJA6+Fc5rOoZgBBiGfqDY9XbV55SilG455gu/o8BtReF34SgoT06AFuBpi+Fj pZz9gzMQkmeXaXj57COXZzm+CDnFMOalLU3uGtw7jk1ToRD+1MjzOetQpSPegzLGQfzv tGmhcBjpOxmMO4+RVgSOGKBL3C8ZW1qaUwObrTvKOUeXoPRh+9jx7wwKoNHI0G8EGw32 clOd0ocI+SMn2J9nzt+yFl4pzzYip3VShjEUwali3EW2Obii9gGPbNQ4pPzLXsjtG3tt nbkbQPD3M2wiYXMEfjnZm5V+ZlFc3J0tt0k/anhTYWsZJufK1ADQN4OHI+FPS3uaaCmk G1Cw== X-Forwarded-Encrypted: i=1; AJvYcCUSbhllD9kgn/vffXh8cwLulBZHMQBtFx+TZHJqbc0cs3+rM3x76QtsoVIDjIaHsSm9wWpmM93amlG367o=@vger.kernel.org X-Gm-Message-State: AOJu0YxTzBGMIZW9MA/sde2RllALqykLIlP2mkzaOEb9QBk9I7wTc3aK wBuH2AymG7uVEnYdA17cvvFrmOieN/98sNoL5epWutfObBGTwbkA5Q8TTl/ux0K6r6wN2C7oZPm 1uQ== X-Gm-Gg: ASbGncvsyJyMm1APCdj5K4Ln2DRT86wsveZtly9kQxMnY/Lbvdg4jExIxfjf1ZZR18a j48PtIZEKdbkgHcXeyge1DcyA3ZfOiD6MpCJwzcf1wNRC/FokSwDYCsvO9HAoixwaidKecxeG7y gsq8arNA5tB/HCfTd48/7wJopkhgLr23ouDbWQHo05+kW2VcV+F2qg6UBu8gG0SqG1b4T5wsRcv zXXaCMS6JIxZMKg9W0b8D+k/MbV9A7SsF8c2DrMTzyT1s+vKddjk4CmJ+gdV2RbvrGINRMMu539 61nyeI72NoXlHN4h X-Google-Smtp-Source: AGHT+IHx+FB5fAziYdFVurB+pLlfdrLMkfnjDmeMzAELxxGV40Nke/hspt/I+0X2cdaKJPUjdsAM5g== X-Received: by 2002:a05:6402:35d5:b0:5d1:2440:9ad3 with SMTP id 4fb4d7f45d1cf-5d972e703e5mr24610958a12.30.1736927291858; Tue, 14 Jan 2025 23:48:11 -0800 (PST) Received: from mail-ed1-f46.google.com (mail-ed1-f46.google.com. [209.85.208.46]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-5d9904a4d49sm6826486a12.78.2025.01.14.23.48.09 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Jan 2025 23:48:11 -0800 (PST) Received: by mail-ed1-f46.google.com with SMTP id 4fb4d7f45d1cf-5d9f0ab2313so16167a12.0 for ; Tue, 14 Jan 2025 23:48:09 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVQDKtoViWAaq+DVwcum6FGsoQzxdDqkZ2+1sr198qpt2YBs0afCKpBtJpzqI+mc5F/kRBYlCqWrF38Asg=@vger.kernel.org X-Received: by 2002:a05:6402:419:b0:5d0:b20c:205c with SMTP id 4fb4d7f45d1cf-5da0dd88945mr41288a12.5.1736927288927; Tue, 14 Jan 2025 23:48:08 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20250114-str-enable-disable-media-v1-0-9316270aa65f@linaro.org> <20250114-str-enable-disable-media-v1-5-9316270aa65f@linaro.org> <20250114204240.GA29414@pendragon.ideasonboard.com> In-Reply-To: From: Tomasz Figa Date: Wed, 15 Jan 2025 16:47:52 +0900 X-Gmail-Original-Message-ID: X-Gm-Features: AbW1kvY14DfSpnwTLqBt72p4pu76YvOiOANEOo0Q2EYntPgnjoz9_xaoOvLxMK0 Message-ID: Subject: Re: [PATCH 5/6] media: platform: Use str_enable_disable-like helpers To: Sakari Ailus Cc: Laurent Pinchart , Krzysztof Kozlowski , Hans Verkuil , Mauro Carvalho Chehab , Marek Szyprowski , Maxim Levitsky , Sean Young , Olli Salonen , Abylay Ospan , Jemma Denson , Patrick Boettcher , Jacopo Mondi , Kieran Bingham , =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Tim Harvey , Andy Walls , Bingbu Cao , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 15, 2025 at 4:39=E2=80=AFPM Sakari Ailus wrote: > > Hi Laurent, > > On Tue, Jan 14, 2025 at 10:42:40PM +0200, Laurent Pinchart wrote: > > Hi Krzysztof, > > > > Thank you for the patch. > > > > On Tue, Jan 14, 2025 at 08:46:21PM +0100, Krzysztof Kozlowski wrote: > > > Replace ternary (condition ? "enable" : "disable") syntax with helper= s > > > from string_choices.h because: > > > 1. Simple function call with one argument is easier to read. Ternary > > > operator has three arguments and with wrapping might lead to quite > > > long code. > > > > It's more difficult to read for me. > > I don't have any issue in using the ternary operator either. Using these > helpers makes the lines generally 3 characters shorter. > > > > > > 2. Is slightly shorter thus also easier to read. > > > 3. It brings uniformity in the text - same string. > > > 4. Allows deduping by the linker, which results in a smaller binary > > > file. > > > > I don't see why the linker can't de-dup string in the current code. > > In fact the functions are static inline so from that point of view I don'= t > think there's any difference. > > > > > I'm sorry, I just don't see the point in doing this. I'd like to avoid > > those changes in the Linux media subsystem, or at the very least in > > drivers I maintain. > > I don't have much of an opinion, perhaps I slightly prefer using these as > the rest of the kernel does, too. Yet if we choose not to use these > helpers, we continue to be occasional targets of largish patchsets "fixin= g" > this. To put one more aspect on the scales: These kinds of patches actually make it more difficult to backport changes (e.g. fixes) to stable kernels, so my preference would be to only use the new helpers in new drivers. Best regards, Tomasz