From patchwork Mon May 27 21:08:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda X-Patchwork-Id: 13675823 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 C7B4CC25B79 for ; Mon, 27 May 2024 21:09:26 +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=uzC/BkGKhh2QZKZwNyn0cZYYyjgQEBFb679diV7C0j8=; b=Jt3CedTCMRagPd gAcsbH+I7OlAR8hv0g77/tDm5VdcbUhLx6nDbqKqHfSo7OHPTqN7sVk9Et9kudDiruWoWQilABsQD dcueTXwoSD//PGSAZft5EcGL2vkN1Lf1On/OVpCVEE4v+59pezq+3YZzLHDGo1PEJz+6fCO2eEAUX j90OrOS+KZpgxmM53mBWQA1NklLFJpVKX2DGuqrPyQ49x7CYzpJ8DmZ/7zi4eysnURyQml8usUKNX kmBaljd94jCWVaViewF25AM8BPT4JsmY/R13uyfz2oJB2UR0/jM8cBHLu/3xE4XmDLMcXZcuQEr1v btD+1FIuKMwc42ix4rqw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBham-0000000GKJK-3Da6; Mon, 27 May 2024 21:09:16 +0000 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sBhaU-0000000GK4M-26IG for linux-arm-kernel@lists.infradead.org; Mon, 27 May 2024 21:09:00 +0000 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6ab9d4061fbso593096d6.2 for ; Mon, 27 May 2024 14:08:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1716844137; x=1717448937; 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=fNIsU+/qEYhURt556sfo4PlTlUVRyNCactQuGIIVr1E=; b=YMG041IuoT+Sl/6HCmZxNBXcInpRu/58u0JHsaLH3dmdV9Wtz1LXKILziL6xoxVq1m 7O6GebXZlsbwR/slggcqgcNrJ373leb04ILL8DC8KMWRY3AJFm7tIfs+LyWrvckwkjgL 7YuA3+UusbGZ+wcHKli0lh3txB6w3uhxRrFDM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716844137; x=1717448937; 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=fNIsU+/qEYhURt556sfo4PlTlUVRyNCactQuGIIVr1E=; b=clKmrct1S3w15R2qF4QGcE0YTpwJL6p5K8Uix+w91vQ2aCh2ZQdq4js0YLzSAHW5za TM0ML8GwNQ7Wb2NnCK1oQsAmyQomOrc4yHv817vhWxHFx2AwUbTiBV1F+8PdN/SqxUZf ulIm0IdANFlzWxnTMZ0BSiz00Fqnuo6iJkOn/HPBsNw8Dr10qFxNHPkOfTIcQK289WYI ML4/0hYwbB2PmxyIXKjdTksJhvsGnBJo5ej77DM+EQJji8DUEvsDORg03wMBri74MOqp agQdg8ld6PyF3ku9KnRUdXXLM9FiMw9pcwKqTISEcQ86LaeD/YSXXA7nrGQvJh+B57K6 NzPA== X-Forwarded-Encrypted: i=1; AJvYcCWFScsO//nv0yKDXL20mKHsm7jV29CyW+vfKHBXEvaibIz2URbuUCCsRz+ouEXohz3CIw02GPpXzhmb52KoIYPQigLRzson6aazUor0vhb1kju5Br0= X-Gm-Message-State: AOJu0Yx79tUc+8UTvP1u8/hi0ljVioGM9Sqx06mQKhlaW756eQHRwl3M 3e84uPIWrNnG3DqStJeeYvRtnQwprykci2iL0uk2xuoq3+gZWDWSGC8CTcjk3g== X-Google-Smtp-Source: AGHT+IG/WggJVCTkvsROl4Irbm8iKAUgklmicuyvY5nd4ATgkyrWLwVVrbvJHXRzSt3NN35976vKqA== X-Received: by 2002:a05:6214:4a85:b0:6ab:9428:385f with SMTP id 6a1803df08f44-6abcd0dc953mr122329976d6.31.1716844136868; Mon, 27 May 2024 14:08:56 -0700 (PDT) Received: from denia.c.googlers.com (125.135.86.34.bc.googleusercontent.com. [34.86.135.125]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6ad850a6dc7sm9511866d6.93.2024.05.27.14.08.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 May 2024 14:08:56 -0700 (PDT) From: Ricardo Ribalda Date: Mon, 27 May 2024 21:08:53 +0000 Subject: [PATCH v3 03/18] media: dvb-frontend/mxl5xx: Refactor struct MBIN_FILE_T MIME-Version: 1.0 Message-Id: <20240527-cocci-flexarray-v3-3-cda09c535816@chromium.org> References: <20240527-cocci-flexarray-v3-0-cda09c535816@chromium.org> In-Reply-To: <20240527-cocci-flexarray-v3-0-cda09c535816@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-20240527_140858_582333_1D7C2B18 X-CRM114-Status: GOOD ( 13.98 ) 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 {