/// Make sure pm_runtime_* calls does not use unnecessary IS_ERR_VALUE /// // Keywords: pm_runtime // Confidence: Medium // Copyright (C) 2013 Texas Instruments Incorporated - GPLv2. // URL: http://coccinelle.lip6.fr/ // Options: --include-headers virtual patch virtual context virtual org virtual report //---------------------------------------------------------- // Detection //---------------------------------------------------------- @runtime_bad_err_handle exists@ expression ret; position p; @@ ( ret@p = \(pm_runtime_idle\| pm_runtime_suspend\| pm_runtime_autosuspend\| pm_runtime_resume\| pm_request_idle\| pm_request_resume\| pm_request_autosuspend\| pm_runtime_get\| pm_runtime_get_sync\| pm_runtime_put\| pm_runtime_put_autosuspend\| pm_runtime_put_sync\| pm_runtime_put_sync_suspend\| pm_runtime_put_sync_autosuspend\| pm_runtime_set_active\| pm_schedule_suspend\| pm_runtime_barrier\| pm_generic_runtime_suspend\| pm_generic_runtime_resume\)(...); ... IS_ERR_VALUE(ret) ... ) //---------------------------------------------------------- // For context mode //---------------------------------------------------------- @depends on context@ identifier pm_runtime_api; expression ret; position runtime_bad_err_handle.p; @@ ( ret@p = pm_runtime_api(...); ... * IS_ERR_VALUE(ret) ... ) //---------------------------------------------------------- // For patch mode //---------------------------------------------------------- @depends on patch@ identifier pm_runtime_api; expression ret; position runtime_bad_err_handle.p; @@ ( ret@p = pm_runtime_api(...); ... - IS_ERR_VALUE(ret) + ret < 0 ... ) //---------------------------------------------------------- // For org and report mode //---------------------------------------------------------- @r depends on (org || report) exists@ position p1, p2; identifier pm_runtime_api; expression ret; position runtime_bad_err_handle.p; @@ ( ret@p = pm_runtime_api@p1(...); ... IS_ERR_VALUE@p2(ret) ... ) @script:python depends on org@ p1 << r.p1; p2 << r.p2; pm_runtime_api << r.pm_runtime_api; @@ cocci.print_main(pm_runtime_api,p1) cocci.print_secs("IS_ERR_VALUE",p2) @script:python depends on report@ p1 << r.p1; p2 << r.p2; pm_runtime_api << r.pm_runtime_api; @@ msg = "%s returns < 0 as error. Unecessary IS_ERR_VALUE at line %s" % (pm_runtime_api, p2[0].line) coccilib.report.print_report(p1[0],msg) ue='author'>author
path: root/sound/pci/hda/hda_jack.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-01-24 16:54:39 -0800
commit883af14e67e8b8702b5560aa64c888c0cd0bd66c (patch)
tree74e3a6b53f5fad9f7848ab1b9f6921b7012940a4 /sound/pci/hda/hda_jack.c
parent0263d4ebd94b36280608e296cba39b924b6e832b (diff)
parentaab45453ff5c77200c6da4ac909f7a4392aed17e (diff)
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "26 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (26 commits) MAINTAINERS: add Dan Streetman to zbud maintainers MAINTAINERS: add Dan Streetman to zswap maintainers mm: do not export ioremap_page_range symbol for external module mn10300: fix build error of missing fpu_save() romfs: use different way to generate fsid for BLOCK or MTD frv: add missing atomic64 operations mm, page_alloc: fix premature OOM when racing with cpuset mems update mm, page_alloc: move cpuset seqcount checking to slowpath mm, page_alloc: fix fast-path race with cpuset update or removal mm, page_alloc: fix check for NULL preferred_zone kernel/panic.c: add missing \n fbdev: color map copying bounds checking frv: add atomic64_add_unless() mm/mempolicy.c: do not put mempolicy before using its nodemask radix-tree: fix private list warnings Documentation/filesystems/proc.txt: add VmPin mm, memcg: do not retry precharge charges proc: add a schedule point in proc_pid_readdir() mm: alloc_contig: re-allow CMA to compact FS pages mm/slub.c: trace free objects at KERN_INFO ...
Diffstat (limited to 'sound/pci/hda/hda_jack.c')