Skip to content
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
8 changes: 4 additions & 4 deletions drivers/iio/adc/navassa/adrv9002.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@
static long adrv9002_bb_round_rate(struct clk_hw *hw, unsigned long rate,
unsigned long *prate)
{
struct adrv9002_clock *clk_priv = to_clk_priv(hw);

Check warning on line 336 in drivers/iio/adc/navassa/adrv9002.c

View workflow job for this annotation

GitHub Actions / build_llvm_x86_64 / build

clang_analyzer: Value stored to 'clk_priv' during its initialization is never read [deadcode.DeadStores] 336 | struct adrv9002_clock *clk_priv = to_clk_priv(hw); | ^~~~~~~~ ~~~~~~~~~~~~~~~

dev_dbg(&clk_priv->spi->dev, "%s: Rate %lu Hz", __func__, rate);

Expand Down Expand Up @@ -2988,7 +2988,7 @@
if (!c->enabled)
continue;

if (c->port == ADI_RX)

Check warning on line 2991 in drivers/iio/adc/navassa/adrv9002.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 2-4 WARNING possible condition with no effect (if == else)
pos |= ADRV9002_PORT_MASK(c);
else
pos |= ADRV9002_PORT_MASK(c);
Expand All @@ -3011,7 +3011,7 @@
adi_adrv9001_PllLoMode_e modes[] = { clocks->rfPll1LoMode, clocks->rfPll2LoMode };
u16 dividers[] = { clocks->extLo1Divider, clocks->extLo2Divider };
/* -1 since the enums start at 1 */
unsigned int lo = lo_selects[idx * 2 + tx] - 1;

Check warning on line 3014 in drivers/iio/adc/navassa/adrv9002.c

View workflow job for this annotation

GitHub Actions / build_llvm_x86_64 / build

clang_analyzer: The left operand of '-' is a garbage value due to array index out of bounds [core.UndefinedBinaryOperatorResult] 3014 | unsigned int lo = lo_selects[idx COPYING CREDITS Documentation Kbuild Kconfig Kconfig.adi LICENSES MAINTAINERS Makefile Module.symvers README README.md System.map arch azure-pipelines-rpi.yml azure-pipelines.yml block built-in.a certs ci compile_commands.json crypto defconfig dist docs drivers firmware fs include init io_uring ipc kernel lib mm modules.builtin modules.builtin.modinfo modules.order net rust samples scripts security sound tools usr virt vmlinux vmlinux.a vmlinux.o 2 + tx] - 1; | ^
struct device *dev = &phy->spi->dev;

if (lo >= ARRAY_SIZE(modes)) {
Expand Down Expand Up @@ -4275,7 +4275,7 @@
return -ENOMEM;

memcpy(tbl->bin_table, buf, count);
/* The bellow is always safe as @bin_table is bigger (by 1 byte) than the bin attribute */
/* The below is always safe as @bin_table is bigger (by 1 byte) than the bin attribute */
tbl->bin_table[count] = '\0';

max_sz = ARRAY_SIZE(tbl->hop_tbl);
Expand All @@ -4301,7 +4301,7 @@
return -EINVAL;
}

if (entry > max_sz) {
if (entry >= max_sz) {
dev_err(&phy->spi->dev, "Hop:%d table:%d too big:%d\n", hop, table, entry);
return -EINVAL;
}
Expand All @@ -4315,10 +4315,10 @@

tbl->hop_tbl[entry].hopFrequencyHz = lo;
tbl->hop_tbl[entry].rx1OffsetFrequencyHz = rx10_if;
tbl->hop_tbl[entry].rx2OffsetFrequencyHz = rx10_if;
tbl->hop_tbl[entry].rx2OffsetFrequencyHz = rx20_if;
tbl->hop_tbl[entry].rx1GainIndex = rx1_gain;
tbl->hop_tbl[entry].tx1Attenuation_fifthdB = tx1_atten;
tbl->hop_tbl[entry].rx2GainIndex = rx1_gain;
tbl->hop_tbl[entry].rx2GainIndex = rx2_gain;
tbl->hop_tbl[entry].tx2Attenuation_fifthdB = tx2_atten;
entry++;
}
Expand Down Expand Up @@ -4656,7 +4656,7 @@
if (ret)
return ret;

buf = kzalloc(fw->size, GFP_KERNEL);

Check warning on line 4659 in drivers/iio/adc/navassa/adrv9002.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 7-14 WARNING opportunity for kmemdup
if (!buf) {
release_firmware(fw);
return -ENOMEM;
Expand Down Expand Up @@ -4921,8 +4921,8 @@

if (phy->rx2tx2) {
/* just point RX2/TX2 to RX1/TX1*/
phy->rx_channels[c + 1].channel.clk = rx->channel.clk;

Check failure on line 4924 in drivers/iio/adc/navassa/adrv9002.c

View workflow job for this annotation

GitHub Actions / build_gcc_arm / build

kernel_smatch: buffer overflow 'phy->rx_channels' 2 <= 2
phy->tx_channels[c + 1].channel.clk = tx->clk;

Check failure on line 4925 in drivers/iio/adc/navassa/adrv9002.c

View workflow job for this annotation

GitHub Actions / build_gcc_arm / build

kernel_smatch: buffer overflow 'phy->tx_channels' 2 <= 2
break;
}
}
Expand Down Expand Up @@ -4972,7 +4972,7 @@
if (spi->irq) {
const unsigned long mask = IRQF_TRIGGER_RISING | IRQF_ONESHOT;

ret = devm_request_threaded_irq(&spi->dev, spi->irq, NULL,

Check warning on line 4975 in drivers/iio/adc/navassa/adrv9002.c

View workflow job for this annotation

GitHub Actions / checks / checks

coccicheck: 8-33 WARNING Threaded IRQ with no primary handler requested without IRQF_ONESHOT (unless it is nested IRQ)
adrv9002_irq_handler, mask,
indio_dev->name, indio_dev);
if (ret)
Expand Down
Loading