Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix warnings from cppcheck static analysis #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Drivers/BSP/Components/M95xx/m95xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ int32_t M95_spi_ReadData( M95_Object_t *pObj,uint8_t * pData, const uint32_t Tar
status = pObj->IO.ReadBuffer( pData, TarAddr, pObj->IO.Address, Size, EEPROMEX_READ );
else if (TarAddr > 256)
status = pObj->IO.ReadBuffer( pData, TarAddr, pObj->IO.Address, Size, EEPROMEX_UPREAD );
else if ((TarAddr + Size > 256)&&(TarAddr <= 256))
else
{
uint32_t temp1,temp2;
temp1=(256 - targetAddress); /* no. of bytes in lower half */
Expand Down Expand Up @@ -289,13 +289,12 @@ int32_t M95_spi_WriteData(M95_Object_t *pObj, uint8_t * pData, const uint32_t Ta
{
int32_t status = M95_OK;
uint32_t iNumberOfPage;
int Page = 0;
uint32_t targetAddress = TarAddr;
/*to handle dynamically start writing address*/
if (targetAddress >= PageSize)
{
iNumberOfPage = (Size / PageSize);
Page = (targetAddress / PageSize);
const int Page = (targetAddress / PageSize);

if (Size < PageSize)
{
Expand Down