From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BB95D1714B3 for ; Tue, 21 Jan 2025 18:16:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737483379; cv=none; b=HFceoAgQTn3Hj7mkx/SuZ2o7wQzWbb2SWJ/jRZMh9T1Tze+WcYhKEnx67YOsOi/WZPk4STpw9vxgPzfhXy/+B9VR3FUbrRceZyRB5d6jjzJ4rNOjGzRWnGe9EYSbQlBhIUQTxd8ofyw5gsP68yxDGU0v8wsv1+NVfgMyyeRgZOA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737483379; c=relaxed/simple; bh=04hduM+HXKbVzKpTm3PFTt+aDciPo+V7CpkWbsXzwaU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=KWpIz7wnnDUAd8S0imLS6oCHl2jg1MzLoWK+0rXFryFC5M7VSuANGsHpsbbrInHhvbJdwWiI5dYXe+36CUnSVX0Bwhqe/wAXiDh0TVLaSW2zPKqOztzQHv3zq5P6kC6o1xxi/OV09qJDv3HwCQjSMqRijvHU19bRWKgqeDWPhSw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=lkfhDS6p; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lkfhDS6p" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-438a39e659cso22538535e9.2 for ; Tue, 21 Jan 2025 10:16:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737483376; x=1738088176; darn=vger.kernel.org; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EAbonp7LIYWdzIU81UZsA7e9clWpDWwEvQMqg+m93EY=; b=lkfhDS6phcB/DikY022hpKzgN1qQYmSR1ME2uXeoF7rnFJazUDY0bYzhob3onJVu9d P/1wm1G/QxLEv/rDid/l/y+rq7QhUNKsp7bDNPxpu291d0wTrohzy0yZYAIoUk9Xvs2e SzWIGDCLddsTj/P55QR8C4cQuwlb3B5XDLWByNcwGhIeqaC34mmmDmp9zQWD7cLAcJ+K 98uKTSYoym/Ma89op/4N0e6zdS4bkzP/wd6yhIrDa+Ljoi4zGt7U6DiM6kCG6nKzzwmV 8+X8yR23UwBefXDkbZXM/3UCHhEiueyhcbjIbuULhKTDiD/JXCYIqeMz91/gCTAUj4D0 PQjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737483376; x=1738088176; h=user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EAbonp7LIYWdzIU81UZsA7e9clWpDWwEvQMqg+m93EY=; b=qPuItUcJp1ORSgDIloK6CeVdsUtE6FQso0vm4b2L2geKoFTOG8AWFpVjI55LQhhbXo Dr+IAHBbkK2bkLA+JAmzYQDrt+3kw+yDvLVJ+Wy2bl3N/Tv2DFgSrG6lxn5mjFkUBh6Z VnJZyHeHWhqmv6Atn/giPLgqDSlayCYYOPw5OyMYs1MA5uotSyvXl8MQSfL7SI8kmYmj yvnZZBn+OEWU8rY4gp7aNTxXKsm10QJsDJ6Asnhn1f8d71iDOhoS3aepsc31QcHjwMYs anIbJW1OdD5wlRWBHPKeac4UoBsvc/cyfqlUt/RWI6fPj8jZs7FnMCVmNO8s9CVBvCbG OQwA== X-Gm-Message-State: AOJu0YwzvY2l+/sQk5PD5A8omrLRhxI+0Nf7S7w79tat4TtOMBP7jk/8 QMHwcNgWpgaI14gCZV5Ysy03ZbNwqghqxEza+y2kSc3YKwqJSKtGkLC9CfRR X-Gm-Gg: ASbGnctgeIExyd7coklWC6esm8kiNgPSXPjmqX05cUffzGGtDXdKy+Ndrn9soZfp+6k tSpAg61Io+gPHWeXGmj8Wpj4+vhbM5HSsInOAsDSBRqLB33k4l66VgyM2KipYDva9H/DkKk0/qi u18tFemnnGVQbr575+B5lGRUDNKK6HBkFrieG/yDnMsB0+wkPiGjw9ZATI57xAaUf8W6pwwl/Ef /ON8dfF8PTZq3UGjQzawz69PEZ1e9ahWNG15nCiVy+D56xDR+paz8nNvjoYgxEvQQSF5CPu X-Google-Smtp-Source: AGHT+IFkf/2cpuPw8UYCYw+UCXCafqyS9tKx576Ku9CCLwysOyVvJHZ89FZaNzHrNOoRkxU2D41Wdg== X-Received: by 2002:a05:600c:3844:b0:434:ff08:202b with SMTP id 5b1f17b1804b1-438913dbc09mr175253885e9.12.1737483375558; Tue, 21 Jan 2025 10:16:15 -0800 (PST) Received: from grain.localdomain ([5.18.253.97]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c74abb27sm243647905e9.9.2025.01.21.10.16.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jan 2025 10:16:15 -0800 (PST) Received: by grain.localdomain (Postfix, from userid 1000) id 288C15A003F; Tue, 21 Jan 2025 21:16:14 +0300 (MSK) Date: Tue, 21 Jan 2025 21:16:14 +0300 From: Cyrill Gorcunov To: Thomas =?iso-8859-1?Q?Wei=DFschuh?= Cc: LKML , Anna-Maria Behnsen , Frederic Weisbecker , Thomas Gleixner Subject: Re: [PATCH] posix-clock: drop code duplication using compat_ptr_ioctl Message-ID: References: <4229b992-77ef-404d-b045-8f1ccad1035a@t-8ch.de> <31acd2d0-8384-4ec5-acaa-187323b1968d@t-8ch.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.2.13 (2024-03-09) On Tue, Jan 21, 2025 at 01:48:23PM +0100, Thomas Weißschuh wrote: ... > > Yeah, and the PTP_ENABLE_PPS/PTP_ENABLE_PPS2 consider `arg` as 0/1 flip-flop > > so compat_ptr won't screw it. So I personally would rather stick with a more > > simple code (taking into account that ptp is the only real underlied device > > so far sitting in code for so long). > > It is valid to pass any value to these ioctls, not only booleans. > On s390 the value 0x80000000 aka BIT(31) would interpreted as "true" by > a native 32bit kernel and "false" by a 64bit kernel in compat mode. Heh, indeed, I managed to forget that s390 clears the top bit and been scratching my head thinking of how losing the sign bit is possible) > > It's indeed an edge case. > Personally I prefer the correct solution. The correct solution is better, without a doubt. Thanks for looking into the patch, Thomas!