Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: sep: NULL out pointers, mark debug code DEBUG to fix warnings

[This is picked out of the differences between the upstream driver and
the staging driver. I'm resolving the differences as a series of updates -AC]

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mark A. Allyn and committed by
Greg Kroah-Hartman
ab8ef351 ecd0cb00

+11 -4
+11 -4
drivers/staging/sep/sep_main.c
··· 40 40 /* #define SEP_PERF_DEBUG */ 41 41 42 42 #include <linux/init.h> 43 + #include <linux/kernel.h> 43 44 #include <linux/module.h> 44 45 #include <linux/miscdevice.h> 45 46 #include <linux/fs.h> ··· 198 197 struct sep_dma_context *dma_ctx, 199 198 const u32 table_count) 200 199 { 201 - const size_t new_len = table_count * 202 - sizeof(struct sep_lli_entry) * 203 - SEP_DRIVER_ENTRIES_PER_TABLE_IN_SEP; 200 + const size_t new_len = 201 + SYNCHRONIC_DMA_TABLES_AREA_SIZE_BYTES - 1; 202 + 204 203 void *tmp_region = NULL; 205 204 206 205 dev_dbg(&sep->pdev->dev, "[PID%d] dma_ctx = 0x%p\n", ··· 231 230 if (*dmatables_region) { 232 231 memcpy(tmp_region, *dmatables_region, dma_ctx->dmatables_len); 233 232 kfree(*dmatables_region); 233 + *dmatables_region = NULL; 234 234 } 235 235 236 236 *dmatables_region = tmp_region; ··· 344 342 345 343 u32 *p = sep->shared_addr; 346 344 347 - for (count = 0; count < 40 * 4; count += 4) 345 + for (count = 0; count < 10 * 4; count += 4) 348 346 dev_dbg(&sep->pdev->dev, 349 347 "[PID%d] Word %d of the message is %x\n", 350 348 current->pid, count/4, *p++); 351 349 } 350 + 352 351 #endif 353 352 354 353 /** ··· 387 384 sep->shared_addr, sep->shared_bus); 388 385 } 389 386 387 + #ifdef DEBUG 388 + 390 389 /** 391 390 * sep_shared_bus_to_virt - convert bus/virt addresses 392 391 * @sep: pointer to struct sep_device ··· 402 397 { 403 398 return sep->shared_addr + (bus_address - sep->shared_bus); 404 399 } 400 + 401 + #endif 405 402 406 403 /** 407 404 * sep_open - device open method