Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1353557ybl; Tue, 13 Aug 2019 11:07:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxUSiq9nCvWBzTQ69qQI4F13p6OobFpvKz8g6pM1iN+G8xRqLueZmxAqb/gJJlXCt9gE8Q+ X-Received: by 2002:a17:90a:d343:: with SMTP id i3mr3502818pjx.15.1565719642311; Tue, 13 Aug 2019 11:07:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565719642; cv=none; d=google.com; s=arc-20160816; b=VjrgBf37XorJJ8PmqiqoU2G0E5+oXx2OUK5x6wq0GoX3C2tgo2eGynx7TRC00eslNM SoE3niQtfbssyySO7sWGnKZ8fvJkkJAr4Dr17F6p3FnJ2ADyNc+D9ZZCVqmA8azmhNKC UjuSlk7GM1JbtqAPCbu+VQ5Pq4Uh8n9ru4XiOfMhMucjjfACq3X356NiIZAIACjoz3oG UG9rhNFj0up0gxtkulZIWgF7FmQetFUOwTfpVeqApcnJZwj6LCqAHf7ho2wRCHySyWqX GPGbKDxEKN86ihnjphu7P+P5/2o8cFseZizOVnHC/VqfoPz4I9wl8iL9/R5XgvLzQCBb nD6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=kFehO82jdCviGuf5R66JFrCXPio1ptY0lQw9PECP1l0=; b=WOo5r+d0abljY+201edX+owBurTOB4x0JB33ItViBF2XG9NRd8/4UNoAkR4Jz/ICgp cBREjTCwNixE/RItrBh8pw9E5OIFEoHsiZeAzwDd3Yv3c4yd0bKWJHT+4/tuaiaCCJxQ K4cWaeJvqRzO1rKi2BZLwQkThpv/XQYD9Mg4GELDW13p1jyNbZ3oWnalWvUIeJc3jrlc KzeoD+/5ISStx+nnq3Qk0Bzjk8W92SvVd0wXTfwUQn7dUUN9+sGkHKtIohpTMQn2vl3t VgNnp6oETRXRyQNayjBmJqme2kTSL9SFfs6Uz99qMK+0XYBsBUivXuVS7FVczdgouOqG uO5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="DdrOiE/3"; 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 f7si7493958pfq.93.2019.08.13.11.07.06; Tue, 13 Aug 2019 11:07:22 -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="DdrOiE/3"; 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 S1728294AbfHMSGc (ORCPT + 99 others); Tue, 13 Aug 2019 14:06:32 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:33976 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727491AbfHMSGb (ORCPT ); Tue, 13 Aug 2019 14:06:31 -0400 Received: by mail-pg1-f194.google.com with SMTP id n9so45436493pgc.1; Tue, 13 Aug 2019 11:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=kFehO82jdCviGuf5R66JFrCXPio1ptY0lQw9PECP1l0=; b=DdrOiE/3bDKX6HraMJ2Su2YgXpBCfapfPisGFr8ZTZrUBOvQxyrizpUgjvGLH3bg2Y IGe20CEw3E8B6sues1yt8n+KKd8KYVB1IrC1K880wvZo3uGgl7jwo+hOpTCUtAMCM6YW Ohowm/FbaEW7yanjt8wQ2DoAAYlLZ4NeVkDnQn/RmSVBfeTGlz4/3BzxL4poDZIwZYCh 6ekG9u6FkLIyM2P4kiGoSsylL3yrkJaPE0acjr6lDgZQOanlHaY89SRj1SpeReJTI6R5 +/C7BOoHkwd3BodDiDNy6quyCVA2N7fj5uqgzjtEhY68JDBXnwGNPsw1Qttkio3vpa96 fCgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=kFehO82jdCviGuf5R66JFrCXPio1ptY0lQw9PECP1l0=; b=P6Xw+9hmSQerntKAcTLqpuc8Da42kaFh6jUHDntTjyNSgjucgwr/EsZUd6suH3cxzY gMFaFu+X6Rt1AB6S9jtmwEQZHFLj8Tc+f3vuT/p8qR6TdLQcF83vsprMzvcBK9TnzcFe ZJCbbjABcceSREPx9cDmX1a7mhwwtf9TVDCSrt5YADoOSaHZa+QWaVomYXAoAGHcz5iT zJklfrKavZ5fOdCcKySKXu2CkFTV3lzx7KKsW5nWR2BHWcjM/Sg/M6dcEeY5oco3njji 35HIHUkjusSoS5RyumWmHXih3i7ny1NDxSOQSNu3BT/kqpiw2SsEj6+VPpmOxvRmENyx VCPg== X-Gm-Message-State: APjAAAU2N6615WqTIzBL1yf3C8exIV7R1HKBuOE+b0Jiblapd+u+oGqy cTBNR2ijRl5c4G3sszbVm1o= X-Received: by 2002:a65:64c5:: with SMTP id t5mr36518218pgv.168.1565719591093; Tue, 13 Aug 2019 11:06:31 -0700 (PDT) Received: from localhost (c-73-222-71-142.hsd1.ca.comcast.net. [73.222.71.142]) by smtp.gmail.com with ESMTPSA id 65sm112487304pff.148.2019.08.13.11.06.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Aug 2019 11:06:30 -0700 (PDT) Date: Tue, 13 Aug 2019 11:06:28 -0700 From: Richard Cochran To: Felipe Balbi Cc: netdev@vger.kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, "Christopher S . Hall" Subject: Re: [RFC PATCH 4/5] PTP: Add flag for non-periodic output Message-ID: <20190813180628.GA4069@localhost> References: <20190716072038.8408-1-felipe.balbi@linux.intel.com> <20190716072038.8408-5-felipe.balbi@linux.intel.com> <20190716163927.GA2125@localhost> <87k1ch2m1i.fsf@linux.intel.com> <20190717173645.GD1464@localhost> <87ftn3iuqp.fsf@linux.intel.com> <20190718164121.GB1533@localhost> <87tvalxzzi.fsf@gmail.com> <20190813174821.GC3207@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190813174821.GC3207@localhost> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 13, 2019 at 10:48:21AM -0700, Richard Cochran wrote: > > + if (copy_from_user(&req.extts, (void __user *)arg, > > + sizeof(req.extts))) { > > + err = -EFAULT; > > + break; > > + } > > + if (req.extts.flags || req.extts.rsv[0] > > + || req.extts.rsv[1]) { > > + err = -EINVAL; > > Since the code is mostly the same as in the PTP_EXTTS_REQUEST case, > maybe just double up the case statements (like in the other) and add > an extra test for (cmd == PTP_EXTTS_REQUEST2) for this if-block. Thinking about the drivers, in the case of the legacy ioctls, let's also be sure to clear the flags and reserved fields before passing them to the drivers. Thanks, Richard