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

misc: genwqe: remove several redundant variables

The variables val16, type, pci_dev and type are set but are never used
hence they are redundant and can be removed.

Cleans up clang warnings:
warning: variable 'type' set but not used [-Wunused-but-set-variable]
warning: variable 'val16' set but not used [-Wunused-but-set-variable]
warning: variable 'pci_dev' set but not used [-Wunused-but-set-variable]
warning: variable 'type' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Colin Ian King and committed by
Greg Kroah-Hartman
ccbaef5d 9cf04a29

-9
-4
drivers/misc/genwqe/card_debugfs.c
··· 305 305 static int genwqe_info_show(struct seq_file *s, void *unused) 306 306 { 307 307 struct genwqe_dev *cd = s->private; 308 - u16 val16, type; 309 308 u64 app_id, slu_id, bitstream = -1; 310 309 struct pci_dev *pci_dev = cd->pci_dev; 311 310 ··· 313 314 314 315 if (genwqe_is_privileged(cd)) 315 316 bitstream = __genwqe_readq(cd, IO_SLU_BITSTREAM); 316 - 317 - val16 = (u16)(slu_id & 0x0fLLU); 318 - type = (u16)((slu_id >> 20) & 0xffLLU); 319 317 320 318 seq_printf(s, "%s driver version: %s\n" 321 319 " Device Name/Type: %s %s CardIdx: %d\n"
-5
drivers/misc/genwqe/card_dev.c
··· 304 304 { 305 305 struct genwqe_dev *cd; 306 306 struct genwqe_file *cfile; 307 - struct pci_dev *pci_dev; 308 307 309 308 cfile = kzalloc(sizeof(*cfile), GFP_KERNEL); 310 309 if (cfile == NULL) 311 310 return -ENOMEM; 312 311 313 312 cd = container_of(inode->i_cdev, struct genwqe_dev, cdev_genwqe); 314 - pci_dev = cd->pci_dev; 315 313 cfile->cd = cd; 316 314 cfile->filp = filp; 317 315 cfile->client = NULL; ··· 862 864 struct genwqe_dev *cd = cfile->cd; 863 865 struct genwqe_ddcb_cmd *cmd = &req->cmd; 864 866 struct dma_mapping *m; 865 - const char *type = "UNKNOWN"; 866 867 867 868 for (i = 0, asiv_offs = 0x00; asiv_offs <= 0x58; 868 869 i++, asiv_offs += 0x08) { ··· 930 933 931 934 m = genwqe_search_pin(cfile, u_addr, u_size, NULL); 932 935 if (m != NULL) { 933 - type = "PINNING"; 934 936 page_offs = (u_addr - 935 937 (u64)m->u_vaddr)/PAGE_SIZE; 936 938 } else { 937 - type = "MAPPING"; 938 939 m = &req->dma_mappings[i]; 939 940 940 941 genwqe_mapping_init(m,