Skip to content

Commit

Permalink
s390/pci: avoid using strncmp with hardcoded length
Browse files Browse the repository at this point in the history
Command line option values passed to __setup callbacks are always
null-terminated and "s390_iommu=" may only accept "strict" as value.
So replace strncmp with strcmp.

While at it also make s390_iommu_setup return 1, which means this
command line option is handled by this callback.

Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
  • Loading branch information
Vasily Gorbik committed Aug 29, 2019
1 parent 759d489 commit 8dec6bd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/s390/pci/pci_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,9 +674,9 @@ EXPORT_SYMBOL_GPL(s390_pci_dma_ops);

static int __init s390_iommu_setup(char *str)
{
if (!strncmp(str, "strict", 6))
if (!strcmp(str, "strict"))
s390_iommu_strict = 1;
return 0;
return 1;
}

__setup("s390_iommu=", s390_iommu_setup);

0 comments on commit 8dec6bd

Please sign in to comment.