Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp345018imm; Thu, 26 Jul 2018 20:45:34 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdL88CNKPJeJmKmixJmSLNWr0h1JFPVFH58gYeZHJCntshTnma34buIqCjtqPiyvT89Am6U X-Received: by 2002:a63:5866:: with SMTP id i38-v6mr4421448pgm.63.1532663134374; Thu, 26 Jul 2018 20:45:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532663134; cv=none; d=google.com; s=arc-20160816; b=ksJ8F+cNDUL2WoWi3Jgxa7dv3yhqG7n0sBqdcY8CAnAiaXCpvjre4ibv+lbm8PQRxC JmuVS1uOv6cLmAcLB1beiPx7EPwYziksbrlYe6MvU8LhLqPF9LMyrFUySBJsVw8wYgKy VQijkzz1/qFAn3ZLREnM5S3YCxreIp+fVAEAZR0jnBrkqwTGBfY9b99oUPKHY0ABXJuE lcl3h2iZQVwQaCun2E0C5cYlpDiJQ4ofXS3OOYS12Q31Nc027SKhQfiR+n40TZThk31y Q1mHPDrqeM7wmLnKjlmp293ccVJuWVloV9bSMaNLwUP55DfvMyooNqwnWrY02KaQqOdB SkOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=5UmX7FBH46w04MxobJWSRzfyKYqJnefAltJO3HUXG9M=; b=MXJbBKyFiXM02EjOuBw8yBG+LyD0C7IxSdKVhcSmnShe+bDuslwZ+TwvFhUwzuoDYO 3gAKO+qcQVf2fBHoBn8CTsVZ9GwMQlZj7vk3tgGmgy74I9z8Dd5ff1iBrlNGQQrcN8qY s9Zur+G5aa0MqKA0efCduKVQb1GV+Ta0J96JlxjMvrbW7y+XYxhN4+auAURVnrmJ9ItQ pTP5ZvrQgwcIzQEMpbXl73N4mG9DFR2+hLidSVpy7zu47JBjKDXcK0I/LQJiBtWOZ3vd 1IZE+1qqgwjID01P8lgusODnkMLgKBMskgV8tTPy2FnnwpCJ1dFaF5IZK4QBNVc7ZK+M YbOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F83HHjR6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x130-v6si3120456pgx.207.2018.07.26.20.45.19; Thu, 26 Jul 2018 20:45:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F83HHjR6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728052AbeG0FEU (ORCPT + 99 others); Fri, 27 Jul 2018 01:04:20 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:41731 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725846AbeG0FEU (ORCPT ); Fri, 27 Jul 2018 01:04:20 -0400 Received: by mail-pl0-f65.google.com with SMTP id w8-v6so1713564ply.8; Thu, 26 Jul 2018 20:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=5UmX7FBH46w04MxobJWSRzfyKYqJnefAltJO3HUXG9M=; b=F83HHjR6iVAE4gwlunqRsy3MhznBBni3wFNJmC8ODVfSWkv5I1SLzqSbC4yX296tpc kcSaahUdgxa5xAiGX1n24MZx4jMmYxMWvr02v1dnRjhuVbpCJ1p7yv46Wwgb5VCOSdAq jYblGvVo0WQ5QqZZ1Zew3EydqlyStWYfNnWKB6uzGL6YhkDNZDgYzrzhmhnmpQs8gUAc XDrFPISZFoy5ns8B7wqIQYsBci8AC/5euW4MHaTte+xOI+Z6ADTTrZOMvJXMohujmb0s wSVhYIrYftCcAOZZLOiulp8KEo3Fgzy5Rx6OSqET6ncRxZnTch3jlQaMfzxX/dkqJxb3 iHZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=5UmX7FBH46w04MxobJWSRzfyKYqJnefAltJO3HUXG9M=; b=iJ/L7z9UKHUhcz0Qmjo4vjbEq6V9IAfRXlWV8d2jyZLbaKSMoUHCSE0NxinCAfezcn UgOTfnwo+0le8IYUJBmRQbACo3hkka3uXO3QmzWwD1zMgOzWtczlISTvgJLhr4Zl+UJu J39i4DXZrZh8NHkux191TYYqpTck8AfPychdKBVX1ckU0HxsK0Jj5kFbz0+LQ46/S+T/ M5KVuId9wxgiPgEups6jI5ZpLmWsl7OAsXQS724UblKJHhrE6nXFqo+6CvTMZ5VB2JNR rysJ3OxL4Lk/2lIQivYkRqrtUGIWPqExhUyBRaBmLDCM9e9f2OPWoz8Xa5yev7II0ZrG jgkQ== X-Gm-Message-State: AOUpUlGENO6ZsLymOa0zkGzKSK4pHbEVtV9+UfFREWKGeTPVBGdSsfiV Y3W03RRpa5VBMnKBQswFcKM= X-Received: by 2002:a17:902:4503:: with SMTP id m3-v6mr4458054pld.168.1532663070675; Thu, 26 Jul 2018 20:44:30 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:6c14:7712:e625:1be4]) by smtp.gmail.com with ESMTPSA id 14-v6sm4769662pft.93.2018.07.26.20.44.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 26 Jul 2018 20:44:30 -0700 (PDT) From: Jia-Ju Bai To: awalls@md.metrocast.net, mchehab@kernel.org Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] media: pci: ivtv: Replace GFP_ATOMIC with GFP_KERNEL Date: Fri, 27 Jul 2018 11:44:24 +0800 Message-Id: <20180727034424.4405-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org ivtv_probe() and ivtvfb_init_card() are never called in atomic context. They call kzalloc() with GFP_ATOMIC, which is not necessary. GFP_ATOMIC can be replaced with GFP_KERNEL. This is found by a static analysis tool named DCNS written by myself. Signed-off-by: Jia-Ju Bai --- drivers/media/pci/ivtv/ivtv-driver.c | 2 +- drivers/media/pci/ivtv/ivtvfb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/pci/ivtv/ivtv-driver.c b/drivers/media/pci/ivtv/ivtv-driver.c index 6b2ffdc96961..dd727098daf4 100644 --- a/drivers/media/pci/ivtv/ivtv-driver.c +++ b/drivers/media/pci/ivtv/ivtv-driver.c @@ -999,7 +999,7 @@ static int ivtv_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) int vbi_buf_size; struct ivtv *itv; - itv = kzalloc(sizeof(struct ivtv), GFP_ATOMIC); + itv = kzalloc(sizeof(struct ivtv), GFP_KERNEL); if (itv == NULL) return -ENOMEM; itv->pdev = pdev; diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c index 8e62b8be6529..1d7d10367d55 100644 --- a/drivers/media/pci/ivtv/ivtvfb.c +++ b/drivers/media/pci/ivtv/ivtvfb.c @@ -1178,7 +1178,7 @@ static int ivtvfb_init_card(struct ivtv *itv) } itv->osd_info = kzalloc(sizeof(struct osd_info), - GFP_ATOMIC|__GFP_NOWARN); + GFP_KERNEL|__GFP_NOWARN); if (itv->osd_info == NULL) { IVTVFB_ERR("Failed to allocate memory for osd_info\n"); return -ENOMEM; -- 2.17.0