From patchwork Tue May 7 16:27:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13657459 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C79E0C10F1A for ; Tue, 7 May 2024 16:27:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=YQW9nKVYWLAlTneeBCiw6Zcl6tMRyRyAYPeoayHtKhQ=; b=pbksoH8v6BZkhY lnI+dsWJ7mM5SqkZiI7yjju5eejWfxE02lNXnDGHXnV9+NzjKPiOf/Lvui6npe7k5MOj5FNTPGovd TPiWmXfn/+Z3MeJHlTHqSsInCO3Mo3MgwhUolNpwdiO6QzQzC6Z5jDn4upV2HwkT83nxur4+I5Ie7 D4T1uDvL7TJv9xEDSrggR22+Uw38CkYYMWp5mx72mTcWjPi9Csg51I+4YLT13s/r2KmpmxIATJt73 T64d94Vd8zglEi1qa+2Gq8tEHCNeQA4bPRF3fggYNgASMKb8BfmYUmHencAKXGaFVGv8M8jkhrucC iEl50TMblTnuLxpahyyA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Ney-0000000Bxbh-2cyJ; Tue, 07 May 2024 16:27:20 +0000 Received: from mail-oa1-x36.google.com ([2001:4860:4864:20::36]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s4Net-0000000BxTD-214S for linux-arm-kernel@lists.infradead.org; Tue, 07 May 2024 16:27:17 +0000 Received: by mail-oa1-x36.google.com with SMTP id 586e51a60fabf-22e6b61d652so1693328fac.0 for ; Tue, 07 May 2024 09:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1715099232; x=1715704032; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2A/cdtQJ5ubVGGh9zBSnEjfvf8aW68DShS0IQqplaqg=; b=l2Ky9uzeMSsaJ328bLdnkno3qC2amSZ7Piuz87rJgrD4V5uo8Irme/z3tK694rkWx5 wdJg/BU8Ok+kpXAg5Ykiav0cvw3JaXmZAbAwec4WN126jAV/fmaV5S8Wz2zJLnB809fo +K8WciWmLpiTJeVoojt3fyLRv0TptvW+WXcT8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715099232; x=1715704032; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2A/cdtQJ5ubVGGh9zBSnEjfvf8aW68DShS0IQqplaqg=; b=kPTchr+CxWUR/7IGS0jaf/pkBHpHbJfq0ban5bJkMLa/SGll/yh2NJB+97nCDbdSrt Ul8q+FjDCocKJC3PoLGZWdpMX9BcbCOEnmyuHqCMn2emQqyHh1DVVO/3QF4ZLBc3AByE j3oPtj/L6L5spHVDm8SXsam35L5ubWgLOCJjw4IJW6m23e7jkwnJCH07chWclbGeeQNg /qQjufYXMGYd4OqCZgk9suwlGd7LAbitYAChjie9T9eDzXuU9ayXWvTanToS9VZE79vr Si5v388of006+tnGHG8z6hgQfEKhk0dVEUNJ+Vh4LO5shG6wvLhq6KGArYgK9h6wyCMJ AL+w== X-Forwarded-Encrypted: i=1; AJvYcCV9GWFkv/K85Gj84SR7d33DYV1Z9hH7nZJ4OkNAdGSMLbRPsAUEv7mHRRZXWOaK9cq9IZuNzELXBOdELL5gjdh7kIk9rS871gdVHMUKRd42ObImyp8= X-Gm-Message-State: AOJu0YxPAoaT/FPLlVZD48fPBsZBaJz2Dxe5EaFflaCpRwb6Q2SsEKgM f7yLYBNoRPrRlUwfnGGtw6Uh/6+nEs0Bo6EJebMj8JPmBPU47EKCtVhxcIWIUg== X-Google-Smtp-Source: AGHT+IFNJz8W2TliqlWnVCfeJU7sKKv7snchkh8btiT9U1bG50pXZSjddsLAAbR+Un47VkXMoaVYdg== X-Received: by 2002:a05:6870:e998:b0:23e:b42a:499 with SMTP id 586e51a60fabf-24097bdf8camr109598fac.2.1715099232296; Tue, 07 May 2024 09:27:12 -0700 (PDT) Received: from denia.c.googlers.com (114.152.245.35.bc.googleusercontent.com. [35.245.152.114]) by smtp.gmail.com with ESMTPSA id hf23-20020a05622a609700b0043d1fc9b7d9sm4160597qtb.48.2024.05.07.09.27.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 09:27:11 -0700 (PDT) From: Ricardo Ribalda Date: Tue, 07 May 2024 16:27:08 +0000 Subject: [PATCH v2 03/18] media: dvb-frontend/mxl5xx: Refactor struct MBIN_FILE_T MIME-Version: 1.0 Message-Id: <20240507-cocci-flexarray-v2-3-7aea262cf065@chromium.org> References: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> In-Reply-To: <20240507-cocci-flexarray-v2-0-7aea262cf065@chromium.org> To: Michael Tretter , Pengutronix Kernel Team , Mauro Carvalho Chehab , Laurent Pinchart , Michal Simek , Andy Walls , Stanimir Varbanov , Vikash Garodia , Bryan O'Donoghue , Bjorn Andersson , Konrad Dybcio Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Hans Verkuil , Ricardo Ribalda X-Mailer: b4 0.12.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240507_092715_596190_F1375F7E X-CRM114-Status: GOOD ( 14.25 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Replace a single element array, with a single element field. The following cocci warning is fixed: drivers/media/dvb-frontends/mxl5xx_defs.h:171:4-8: WARNING use flexible-array member instead (https://www.kernel.org/doc/html/latest/process/deprecated.html#zero-length-and-one-element-arrays) Signed-off-by: Ricardo Ribalda --- drivers/media/dvb-frontends/mxl5xx.c | 2 +- drivers/media/dvb-frontends/mxl5xx_defs.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/dvb-frontends/mxl5xx.c b/drivers/media/dvb-frontends/mxl5xx.c index 91e9c378397c..a15c0438b07a 100644 --- a/drivers/media/dvb-frontends/mxl5xx.c +++ b/drivers/media/dvb-frontends/mxl5xx.c @@ -893,7 +893,7 @@ static int do_firmware_download(struct mxl *state, u8 *mbin_buffer_ptr, status = write_register(state, FW_DL_SIGN_ADDR, 0); if (status) return status; - segment_ptr = (struct MBIN_SEGMENT_T *) (&mbin_ptr->data[0]); + segment_ptr = (struct MBIN_SEGMENT_T *)(&mbin_ptr->data); for (index = 0; index < mbin_ptr->header.num_segments; index++) { if (segment_ptr->header.id != MBIN_SEGMENT_HEADER_ID) { dev_err(state->i2cdev, "%s: Invalid segment header ID (%c)\n", diff --git a/drivers/media/dvb-frontends/mxl5xx_defs.h b/drivers/media/dvb-frontends/mxl5xx_defs.h index 097271f73740..3c5d75ed8fea 100644 --- a/drivers/media/dvb-frontends/mxl5xx_defs.h +++ b/drivers/media/dvb-frontends/mxl5xx_defs.h @@ -168,7 +168,7 @@ struct MBIN_FILE_HEADER_T { struct MBIN_FILE_T { struct MBIN_FILE_HEADER_T header; - u8 data[1]; + u8 data; }; struct MBIN_SEGMENT_HEADER_T {