Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp6057472pxb; Mon, 8 Nov 2021 02:25:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuVECGgtwbODMlTAweY+Km1ZOh9oe82rLGyPY6KF/79KWBHzG0/j0slIOj8QGijbjSFUdn X-Received: by 2002:aa7:c34d:: with SMTP id j13mr91401524edr.308.1636367126997; Mon, 08 Nov 2021 02:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636367126; cv=none; d=google.com; s=arc-20160816; b=Xnngd/YQjCvClpvioM/O77DbOvQQO4wOu7U0UMrS2cn6DJGOlucT3tq27heo9mQly9 lhbxizCqvtGad/PRglft4zW/A7epVPNXKa6iHkzg/OMUyE3URaEfmYqx8Ou1NmxyFOzp 7idERS886ZUdvLVZzPCXXkUEOu9dOn5p+wgQMN1xGsHmwHebbZ63bnM138ZvJ255x3xw Laa10HMRqG6uCR6/S68fx8Yj34HO63iNWVbCht9s29YCgrfi85BZgkxcJQbpbXkWtidU UQ2FEefRGobtK+WdeYdzaKmSNpGn36V0LFmcOm0i3xThm2AKzdoP99NzL2DgVNIbBMOS Oq0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=SV3uFGpOzk0BYk1mAzH96zrfSdq37VAR6UZ0MqQ4GoU=; b=vwvJheFuGCvYEHo+R9XYBsaAyNrnjoqcxxsAY5VvPW8KX/OGi1ny5+W82NHD7Z8nPG GC3cSxA1kjgEU2FiqxxE55ETJKEvJNYkL48fk3Q6EG9vgt3K8DUtjL9WVI9NJBO+Y1L6 JFWOcMk2v+Vsgk+0ScxwI6TjXXMSziv8yvZBVjfWEdDMhwX3GZEm9ktVnQKEASD7orES Tv9A4w2hfMIBhDdxj6Ar8MlPgl5zNvc71pfRAt8ohCJ968slrxX8o9FVdUcsmDDuQpyy L8LKo4859urCuYsoVqC6Mt+b9Ab1ZJHxQU0oVNQz0js/3/7Jk1Jrj1YWrPaUCZr/FU98 SxEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=UK1MMZ6z; 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 g3si33028997ejt.525.2021.11.08.02.25.02; Mon, 08 Nov 2021 02:25:26 -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=UK1MMZ6z; 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 S236594AbhKHI62 (ORCPT + 99 others); Mon, 8 Nov 2021 03:58:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233254AbhKHI61 (ORCPT ); Mon, 8 Nov 2021 03:58:27 -0500 Received: from mail-oi1-x236.google.com (mail-oi1-x236.google.com [IPv6:2607:f8b0:4864:20::236]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1C73C061570; Mon, 8 Nov 2021 00:55:43 -0800 (PST) Received: by mail-oi1-x236.google.com with SMTP id o4so26523470oia.10; Mon, 08 Nov 2021 00:55:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=SV3uFGpOzk0BYk1mAzH96zrfSdq37VAR6UZ0MqQ4GoU=; b=UK1MMZ6z8OPre7kMt+zn9ejRtioNXNZLQFiXiKPh2SEW53hzW1jDK2KWVoJsp6Dsdo tph6iYO5pAXMm0b51I0E/9bddNz/udFDP9/vOnT+gc7Hl13bjC4l/lJFEI9A59rntZkn t438WnsLH7SlCX50FaA3pRMPcqupSBKrSsAJYPJGrsDWyRBWrGsBu6/jfbI20uPZ/mfR /K8X7eNp96PExQANMNjv1Q4pHYypB9T7Y8QBTw8wbzyDpo6kg88+BfS6ITumoB/b68uS GwJWQrYrCf2bXCT94YNFWXaWpAgL97BfYIfoceF/wwOyk0IOjcO/G0WuWZB6eiJ2rHeI FHSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=SV3uFGpOzk0BYk1mAzH96zrfSdq37VAR6UZ0MqQ4GoU=; b=mU1FXwTLclJekEcda/p2QqhnoEuDI0QFRruH73zMpdZXRm9mZFKllBluFLahPPXOkc m1scejp/qR0dsNNRU0XU/oQzC4BD2j2Ag3TgLo9+w08EWGa+4bNF/+EJfUdLpb/ueDy3 u14aUz7DaaqsdzKAVm+zOtJKJpEZCQ5Qxni/e/WSKov4yzYXjD39c2T0AP7J0lgc7T1x eQd+OuQWNMt6XY4alUcg57D+VGVLLlz+6mzoJsyIqavyLd1Q8oW5jLYwzx7GjocyIugw l9h5dL6DO/aO2Z3MgaNUIZtcw44bwGqIns7msXCXW0RO49jgDJX28GsQHkFQz0bUmXdG RNLg== X-Gm-Message-State: AOAM530uMKlgAiORKqH4YCUGJ1WmyggR2zVeJY/TAMxmGa4xKLTfgtr7 X/kesbDq7GIayYIwQtqr9PhMQDdJiPAd3pFkwYU= X-Received: by 2002:a54:4499:: with SMTP id v25mr35931259oiv.71.1636361743154; Mon, 08 Nov 2021 00:55:43 -0800 (PST) MIME-Version: 1.0 References: <20211107031721.4734-1-ajaygargnsit@gmail.com> In-Reply-To: From: Ajay Garg Date: Mon, 8 Nov 2021 14:25:31 +0530 Message-ID: Subject: Re: [PATCH v4] tty: vt: keyboard: add default switch-case, to handle smatch-warnings in method vt_do_kdgkb_ioctl To: Andy Shevchenko Cc: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , Emil Renner Berthing , "open list:SERIAL DRIVERS" , Linux Kernel Mailing List , Pavel Skripkin Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > This usually happens when switch has no default case and static > > analyzers and even sometimes compilers can=E2=80=99t prove that all pos= sible > > values are covered. > > > > > > One blank line is enough. > > > Many thanks to the following for review of previous versions : > > > > * Pavel Skripkin > > * Andy Shevchenko > > > > > > Ditto for each such case. Ok, will take care of this in all my future-patches. > > ... > > > + default: > > + kbs =3D NULL; > > > + ret =3D -ENOIOCTLCMD; > > Why is this? How is it supposed to work? If there is no match for a cmd, causing the default-case to be hit, we must return an error ret-code to the client. The -ENOIOCTLCMD error ret-code has been chosen, on the same lines as "vt_do_kdskled" method. Thanks and Regards, Ajay