Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5015578pxb; Sun, 7 Nov 2021 03:26:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJw75sBR+QmRDnG63WpOdSCqIfaMo9X355RzrlGDPSwa0XsO0m20EK9JTWPSxELVJC8XmcGi X-Received: by 2002:a05:6638:418f:: with SMTP id az15mr18585103jab.56.1636284371104; Sun, 07 Nov 2021 03:26:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636284371; cv=none; d=google.com; s=arc-20160816; b=vNcK8L3CSLsb+iJb6ja7V8kBvkuK6Wo4Zo9JOUZiWu1M5BUlGLsLgfBNlf9jAoA2UC DCLlNnXyH/d+m9UgHLB8hp6aok6CGJDAVt6BPJOxfHIKLWThsfbLZ1Xq7J1Sm/HlYc7P 224QcvTk/tTR2t7haX6fRWozmZyDLal2S9Bg04Hd+6QRPs/2zJPT62dC+K95kyUZcFiV FklADn0JjcMTiCbeSIN39YduC1IyK+d7Ty2axkC68mLVSMjvnV2py2vm2evR1x10W2AU PM4F/ZdxwzmwYlDT4FsO0bMwVqaeDfBEoFf6e7yZphMhu//p/FN40zMhOYK3QZpJZKZm ITVA== 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:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=NeiT0mSDoDVgb/7n1xYrK8xG03w6WQESwJe/usLnGKM=; b=KAoVZA7Snn3ZuFMyLqruuHYCSSr3xPgtXqjDBvzZriBftfYvzgNyGl/WxlnOngT6rL +0nndmVxwrOiZPejp48cyARvSMSDYqBe/etOPX8Ld6arAm17qwFNgjL/p0sI3XJ5gU8s 61JiyFYqHIX1awygbEU9ofloQaV1Z0JwlOQpPmkjQ4EvV98Zc1x25VPfCip+LaV61lyM 2ksj9M+PDprChKA8b9mvTI72KQ2wjftToy1KX6Wi83U1ccyqKe3XBEr++TlELD9ehP55 mNO+vArZ8uGwSsgpLve30WUrJ5YH2m1w5L31fp3Yd6lB49k+55e1qsOWrKFPUXM4xzYV pfuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZlTXxAPn; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t17si19497215ilh.78.2021.11.07.03.25.58; Sun, 07 Nov 2021 03:26:11 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZlTXxAPn; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230525AbhKFWP3 (ORCPT + 99 others); Sat, 6 Nov 2021 18:15:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230119AbhKFWP3 (ORCPT ); Sat, 6 Nov 2021 18:15:29 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C26AC061570; Sat, 6 Nov 2021 15:12:47 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id j2so26688598lfg.3; Sat, 06 Nov 2021 15:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :references:from:in-reply-to:content-transfer-encoding; bh=NeiT0mSDoDVgb/7n1xYrK8xG03w6WQESwJe/usLnGKM=; b=ZlTXxAPnbBPHW57L0y7QLsrOaosn3J8pBbhdZl5X83yqmODNh8txyGAQlQzvx5879x 4w5iCRjNrniPNZ9m/kxtaQe9Ti6O/VRzTSO8HtU1jouEGBcShJudSxAQ1fBK/rrQP5zH L5ziLUjbvtlxsUuxXAmqU+vBNe4LU+lPUtbf06I/iEeTUWlmjyyYgRuFvnIuWi7+Z1AG jsdXyjuope+/Hnumhy37+mms++Kox6y1/YZ7V+SQpF6rBE/vDd1wD7wLRVtq3FlJxyiA YgT+3xmWjWZn7hJApJHo5QbWRkseL5CjNWrPvKdgZ8fExkpO2nNSQ/3IfF/OwMcY2Ye3 BZHw== 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:references:from:in-reply-to :content-transfer-encoding; bh=NeiT0mSDoDVgb/7n1xYrK8xG03w6WQESwJe/usLnGKM=; b=S7Aea/7xGlhB/4B59gvyQNnMrVnSbXu8hFaUBGWmUo108Ydy2DHYYJ+sf2ZuJPbQR2 MFuP3E2WKazuwt0om2Yg4dSPVVmfMP4wac9Iy2XCruWy9xTb5QUote2P434wzF1p3vci P8a4xLjCarQodnm5oPA4NLrsvlgaxChgmbfxJqtdoEXg/KSV31JDa+mWvL1vEoC/FuvN jyh0i3uBDZ1ahu0Cm3o2JlXgMRXHUAB07X+NaNMVmV2f/9WULNXbkDGCRM56YNveBwPy IwXkwTKCCBbeZgYJwO2JjfmalG2tsJpvfSNYN85aDs4JUjK/Q5bJPSLSin8v+edCfqe8 aPsg== X-Gm-Message-State: AOAM533wLIev4bGEnckZyQgrZeUi302SEWp78LcvVeOlxlv8tmt4U1c1 TClwCWKtxeocfO83zzfP+Xiq3Q2n5r4= X-Received: by 2002:a05:6512:c28:: with SMTP id z40mr3336166lfu.457.1636236765678; Sat, 06 Nov 2021 15:12:45 -0700 (PDT) Received: from [192.168.1.11] ([217.117.245.207]) by smtp.gmail.com with ESMTPSA id p3sm160926lfg.273.2021.11.06.15.12.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Nov 2021 15:12:45 -0700 (PDT) Message-ID: <8d0346ba-4819-c25e-f208-0b51116d9147@gmail.com> Date: Sun, 7 Nov 2021 01:12:44 +0300 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 v3] 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, jirislaby@kernel.org, andriy.shevchenko@linux.intel.com, kernel@esmil.dk, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <20211106220315.392842-1-ajaygargnsit@gmail.com> From: Pavel Skripkin In-Reply-To: <20211106220315.392842-1-ajaygargnsit@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/21 01:03, Ajay Garg wrote: > diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c > index c7fbbcdcc346..b83e7669658d 100644 > --- a/drivers/tty/vt/keyboard.c > +++ b/drivers/tty/vt/keyboard.c > @@ -2090,6 +2090,12 @@ int vt_do_kdgkb_ioctl(int cmd, struct kbsentry __user *user_kdgkb, int perm) > > ret = 0; > break; > + default: { > + kbs = NULL; > + ret = -ENOIOCTLCMD; > + > + break; > + } Are these brackets needed here? There are no local variables inside default case. just my 2c, With regards, Pavel Skripkin