Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6095107pxb; Mon, 8 Nov 2021 03:07:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKdCY+CpKvxpvHOXIe/6S4gV3DjnEv7w5UYHAT/pAqpT2SUOFpagpM6LM/sjBl5S+AL4ZZ X-Received: by 2002:aa7:cc88:: with SMTP id p8mr47299556edt.37.1636369669539; Mon, 08 Nov 2021 03:07:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636369669; cv=none; d=google.com; s=arc-20160816; b=kb2++Xov26HTXizNua+udA0HQA4Zut99o7zAWnCSFZZz5NZUI9NnXRPysy+S3+y+Yw 4Vx0/F/gQEPJJf+Ft2GB1SnD5UVgQz0YpucYSQ5efTXKqoDQvKavObDK6mUffS2Tbbjv 6HrdMenNqW2TENUgL0sS815rE6KEi6C8qnH2slJpBkHeapbn3/dBboeqILaatCjE5Yg/ PjA0UohS7gov3glVJh7Ao3Ewennkwl+ezfc61LkFipF5jKpkFrnNhlijwVuZq+MZbH6z sPljCKogLhLLwFIDGS+/DDYDQQtlAvk0JrEIOaA4LX/Zb8AxQF2akICnlMkNCeInsguF 6o3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=aPfdZWgB3g/V643+XMmyCN4+ogGJp3gQCDA9ui5E1hI=; b=inKamh/pWXgSWbaXowA6Ho+w4H8bZ2yi/zELtEaBWXoCpbTUtQuq9pn2/OyIHsTfj7 PlrquX8bACiCw6L526y1pXw9ulH7qnCxdFHoiskx4zwdB5qT3Rc5oHztenYOWmmRW82H kdNYnhC/+dEUwzij5oN51eMI9oiHTwo+gLncE5a7Cfqmv/ujxsB2hHVLxHMI+Dj0CMlH 9j10YwWITx+n4B/NCY116VCFYf3GqYIJD+oE60bdzMgDkEL8A1W4Da52CTfG9WehxEPF hX80oBgxR64Ui6Y63hJ8oxaeD5FU528bWONP/gLbqyhb3+3ARkXZcCJsCDyDTYWBfueB i9rg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n13si24970597edx.84.2021.11.08.03.07.25; Mon, 08 Nov 2021 03:07:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237130AbhKHHGL (ORCPT + 99 others); Mon, 8 Nov 2021 02:06:11 -0500 Received: from mail-ed1-f50.google.com ([209.85.208.50]:39525 "EHLO mail-ed1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236168AbhKHHGK (ORCPT ); Mon, 8 Nov 2021 02:06:10 -0500 Received: by mail-ed1-f50.google.com with SMTP id r12so58424132edt.6; Sun, 07 Nov 2021 23:03:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=aPfdZWgB3g/V643+XMmyCN4+ogGJp3gQCDA9ui5E1hI=; b=Ma9FQqCpz7pA25/hshYsjjm2POo9wbtBozfInfI10llgVrSWm8iqi574hz8NuOkyR2 qJudCtbhf+102Gbq87ARZd+kCHWF2uXBhfaxGzYx3f1yTLBQM4R7HiTWUQRqoSrW+RAp PttFrrRnikTIBV7K2Wap/pZvJ53nwoJqOOprz21SHI4kPBCZ/NTabqXZx2x3ijbdGeFH tniagiXaiQx8loXBh13aCZkK9pOvKC5H2PsgKt/pqcar9Y4nAQvv/3ay49orcagDoumS DuIBLSFubBmpLbInKkHLC5ADwBZkxB53DVBIE+WMdbGYWapYjHHByNjGBIw0APpHwQEr ocSw== X-Gm-Message-State: AOAM533UXPdJHRDrO/bZY35QX6Wlf8zVAADq50sEhgUgQ3JJ2QODxBK1 ZoE/5dBlXSgCaSi1iVIfcYmt/XtTufc= X-Received: by 2002:a50:d4cd:: with SMTP id e13mr104310252edj.29.1636355005281; Sun, 07 Nov 2021 23:03:25 -0800 (PST) Received: from [192.168.1.49] (185-219-167-24-static.vivo.cz. [185.219.167.24]) by smtp.gmail.com with ESMTPSA id he17sm4181817ejc.110.2021.11.07.23.03.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Nov 2021 23:03:24 -0800 (PST) Message-ID: <3ab0e357-dbea-e5aa-49c0-d02b49d532dd@kernel.org> Date: Mon, 8 Nov 2021 08:03:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v4] tty: vt: keyboard: add default switch-case, to handle smatch-warnings in method vt_do_kdgkb_ioctl Content-Language: en-US To: Ajay Garg , gregkh@linuxfoundation.org, andriy.shevchenko@linux.intel.com, kernel@esmil.dk, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Cc: paskripkin@gmail.com References: <20211107031721.4734-1-ajaygargnsit@gmail.com> From: Jiri Slaby In-Reply-To: <20211107031721.4734-1-ajaygargnsit@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07. 11. 21, 4:17, Ajay Garg wrote: > smatch-kchecker gives the following warnings when run on keyboard.c : > > vt_do_kdgkb_ioctl() error: uninitialized symbol 'kbs'. > vt_do_kdgkb_ioctl() error: uninitialized symbol 'ret'. > > This usually happens when switch has no default case and static > analyzers and even sometimes compilers can’t prove that all possible > values are covered. > > > Thus, the default switch-case has been added, which sets the values > for the two variables : Just to shut up random static analyzers? Please don't. -- js suse labs