From patchwork Tue Jan 23 10:14:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 13527114 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 A34D95A0FC for ; Tue, 23 Jan 2024 10:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706004853; cv=none; b=XHVqjWbv6Wtb+NI85Bnefylo6hJGZi6cR0wK9cyJKkhAMqG/sssJJUBKoAOPJ6ntIjg7+z5H5OCqsrqAizROJVKbYt/NwZjbnOv9rQUwSbpdrMAgdxjBlpEv15Y76pS2KOAIO/GHxCuUNZ3UoZW8Q2/N9MxQCOfOTGoq3WO64v4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706004853; c=relaxed/simple; bh=gs+QbCqNiikPj0gLJvTBbE6TnYyU9UjU3AFyG2oFktg=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=tYpcDkmXJvkgkcN2nx+b2tpt3imm00q6NQ3DDFXN6i7D6mc/OqrXuetljmHOqn6cq+zFBearRr+73NDFd3Q8XCRZWYKGtXGNmtXFyI9oiNmazeHgG9UxG0vAZLPX0nZrXX6/mrhT3ifDVfPD27Xmlmz1u/9VIhpl+PLbaDLr+gE= 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=NtJF14n0; arc=none smtp.client-ip=209.85.128.41 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="NtJF14n0" Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-40e86a9fc4bso53051995e9.2 for ; Tue, 23 Jan 2024 02:14:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706004849; x=1706609649; darn=vger.kernel.org; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=Dl0txdoX5ubX9q6e6WExjH6NlAxL+YsMy4sstOJvAik=; b=NtJF14n0aOOkmsHf2yCEpnmT4IvGXPqgX0icJiSvmARGDLXqlw8wehgClNe3Cag2sG JDWl8TQ6BZwaqwQ+C4SkagPBzuSAVgRpVduWUjXkyga+HQNUYc+XtQ3eZvQUKE6uF9gZ DVlpN/Iy8y+ZE87AMMDSr7HwWvFVaumESzsHSoX2ZL4OFBOMQxWXyEdrCbzQ/gJB3CG5 TldbdTjKPrkAAMd5sliiU85oAMMIN07HrWAJFl4ipj77gRTcvU/vKJau5EWE9aPxHuPd BhpZDpkUrQNsalCrPAweIaVaCAUqQurtDxtbkd2dFGPH7dkmcvuzutPslbR9Yr8uMtLg dKSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706004849; x=1706609649; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dl0txdoX5ubX9q6e6WExjH6NlAxL+YsMy4sstOJvAik=; b=dBr+TxeGT1pnaO/qZBI0BUT3NRuNWkh+HqyJiB7RSkbWrK+NBp8kJDBQBtOF3u1yt0 3soh0lMyecimZE54gyAECb4G+76M3OgseuIpd5q7ZMrEINPPazolq4m9Mpp701hY7+3q am2XHmtBYCKvmste6DPYaVsMSHi7wdX8WBbVUMXKVs2nEz8HYLnvetltqRu1LI8bld2U us9NUQrgRXGuRaTR5z2J4LsknCOy07J/T/jomzDmuGM3GfnJ93/EBVxmGvOg63XViDG4 l0O/o5mLJRL8kagudkHVrp5Jr7GjWEDzjSmbPoteCeW/FIB8cO+AkrAMvOTCN+OJG1qy i8fg== X-Gm-Message-State: AOJu0YwSrzOGGILrOzkXZXKABvh2tnpNU1tPIduvR1w27ik++E2vwaX7 rMMgNX0kHsD8+amo1aABU9TOWpE1ydwR3YnxKr3eRV+rxivUj2c= X-Google-Smtp-Source: AGHT+IFdWvq+sPNPZWWLC7sV0PhebLTgL0c1UNXu/SCN0X19PiKoV/CT5ThwnXpyF4phCo1fPjinpg== X-Received: by 2002:a7b:c043:0:b0:40e:3fa2:a16 with SMTP id u3-20020a7bc043000000b0040e3fa20a16mr380480wmc.201.1706004849433; Tue, 23 Jan 2024 02:14:09 -0800 (PST) Received: from p183 ([46.53.248.133]) by smtp.gmail.com with ESMTPSA id b13-20020a05600010cd00b003392c1f40acsm7281332wrx.28.2024.01.23.02.14.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:14:09 -0800 (PST) Date: Tue, 23 Jan 2024 13:14:07 +0300 From: Alexey Dobriyan To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org Subject: [PATCH 1/2] connector: fix #include Message-ID: <2b04a34e-d049-497b-8d5c-3602d889ab83@p183> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Including first line doesn't work because of missing forward declaration: In file included from kernel/foo.c:1: include/linux/cn_proc.h:32:47: error: ‘struct task_struct’ declared inside parameter list will not be visible outside of this definition or declaration [-Werror] 32 | static inline void proc_fork_connector(struct task_struct *task) | ^~~~~~~~~~~ Signed-off-by: Alexey Dobriyan --- include/linux/cn_proc.h | 2 ++ 1 file changed, 2 insertions(+) --- a/include/linux/cn_proc.h +++ b/include/linux/cn_proc.h @@ -19,6 +19,8 @@ #include +struct task_struct; + #ifdef CONFIG_PROC_EVENTS void proc_fork_connector(struct task_struct *task); void proc_exec_connector(struct task_struct *task); From patchwork Tue Jan 23 10:16:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Alexey Dobriyan X-Patchwork-Id: 13527115 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (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 5990E5D730 for ; Tue, 23 Jan 2024 10:16:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706005011; cv=none; b=t9AXfrbcpAkV0afuCLB1AbNlHh4Fb3HAuGiV+zqpQc0f9Wj8FsUttLICR5rGTwQAiLSr/maCF9MFECkznC+9Gw6UxHVdNpb44WjPipJrLBU1oyHR6UOesDAmW+ut4/HjIp8zAlcIoFu1MtjKircmeS5gUvQdQOuO2R13Jv3GsPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706005011; c=relaxed/simple; bh=JHPL37lMRTAQU9k37XOFKfrRK07Q7igx+/VPXDQzLlY=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=LasHgoIHverkX54LYGRxvVPXU+RTRIH+QOFFLxrwbwOyc9vUOmuu2g/u2omSkP6WYol7TJi8BFXiYc/TxGyRdIa7/Hc6E9PxKhRdVsnRxByOuSFQc0fDSKK2kL7UV597dN6e6oeS0RKR1TjlhQIKkuRB5x2H6q7uqaYSP2gAVw0= 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=hTbn21Y9; arc=none smtp.client-ip=209.85.128.53 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="hTbn21Y9" Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40e8fec0968so53167895e9.1 for ; Tue, 23 Jan 2024 02:16:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706005008; x=1706609808; darn=vger.kernel.org; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=++wEB47Brii4fgK+9R3Z1chBpDu4mJDkxZzUYYgThbM=; b=hTbn21Y9kI+5qt9fwOT0a5EBEYMsehl0j0ZTwfU3HegjeQlLvIjZ9ovocNWyp6Cb6w Mn1W5qNiJF9Jr5oFUMK1cBd3PjRooCRxzQkAZFzqb1P1wGktoBRItalMSkg+z4naNOsG TkhWhG5A+kn6YYdpMtiFj5PiuVaEjualyAgqtt0W+YV3HXGPsZgjq6f4nBf74laT3UZ6 ymNweixPmAAlxO9ktfE0uZxTs64+1F63HKnW2j8CNWhE+npcQKTS0/QuUTDTYC+YJCsT IFPSIAQNelKHzAOtp231c9gYaO0keaDmCTcPPF8xDkYLMEIUtHuXG5YhsdZGwkFaHh3c MoRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706005008; x=1706609808; h=content-transfer-encoding:content-disposition:mime-version :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=++wEB47Brii4fgK+9R3Z1chBpDu4mJDkxZzUYYgThbM=; b=a3z9YUQTrgnZh79B3nbbRGOFGMPTSFvrwkSd6dIv01lROoE7SbpinLvScrAAYB1fwq RjMbDsDOYHPE108qrsDjmcFwBB9CAV4UY+ylt10CVllohfzObJUk3+6NVexuLFYLIDNC yYeyTC0JBXzf3s9fEQSgpxe+A64z63bKk2FLiEpEo3x0QapoVIl8N/7Mc8Sk7wi1qRS3 gVuWfNnuwrtiEW4CB7acfGo1b5vXdsGRONCH1/8/rb71m7WJSxSYPsz3OgYdd39Y5MuP gV/CTrRS33Tx7F/XeDC/0vBvkzHDS23XkBhysHbXGsrgMTYsGIvmXDj4CBjjJYxsjQid PDpA== X-Gm-Message-State: AOJu0Yy3yj6kfA6jBtcmjut39onRUbjJjVkVTAb+BeQa2jMn8mCV/c9G av69pjn6UNfwL6Up5mhe7IFGrJeI02+Ejptt2J8W9XLv7ADS/fg= X-Google-Smtp-Source: AGHT+IF4N8jSOXqT+kHed67TSMvfDzhzJdkOh3r4hXbzGtCIADALYFTY/T4SPZGCWBMhnH9XZhwiyQ== X-Received: by 2002:a7b:ce15:0:b0:40e:44ad:2e47 with SMTP id m21-20020a7bce15000000b0040e44ad2e47mr389450wmc.185.1706005008510; Tue, 23 Jan 2024 02:16:48 -0800 (PST) Received: from p183 ([46.53.248.133]) by smtp.gmail.com with ESMTPSA id n22-20020a05600c4f9600b0040e53f24ceasm41830850wmq.16.2024.01.23.02.16.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 02:16:48 -0800 (PST) Date: Tue, 23 Jan 2024 13:16:46 +0300 From: Alexey Dobriyan To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: netdev@vger.kernel.org Subject: [PATCH 2/2] connector, linux++: fix header Message-ID: <3878dc5a-9046-4d7a-bf9e-70dcdc5d9265@p183> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Rules around enums are stricter in C++, they decay to ints just as easily but don't convert back to enums: #define PROC_EVENT_ALL (PROC_EVENT_FORK|...) enum proc_cn_event ev_type; ev_type &= PROC_EVENT_ALL; main.cc: In function ‘proc_cn_event valid_event(proc_cn_event)’: main.cc:91:17: error: invalid conversion from ‘unsigned int’ to ‘proc_cn_event’ [-fpermissive] 91 | ev_type &= PROC_EVENT_ALL; | ^ | | | unsigned int Use casts so that both C and C++ compilers are satisfied. Signed-off-by: Alexey Dobriyan --- include/uapi/linux/cn_proc.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/include/uapi/linux/cn_proc.h +++ b/include/uapi/linux/cn_proc.h @@ -69,8 +69,7 @@ struct proc_input { static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type) { - ev_type &= PROC_EVENT_ALL; - return ev_type; + return (enum proc_cn_event)(ev_type & PROC_EVENT_ALL) } /*