From patchwork Fri Jan 12 13:42:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nikita Zhandarovich X-Patchwork-Id: 187738 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2614:b0:101:6a76:bbe3 with SMTP id mm20csp179209dyc; Fri, 12 Jan 2024 05:42:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IGZHTFkKGMSrFXEGN1oyRkhvKHJUfMOQmqxTHZbcKxu//C7XWYOv+icEY4F5d5glk+JKAmB X-Received: by 2002:a17:907:1b09:b0:a27:9b18:b287 with SMTP id mp9-20020a1709071b0900b00a279b18b287mr423084ejc.311.1705066975597; Fri, 12 Jan 2024 05:42:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705066975; cv=none; d=google.com; s=arc-20160816; b=wT0Ykq0P/A6CCBOGd1cu8jTsr3sNHxN1yY+l8sorNNsMrPLzMCmrG0OJqX2ZE2OPqc dEdkvyuHeN79Q7VM/hpf1gVh6EFESXWNFYsf2UxKh/Qekj/lnej2CzJaSYOewXTg67vR 4RLKm0KplGL+QDf7CSVjnsSehqnk5Im2awyh7DGK3OLjTwUeePcmQ4e9rNs2KPXLJCvs TCA24tbH1tOeAyfEGu9u2gtX4KBi99gVH9edGvijIb9FleFpuwofJXXGlmTZiOlTr/f2 S40XaEbd0jAXucm/xpIE/UJmWh7juDAe+dEbLcNP6kVz7eiqaO8HHh2GeSQt3ODvd+jd VMZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=KsPBYVcsnQfjJ5E1gQmM5fZmSrXmUNc16+J4HXuI0ak=; fh=mR1j1IVvHEi0jEbdfH0z4VX8hw4ltuoo5vh+ql7sokg=; b=gkq78YkQLwabX0As1Q+UTDJVLAgITWNbB1gSj4IPMuGhreTKsKBjdRLqzDuk+evPXW SbUWBe1xSQplSXf2QoL66FXlnj3xsTldD70ebkTM5PEPWJfVLFCQdm2sW7p96tG6urtP /qhZNFf182pni8Ai+frfC1DSEw8efWJ/rpDPyrWMagwwFMRwz0nbQuzhh+vV8Rw8wu/z SlmPudj0RD/I+hVgJplOdHeGG26eaNTDkGaTlTPmrArL7AwVkLGReia+qS9GMd7Etr51 HUcQWQezd0E0AvzoeL1c7ybpGwlwgezJQWZR5jFKmPsg3VCPNZDg4hjtGVrCxmsgecyr XgRg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24699-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24699-ouuuleilei=gmail.com@vger.kernel.org" Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u15-20020a17090617cf00b00a2c697a40d7si1251808eje.843.2024.01.12.05.42.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 05:42:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24699-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-24699-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24699-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 39C401F230B9 for ; Fri, 12 Jan 2024 13:42:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC0EE6D1C6; Fri, 12 Jan 2024 13:42:35 +0000 (UTC) Received: from exchange.fintech.ru (exchange.fintech.ru [195.54.195.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 122456D1A3; Fri, 12 Jan 2024 13:42:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=fintech.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=fintech.ru Received: from Ex16-01.fintech.ru (10.0.10.18) by exchange.fintech.ru (195.54.195.169) with Microsoft SMTP Server (TLS) id 14.3.498.0; Fri, 12 Jan 2024 16:42:29 +0300 Received: from localhost (10.0.253.138) by Ex16-01.fintech.ru (10.0.10.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.4; Fri, 12 Jan 2024 16:42:29 +0300 From: Nikita Zhandarovich To: Mauro Carvalho Chehab CC: Nikita Zhandarovich , , Subject: [PATCH] media: em28xx: annotate unchecked call to media_device_register() Date: Fri, 12 Jan 2024 05:42:26 -0800 Message-ID: <20240112134226.10618-1-n.zhandarovich@fintech.ru> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: Ex16-02.fintech.ru (10.0.10.19) To Ex16-01.fintech.ru (10.0.10.18) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1787892308878049351 X-GMAIL-MSGID: 1787892308878049351 Static analyzers generate alerts for an unchecked call to `media_device_register()`. However, in this case, the device will work reliably without the media controller API. Add a comment above the call to prevent future unnecessary changes. Suggested-by: Mauro Carvalho Chehab Fixes: 37ecc7b1278f ("[media] em28xx: add media controller support") Signed-off-by: Nikita Zhandarovich --- Link to disussion about comment's necessity: https://lore.kernel.org/all/20240111184035.18a6ad4b@coco.lan/ drivers/media/usb/em28xx/em28xx-cards.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/usb/em28xx/em28xx-cards.c b/drivers/media/usb/em28xx/em28xx-cards.c index 4d037c92af7c..bae76023cf71 100644 --- a/drivers/media/usb/em28xx/em28xx-cards.c +++ b/drivers/media/usb/em28xx/em28xx-cards.c @@ -4094,6 +4094,10 @@ static int em28xx_usb_probe(struct usb_interface *intf, * topology will likely change after the load of the em28xx subdrivers. */ #ifdef CONFIG_MEDIA_CONTROLLER + /* + * No need to check the return value, the device will still be + * usable without media controller API. + */ retval = media_device_register(dev->media_dev); #endif