From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D99CD72 for ; Fri, 26 Nov 2021 18:58:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9CC1C93056; Fri, 26 Nov 2021 18:58:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1637953084; bh=kGidO4zuFh4BMthEhvCDY4o9ykONd2hx9jR7ofbAhaU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=cEbRMurWmo6CV6alcv/WnqFevTnmP8zpc6cQtNn98/jVkQOWZuIPUP8KUp1gbR518 4sqUUVlofHxjoDmmPFxGxDZq8cca3pSXqX0bB6jVd9OTfzW4RLRErObWBVM8Sx1viY uMPRX74mX+sckUQvVaRSeU0RHPglK6boYCh2dHgBeczRekrRVIElFud98mv1fAZ5K1 sEUY2SQNFYkiZ3PV4jt5lSjQzMvA5jxhwoIsfwsv42c4qhONQHUrVpz+qCmB+b7h18 jX3HCtDSQPOmqkrzUDU2LosZpYsHbDKMaG702Gb3O6i89H2svj3jY1HGglrXBa48qz 1rQiulBwon49A== Date: Fri, 26 Nov 2021 11:57:59 -0700 From: Nathan Chancellor To: Mauro Carvalho Chehab Cc: linuxarm@huawei.com, mauro.chehab@huawei.com, Mauro Carvalho Chehab , Nick Desaulniers , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH 04/20] media: drxd: drop offset var from DownloadMicrocode() Message-ID: References: Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Nov 24, 2021 at 08:13:07PM +0100, Mauro Carvalho Chehab wrote: > The offset is not needed, and it is never used, as the pointer > itself is already incremented. > > So, drop it, in order to solve a W=1 clang warning. > > Signed-off-by: Mauro Carvalho Chehab Reviewed-by: Nathan Chancellor I would expect GCC to warn about this as well. > --- > > To avoid mailbombing on a large number of people, only mailing lists were C/C on the cover. > See [PATCH 00/20] at: https://lore.kernel.org/all/cover.1637781097.git.mchehab+huawei@kernel.org/ > > drivers/media/dvb-frontends/drxd_hard.c | 8 -------- > 1 file changed, 8 deletions(-) > > diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c > index a7eb81df88c2..9860cae65f1c 100644 > --- a/drivers/media/dvb-frontends/drxd_hard.c > +++ b/drivers/media/dvb-frontends/drxd_hard.c > @@ -914,44 +914,36 @@ static int DownloadMicrocode(struct drxd_state *state, > u32 Address; > u16 nBlocks; > u16 BlockSize; > - u32 offset = 0; > int i, status = 0; > > pSrc = (u8 *) pMCImage; > /* We're not using Flags */ > /* Flags = (pSrc[0] << 8) | pSrc[1]; */ > pSrc += sizeof(u16); > - offset += sizeof(u16); > nBlocks = (pSrc[0] << 8) | pSrc[1]; > pSrc += sizeof(u16); > - offset += sizeof(u16); > > for (i = 0; i < nBlocks; i++) { > Address = (pSrc[0] << 24) | (pSrc[1] << 16) | > (pSrc[2] << 8) | pSrc[3]; > pSrc += sizeof(u32); > - offset += sizeof(u32); > > BlockSize = ((pSrc[0] << 8) | pSrc[1]) * sizeof(u16); > pSrc += sizeof(u16); > - offset += sizeof(u16); > > /* We're not using Flags */ > /* u16 Flags = (pSrc[0] << 8) | pSrc[1]; */ > pSrc += sizeof(u16); > - offset += sizeof(u16); > > /* We're not using BlockCRC */ > /* u16 BlockCRC = (pSrc[0] << 8) | pSrc[1]; */ > pSrc += sizeof(u16); > - offset += sizeof(u16); > > status = WriteBlock(state, Address, BlockSize, > pSrc, DRX_I2C_CLEARCRC); > if (status < 0) > break; > pSrc += BlockSize; > - offset += BlockSize; > } > > return status; > -- > 2.33.1 > >