From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 9ECD634402B for ; Thu, 23 Apr 2026 21:41:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776980479; cv=none; b=daNiUGMue9/oxnW248xfQEDKB30lS0+lP1zhRVvxrDRS2gWBJKzV4mtUpKngdVIxpAfylWgJYHOjo4YGFxkE5zSR2L4L+vkigVjf5H2Gk2ZvOGzPpXesIhWGsfYTDUVjFVeXkXi4tBDmalq0IjNftn0l0YmRqvSiiru3oxp3jiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776980479; c=relaxed/simple; bh=JEKsVBcRrDVMqqbEs7/mfp7dXa3KIoMMkKfmuqiHclA=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=omz1s+59mCDiWzL/9hH7YnijqEJxPhT2CJ3SImlaI0CvLmrEOfPWdyxQlyssqEe9E9exNlp3fdCZTKNEtOEW4b8vzscVx/ysMfMQRCNJ5JW5kjW5Ez5cP6hJeIxnYYM3qxV9/LsaikeN8ZduSd7hgMlk6U08t28/5nsGXvaiSAw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dGt1z0Bb; arc=none smtp.client-ip=209.85.128.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dGt1z0Bb" Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4893940bb5eso32345485e9.3 for ; Thu, 23 Apr 2026 14:41:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776980476; x=1777585276; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Rqvuiv9xtBmAtPWBpCuwRI/0uOECtqSe1ZKpqdrsv0M=; b=dGt1z0Bb6OCe4GXdGDr6aS37EcNhZY90lPrto8aEpcG1zcBkMQJAKgwpAfnDsuWpAc xGEA11WQiyk7qswzig4UYpB3P/EJsOfzCf6E/JC8AdxYUVMjfodAglvhmjZXSxREXMpU ycw4Mc8vRvrPV8sONdOm09uFzZNBjdXiaDSRCL9qJ0uaFmnkWl3eZS5WZqTYxvXqC6vP VtUSZb625EPMp2lMBI/bTpMcG+So0mYbt9ewEniSnjpv5qoG86Uab73K2VGw+px64l6R p+Fpp3aBwgtt/slWoG0V10Gh1Jf7Dy9AuVt/3Ha7Mf6dVImzl0UB9Visumg/08z9KVLJ MOrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776980476; x=1777585276; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Rqvuiv9xtBmAtPWBpCuwRI/0uOECtqSe1ZKpqdrsv0M=; b=Bo637znm4XW6J3hW5s0H3g3G3QXBSalWkRCY7NRVudZiMCHZrkgu1S9BQH2mPExUPu 9yY5gUBQc1jtApPAPJgMEp9LkdcNhFBkjXAVzCqjqkuO8Kj7rywxn7aMRN9Clb+k9SxQ 39wefRuo5VUftGkQJVchUrjDgEvDENu9yXLyg2SwWdIYDEurbEYDsEmIK9Hbe55F0M7t MOYdLTFkhoXQJWWyajSM3b5aX4mKCspaPWeSniGOCU57fD//5hspvzgSqKDUOyEnmgd9 YvB1gV5u12Xy32dUIdL+KvOg9eajAoMSc7yBzfPBLbCNAn5nCN5ew1Mgub0WZkV6sspm 9saA== X-Forwarded-Encrypted: i=1; AFNElJ8lMSngNqf+3WchuE3yG9ePt86u5YsNLDs2cHqYnCC7Yyuiq7a9Lv+6pClR6UvLjPtcdpqLWFQ1Wt/n9p8=@vger.kernel.org X-Gm-Message-State: AOJu0YzJoC/PvWQBToXjeUVvdQidSBKeNKFk0H9nPJ375VeKrGyJkuyw ykD7APJMXJHTMH2Zov2CdMxZlbc6iE2r13hPQq2jv8YcQg7pDD2bJCeI X-Gm-Gg: AeBDiev1SUS4DUk60PEZMfcm9fsc3zvpTRZMuhRf7Pw5gFaDgZG3O6yDOTMviWm7o3n RglTGKI3d4Iw1R4o7o4aKLQPJyxuZH06PcLa1r+8kybbG6nh/VsaFcFO2MTTyyL53r/v++Jpj+0 UGJrRdQ55DF7VrYuKZZ6wG43yUF1WCCr2EI5UibRHkGZ9c7mqVQz1lfAYvg3x8JBYbS9pP1PkHM PG3YUALWu7TaMP+VTm2XfooBRtRGj/xO3CJcOGRrKuEh4ZoUB6MguE1aGc+7Rk/XJ9yt9+LMcr/ 38BGxra4KIf+7EWB2n2UR8hGqhxzaNApCDW68RFRw3qpua1W5H75DNnZ7gtUU1FJl+vWP3TB0Wq 37TYpQ3Dv5i1mY6C+adUqS5k9j2cXifo89nBoBhKj7r2ICcOZrhGZV7Lnn0zSBmt+Yu7v6IDRYq R+/kDMzYk0r+SxnYRvx09pMC5MmnSzSI03LDxJ8ujRQcUK/Lc0pl6fJBMV+Jvi5dL8ZnTnO/1oC jU= X-Received: by 2002:a05:600d:8454:b0:48a:5970:2003 with SMTP id 5b1f17b1804b1-48a59702216mr106747235e9.3.1776980475822; Thu, 23 Apr 2026 14:41:15 -0700 (PDT) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-488fb75a913sm166466805e9.12.2026.04.23.14.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2026 14:41:15 -0700 (PDT) Date: Thu, 23 Apr 2026 22:41:13 +0100 From: David Laight To: Nick Spooner Cc: hansg@kernel.org, mchehab@kernel.org, sakari.ailus@linux.intel.com, andy@kernel.org, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-staging@lists.linux.dev Subject: Re: [PATCH v2] staging: media: atomisp: Use str_on_off() to fix Coccinelle warning Message-ID: <20260423224113.643cddc5@pumpkin> In-Reply-To: <20260423194727.3200344-1-nicholas.spooner@seagate.com> References: <20260423194727.3200344-1-nicholas.spooner@seagate.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 23 Apr 2026 13:47:27 -0600 Nick Spooner wrote: > Fixes the following Coccinelle warning reported by string_choices.cocci: > > opportunity for str_on_off(on) > > Signed-off-by: Nick Spooner > --- > Changes in v2: > - Include "media" in the subject line. > > drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c > index 4026e98c5845..322eca4a3755 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_gmin_platform.c > @@ -13,6 +13,7 @@ > #include > #include > #include > +#include > #include "../../include/linux/atomisp_platform.h" > #include "../../include/linux/atomisp_gmin_platform.h" > > @@ -917,7 +918,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on) > return 0; > > dev_dbg(subdev->dev, "Setting power state to %s\n", > - on ? "on" : "off"); > + str_on_off(on)); While someone went to the trouble of adding the 'helper' and the Coccinelle warning; I'm not really convinced it actually improves the code. It doesn't even do &"off\0on"[on_off * 4] - which might be an excuse for a helper. David > > if (on) > ret = acpi_device_set_power(adev, > @@ -930,7 +931,7 @@ static int gmin_acpi_pm_ctrl(struct v4l2_subdev *subdev, int on) > gs->clock_on = on; > else > dev_err(subdev->dev, "Couldn't set power state to %s\n", > - on ? "on" : "off"); > + str_on_off(on)); > > return ret; > }