From patchwork Wed Sep 11 17:51:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13800946 X-Patchwork-Delegate: kuba@kernel.org Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31F3E1B1D5E; Wed, 11 Sep 2024 17:51:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726077110; cv=fail; b=sQX5e0nKQzZiduKT9hEqDPmiyLu/VGJ69j2V+nyAGtcE8ewrRV3Xd0blrMFE9SqXn50Rbm65y61N84vCULfbzk1jGkayL9OnKjcBoh6FKhoDFO4qbTJ160/p2ZUpvFeBwVdqeGQuDcT4+0LyNPNr2sItR6J6N/vPJlnFTcfAZr8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726077110; c=relaxed/simple; bh=kOzRzpwQO/kcTO6NvZvIiFGE28kL1HXzWO44O4sUCOM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=CU+uS9WEY2MHbjEbYt782/UtBa+K3csVAtZEkKeDJ6aG7APKLx6OTwvaawMe9X1Q+QxDemiqzjcHv14wqgYfrMv8KaNkN/EGza2QpIBjXSruoRgxhRcSaubWebuBcqKhdnSOB2MEPpfI0ELMYy/5yAFcFpAoTUwn8Gb3CiGFhVM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=EyPGmlfy; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=olj0DW34; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="EyPGmlfy"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="olj0DW34" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48BHfWsP006826; Wed, 11 Sep 2024 17:51:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=TnFDmLnySwS7TzxUCDVEsw91kZuig8JFy1CuaAyJJK8=; b= EyPGmlfyITCq2k3+5k1vOhHEvtfYkgjIXR2XdDT4rHpATgbJF5qKqtobtxUiQoJf u5Kf3EbowMGlto0UEOi6dqgYM9Savl3eT3HaR48MQQaizvaYF0/fkpsSqKmM41R9 FusCPQFbjfarrqZ/32vAPSa9tvkQvalhxCdxMWpm8vgzanZwRARlxgfcVsWFTz07 MqwklsqcrVJygpXnMAXEr9YEqkg76FbcB9HNkXbmPuFX7f6LytG7NgSJE+fNsSqF 4QGkQafjWb8AIUtoO0CSn58qPooivendfRbeOKyENnSv9T6TBQkrVZ5CcHwZQ3ej OO5tAmrP5+ktHavnfzNDuw== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41gjburnds-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Sep 2024 17:51:22 +0000 (GMT) Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48BH9QEI006225; Wed, 11 Sep 2024 17:51:22 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41gd9aa0yq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Sep 2024 17:51:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VpJuFJjytWq/I3fdjqOMO+koinoZZ7UlvDOL/WTs4LHiIhYuPFUENW8k5R7qcihsPXuorDQl0HPZ2Sd2eFPw8gDIwKswXPv3wsRJlR5Cs/EV3ybP/OolKKZr1J5fJNaAzSlz0d64K+CEpmxVzTjbPODK4RafsjP1QiPvVhlIXxwr+WXR4ywfhy3+JC50BrRAp3cwXBHC2UlZXDVnhqT4ad1ONC+ybSQTJjSAf4Yn58QIZTHGdqOw+Dx9PDfvCJa1stuTWR91Hb/31DK7+KNPXw5AhZ30cG7Oys3XMP0ZJPrDIf8mSw99yOUwZ8iP8rtevlX5q5kADEl6+M46vNP3mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TnFDmLnySwS7TzxUCDVEsw91kZuig8JFy1CuaAyJJK8=; b=YWpz7BAbG+MzIn2LUvP1k/RE5I/MOnUW7CuE5PQNaQwkSZ4cZobMzKXvvY/t1zPZTY1s/g8Q+utGS6lEfEcqLPk9z0NscDfbYe68khIVSkmHhpLvhMZ0wp4WoZu+So344nho9mlSMQcPupxxGNLIvzKD9IzZyD3kuA1xwz4eGgNuyZZklcLeFx7x3NeJ5gmDTiahpbb+ah+Ztg6+SeKv/RyBngfwtF+RQnCbv2eIlb4tqrAO5d4N1+BAe8tVR8gcza82xKnjyfo7EIWjHLN/Sr0xpnK91Mm17S0y3q0yix7mzr7VJD1bzGMGNlCHrghGSOFFSdxj4i9VZDJH6uyjxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TnFDmLnySwS7TzxUCDVEsw91kZuig8JFy1CuaAyJJK8=; b=olj0DW34MMvJomGmWTSyHGihP4+9nBaX7NbUpdD3+zpyPaOZllz9USjXHSu8fgxcyx8/xDYBAW5gOiWGiaUjaDSEn2GCngV57Z297vmpTwJc7rxAo72xC/jXi2/ypTpPptlhcQbj9cLaOF4HA+m17a3KANZuiIgmaELMcwfr/8I= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by MN6PR10MB8046.namprd10.prod.outlook.com (2603:10b6:208:4fe::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.17; Wed, 11 Sep 2024 17:51:20 +0000 Received: from SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e]) by SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e%5]) with mapi id 15.20.7962.016; Wed, 11 Sep 2024 17:51:19 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: Richard Narron , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Marcin Wojtas , Russell King , "David S . Miller" , Arnd Bergmann , Linus Torvalds , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-mm@kvack.org, Andrew Lunn , Dan Carpenter , stable@vger.kernel.org Subject: [PATCH hotfix 6.11 v2 1/3] minmax: reduce min/max macro expansion in mvpp2 driver Date: Wed, 11 Sep 2024 18:51:09 +0100 Message-ID: <0f2607b7c4a7863e2f9590301d88e61dd89c31d0.1726074904.git.lorenzo.stoakes@oracle.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-ClientProxiedBy: LO6P123CA0041.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:2fe::12) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|MN6PR10MB8046:EE_ X-MS-Office365-Filtering-Correlation-Id: 757b6dce-ea71-4ff5-b6e6-08dcd28a5739 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: IL7JHDyrXnv1O4ttHT7PRtNFYfntUR8zAL/GGsnMPS9YuHFSKEyNtVKlJcP7Bw93VG0aW2w2eMq8z7EKeYy1hyVTZPxGCTUQt/LaG63oyMKKjum5smhyDevH39shWivNZDMoms35vLc9RqDq1Q46kqzL8YcDbMr8jdcbNsjx1vwD9IXR2G3g15OHoM+EsvhnUbIxbj3Tt/iwEp8o0EA92WrxlZgUF83OU/M9Gpb1ABBM3mG4wGXrUpTfZ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1N4YxfwvxqD8I1VZLca6ibgUmZHxnbA9vnFSXA2N1Vw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5613.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1CU/yZuIX8J0hmAq0Dh/YYbKxaOKnjxsKT4h2HDcvkYerUPnbwpgM0vwt/RtWq47ivdxRCNLoe12mhLweOS+nYb3ANgFT10neA4cdawEMcEeebY8tshYgjb138WnOA7hOMhOzwuvlIVpYXQw9/dPyr8cvvgZMVsj7wWPDaXJoGARc7clpWjFQYt0Ecv2RFZBayVKqPy3QO/We4BNG5UzZLfk2keAtcrWbQ+V3oEr5xVG6V8gLjNTgo2QCIMrpGFWLH45K65s368dLpIiWqmmnk/IsZquCq6haX2lwa+p5/Emp5leUmhcqLjrwgDxCWXhn9Daw7uZE+/wVPMQObRZbEG0xFK5FhfEAUsL5jQIYPFyQ1cy4Uw1FocIkQ6XCRTv4K+uEo2Jh2cPeflDADlc0sUpJ+wn6/TTdJgy/iPyoT0B0K+dGhNuE/FM5fuLQzpIRbFkoxll8/UjLCmhDbhXkPrDpIr9zENOE70AD7kMuGQR0o9EbXO/wnTjcdrgub3FYdNqbWvms//bpkuzQyJwgve8M28aQMmGfejGgByZFHNOiWuzkmWRQmqb6cYkbVhYbIfRH5sCtL0ZgXl6Z/m7+R2/lckXEUxsQdT9A2NM9t9SkaMrBtUUPMSBDhpBOVLRp8XiX5yOZQZYQA/kJhoKljAtlbsQlDc8i5xtVtKbfILOTH89zWBGEhBAdzyBRs5iRZ5TXcbnwj3tgyiqlmJr8x2SkpsL9FQHfosULwmVhqGJl5Hzp7UdFiAWTG36W0Dky4e7T870nf1dpE7sX1pkNPxWmSO3LZV0y0MH1A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lLZtededzYmDgJKMhpVgMlw8EykE3i6qz++CpSd1946bSYFNUJCqeZQnlVtIDvSaECpOJl4W3YpKrQm7wGfoTS7dhvbFw1noMwxz8Je/ARRbr73iNrQfDedkbGEDeAs38TYd6jQ9Vzx62dBoWXh6fQX0nmuYFYNzfwrmjzFp44YnPQfqPxcQKr7SLZIBegrcAUCfwAXSXCOFJ/FOiBsi18Vh8WeZygcg+qL+HItNLHq6aOkMc+UuwDvtfMo8V35ugXuU/5EVf5Ah1c3reIJKZc0D8R08oWSgBoBMKIYwy5BMtvgqGhtbI2s4CF3PK9AZuIkz75x3Gs6r4Wxa+E6C4t9WExpAbMalGCqS/GYWxQ42wfAPrfqUvvwJ+CWmGCiS9qzLOH2jyjR5dtP7mxS05z8Tq4fwi4ymbkoHqEU519oqAUTaVbg= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 757b6dce-ea71-4ff5-b6e6-08dcd28a5739 X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2024 17:51:19.1966 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GyGA29UgNf2yO+YesG405X+MVXEQompswTFrmKf/gC1ZtNF0VHjr/uGHromzW8VIKH7J/TxbRkrkXL5cOAJPitNw6d8ppp4aoLvZtkpEdH4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB8046 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-10_12,2024-09-09_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409110136 X-Proofpoint-GUID: n9XENYsE-zlZBTn9EjBrwwhp2BBDIxpc X-Proofpoint-ORIG-GUID: n9XENYsE-zlZBTn9EjBrwwhp2BBDIxpc X-Patchwork-Delegate: kuba@kernel.org Avoid unnecessary nested min()/max() which reults in egregious macro expansion. Use clamp_t() as this introduces the least possible expansion. Not doing so results in an impact on build times. Cc: stable@vger.kernel.org Fixes: 867046cc7027 ("minmax: relax check to allow comparison between unsigned arguments and signed constants") Reviewed-by: Andrew Lunn Signed-off-by: Lorenzo Stoakes --- drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.46.0 diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h index e809f91c08fb..8b431f90efc3 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2.h +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2.h @@ -23,7 +23,7 @@ /* The PacketOffset field is measured in units of 32 bytes and is 3 bits wide, * so the maximum offset is 7 * 32 = 224 */ -#define MVPP2_SKB_HEADROOM min(max(XDP_PACKET_HEADROOM, NET_SKB_PAD), 224) +#define MVPP2_SKB_HEADROOM clamp_t(int, XDP_PACKET_HEADROOM, NET_SKB_PAD, 224) #define MVPP2_XDP_PASS 0 #define MVPP2_XDP_DROPPED BIT(0) From patchwork Wed Sep 11 17:51:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13800945 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7AB321B1D5F; Wed, 11 Sep 2024 17:51:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726077109; cv=fail; b=r1QmZYmTXBkHLdBnnRu7tMMqT/rXgDZB1jFyRJTvW6EwujupTyH1HCy3jSiVlRwXrM8hfCubcEYMAwmVgHNOKc/GX74URHfq50QObxueNaNA8r6FO4dz/27CIF+SqgBqCEOYYyFXzfaUXtr0M+Zkc6xTwEdhaBfau2P1QtNUlrM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726077109; c=relaxed/simple; bh=s2I8wnRgxloJGkk6USIIqIVA83OeHsBDtkRDzJe7S9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=nSai4TXCDHwr8D6GBvvquksoL6wc5RH67t84RBmd7ubV8m7yw06wUXpzHcDGpe3N0/ooeis7ZvhwLuUCurhxM53s3cD1XoeWvPN787YDRUJXiS3EkSBQJGrMEUcyomqsWl5mANAhOZYx4M48xRYVfL9F+lho8K0RHkT5XrY/OFY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=bfAI+3/P; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=jg0K8a8Q; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="bfAI+3/P"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="jg0K8a8Q" Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48BHfV7k006777; Wed, 11 Sep 2024 17:51:26 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=aijDqYqfpfHC/xgzvGXjEYkRKd58eGDA7vJfJcZob40=; b= bfAI+3/P9GZTdsyL915IM0k10DjiJrguYzPbyV4DbQglhu69hA19Q1TNX+n0fLa8 Fs903g3fiqLeAHUiakLFO1UjvNrodYebYu4xN3b6iwARF8vMsuEhg1K9GwCJEwwf oQjM972PgpzlSyAnfUeuhqYbugcYf6wKpkWnYhkhUms3Y/z+PPlYZx3v1hilW4B9 J3Z+G3KZ0fkaEZVgatWhB4Q1c6mgSxVS7+JkJ0UA/xxSCJxEE+kN5FCrx1kEqGGH 9BDjzCFY2Us2de04ViFZivqgCTaTdxqBuh6mwj2vfNPq2gmIPyfcxCj8AupGMPcL N5CjGTCp4IP28PrAzEZc7Q== Received: from iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta02.appoci.oracle.com [147.154.18.20]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41gjburndu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Sep 2024 17:51:25 +0000 (GMT) Received: from pps.filterd (iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48BGDpT9032401; Wed, 11 Sep 2024 17:51:25 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2045.outbound.protection.outlook.com [104.47.66.45]) by iadpaimrmta02.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 41gd9gjx1w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Sep 2024 17:51:25 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RiNHU3F2m304SoHfz9HBDjsbLMvvYQ+SLvEpFbDKdXCTpEMWuL6RDrhQY20SJZd+ur1OmIoVuSj4HIs/gnLshGn95vSKTpzwNfJojZuiHGnL3faZuM6tSXiHM/0B1LoRyUBrDbllxxcjTlCaWfrSiLBTct3JqYZMMsFmkWoATA4Ui2gmG8+ku4YO0UZkp2PTLmIMiLMqTsOugLiG/pMONcC7YaUUjwQMBjHPujgJtk639v19gbtYtzc6gJvHKOr8b7KZKg1W7zQpEmBnMIku7IR2hKuMwE4RW1o525k2zMxiz46VpLZJPVThh77wbV+OY+1t3+s8pCrz4WyI5v5naQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=aijDqYqfpfHC/xgzvGXjEYkRKd58eGDA7vJfJcZob40=; b=YoWaAdwsQ1Hgnt4LISgikxfvxepaFQABqEs/pFBrnjYaeeHec/+YQG1r8b7liFJ5Sxl5xGxLM3pcLJpsZMyoQArbHNDU6Z2VpNurDH4shGt6Mt3iPnoi/Ko7M+s7hrzrULPAnh0wxsPw3lQXRdMHPz/7gBhRca/sC3kDh3a4mp0rpCLPFL648zdE+x2epCZZ1YnrhlIrFKRLPrpy0Fkfzy3BowPC+0W9mA/HTzqoxgAfuqdM7fAOVU8gt41l+Zs6G81W0pHAR3zrJ7Tv8W9IU3Yos8LqG/EKHftkRg7W+XJHrHtBKSz8oMOaFK7gmG/V9ycBTwiOvQOyKhuN+CLiqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aijDqYqfpfHC/xgzvGXjEYkRKd58eGDA7vJfJcZob40=; b=jg0K8a8QUpwf9avlV8GCVhMBl3lvpSZGkvZjy6FlEvhqEkdOfijoJuvXz4cD5dP7bId6PrO8eYJD2yEccNM1imT5Dpcya5m07qxPfOJVls3T7U3lfIqNVLya7DPax/VReJaO9DaBUvzgp49B/IRhS0dIq3R9nFBWcV2UHjSBHq0= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by MN6PR10MB8046.namprd10.prod.outlook.com (2603:10b6:208:4fe::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.17; Wed, 11 Sep 2024 17:51:22 +0000 Received: from SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e]) by SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e%5]) with mapi id 15.20.7962.016; Wed, 11 Sep 2024 17:51:22 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: Richard Narron , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Marcin Wojtas , Russell King , "David S . Miller" , Arnd Bergmann , Linus Torvalds , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-mm@kvack.org, Andrew Lunn , Dan Carpenter , stable@vger.kernel.org Subject: [PATCH hotfix 6.11 v2 2/3] minmax: reduce min/max macro expansion in skbuff Date: Wed, 11 Sep 2024 18:51:10 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-ClientProxiedBy: LO6P123CA0056.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:310::13) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|MN6PR10MB8046:EE_ X-MS-Office365-Filtering-Correlation-Id: 7822105f-cf4b-4593-241f-08dcd28a58fa X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: u/0TUfUstHVKDgxv2sEoHCvUJxdplIQimnSmpUfrbn/5fb0cqDHlT/3+w5G/1mzMru9yD3KaiOFHFCekydN+QXHpUurKVva4CneU9SiQ8v/ZjtPFCSfdiB9N2UHnf3wICii7dNalFudhrmkPrzyviZmtKzPbUeOzzDWl6jJQYn+chcm3m4fKYeil8UwXg41yzEbtBUfbdGbnVnk30haW0phHN8g9VyKtMi3fvuaPD3Op01LlIIFsla04KdZBJtNxwu4VW256a9egFk8mCT5HiJXbBCMl4OuSGvuhposTMQPIY2YcstnL0R3Si15BgjSBOZIb4vnfY8V1jegHvacMFqV59zw8psDy8CPX20EQwu1eIeBeYUEBrxvSHdorzroaHAbRMm/J5rRTkHFtsyVijdhv4jJ6px/IiaVETQdTgsP4sEvFayMxqeBj52JKAD17ZrqX7wvTI8fC28l/+WEGin5V0XtuKFANSDVymu4PgzWYK+t4yBQPC10FKLhtTp0vZegxNY4/1mPRk0UfoxkkiWHUbtfFdv+32WUVK77mkCl3K9BaRHxeOBCqyxH7sxB7pF/+jb/Lb2c98IjZJJl0cLAKorhlMtKj1dPXAkeFFO4eMIF7zsdkzEAUI9nejyyBSDXzMXxL+AAOf0TtLlMCFmJmdbJAdg1A4SqpuYL6VmdKoboQd3ZGrQtZ/vqUReZ3PGuUElV5h2oH0XS4yiINt3TT5hGV0Ri4gAt8Jkm1vpgVFeFXjsWBIneHnVEnc+Ue1fo3+ffoqhtHfuYOqtLAiEXFPqml3AoVL80cOmvV0Z5MuG3kLcbAQps9W37pdrey0XMV4iJ/8U7tlLM3b9zFm0svds91vsg6WmKoQ+eeufYoVZDxUWI9jPcawXQy1doZRChDHxuZ56dREvXoNV6oxBGcvTFfaGSyd9LJ+t3GiJuCJ2jsS6YcgNQR2cJTN0Y7dYAOSgNH5lhUVgqG7XpU5RbTMDoX1XMxRFBaVkjtClu+i9x7jIQjN6FXysNw7cuB2Szl+5Rrf2HUMGXQaDSEu6KG7WI9Hl8VE3xVbfnA1+NxnDIgnSgQi8dI9d2//wrX7FKZrFMv57xHqgR6OffX3gpdonW1zJJLE1xtfCQRAYI0dkiIaNkDr1klpjgodzAYiZ8bwYkVTjQgV9ra165OJrmfH9jtdue2b4XFaWY9AByhY2ST4OffR4YmnyaLXLvkEHXEtRecTjx5sQUw2Mtl1pRGEEbwfqyhT6V0cdmWO4SqRM8rm818DadqjS6JgL0O1V+mq2wfazWEe/Z0Nj+0J0Uuu1U7pvxANe+MS/PVpYnDg0N320VER+w//xmJ+lrK5QVfbJmvM1uAc8OY/iIMRA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5613.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pcTbz+A+IrbgPuBSilM/5u2tvK8Z2PVgjehaI7ecySmbU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z2Rx5ELrwvjqQaP8m5qvKyvFnVTbPAzr0/JIwKQqKOhjLbW9tXVmSDXBknLD4a4ASPq69oSPf5+LtmEknmlmdwEkcVIfQTjY6wXgZkP/nj1co= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7822105f-cf4b-4593-241f-08dcd28a58fa X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2024 17:51:22.0975 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c+UPsziK8VFTosBm3lN1N2sZIoxpeA1gEEX7FWCAeqiBqQhF5/QdpjFsCBKsZ4fuiMZOFYFjNcaUQifSbhP5XL8knS+8FUoYhtJ+69Ae8Vc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB8046 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-10_12,2024-09-09_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409110136 X-Proofpoint-GUID: r6ssqqUxzaPY6O7zUL2a3hF8cwYiZ8uh X-Proofpoint-ORIG-GUID: r6ssqqUxzaPY6O7zUL2a3hF8cwYiZ8uh Avoid unnecessary nested min()/max() which reults in egregious macro expansion. The nesting occurs when NET_SKB_PAD is used in a min() or max() invocation, for instance, various ethernet drivers wrap it in a max(). Not doing so results in an impact on build times. Cc: stable@vger.kernel.org Fixes: 867046cc7027 ("minmax: relax check to allow comparison between unsigned arguments and signed constants") Signed-off-by: Lorenzo Stoakes --- include/linux/skbuff.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) -- 2.46.0 diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 29c3ea5b6e93..d53b296df504 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -3164,7 +3164,11 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) * NET_IP_ALIGN(2) + ethernet_header(14) + IP_header(20/40) + ports(8) */ #ifndef NET_SKB_PAD -#define NET_SKB_PAD max(32, L1_CACHE_BYTES) +#if L1_CACHE_BYTES < 32 +#define NET_SKB_PAD 32 +#else +#define NET_SKB_PAD L1_CACHE_BYTES +#endif #endif int ___pskb_trim(struct sk_buff *skb, unsigned int len); From patchwork Wed Sep 11 17:51:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13800947 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15C2B1B4C56; Wed, 11 Sep 2024 17:51:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726077116; cv=fail; b=MLTctAwBGh2PthPjb3NvGgEuWNOE1QDiuhraQ8wm7fFVLwn/WT8niI6yuCd2sfjWstYs9b4dk38l/6Nvsej2SIzydZEpcADxhdI6zJd+Mw097J9V1hrK/XAAhqJOnyIIJ2+YY0QODy1Xto/SMvOo+7BoULknr17zq1+v2mRFLKM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726077116; c=relaxed/simple; bh=3WSGzcuUgBVUtOIRoPJ5RFRPerzQ41vnQfDItUn0g3A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=uUIBzGjBGJW+fROE8F2mf2Vo9tay9M0g5G97Q/aeXgTP/2iyGqrFnWrsJJtgr5ndGeg04+11/GhVYX9L5HNWs5gjGy476SJR4nq183qexkSo9vHgwSHPsxHGWtQWmnYymkT8ngo9/UWgqLxWP3fjteykc3KErDIt1gsl9wyYcg4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=f1kHuZjJ; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=sAcGkrM7; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="f1kHuZjJ"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="sAcGkrM7" Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 48BHfVBu012781; Wed, 11 Sep 2024 17:51:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :content-transfer-encoding:content-type:mime-version; s= corp-2023-11-20; bh=Xo9RaLBa9atMO4ZoStLw7lMwJc1kqTeCMxkNkvOt45M=; b= f1kHuZjJzz0xSuglkXLGOXUaZYAUptqnjnNgMvDrunUNsF85yLEIXqSgGMWIQ7Yi bHj+MnTimzCyKZpNuGLGUpIM70fU6bQYCXD/7X5/nBJEBVhYAVTRYBMa0yy77G6n rj/PhP28C7ZBRgbw/1TaOjzsp/ORlZOUJ7/rbERH/oz6MLNRfb5ga9Ov33hEDgOj afhrGHlcu8s9evOTrWhMJMeSSxotUUh3XUjrz6AJpSnNWsgDBiCod9Ezfjire7Je xpzj1QY2LAVkwEi3hDcm3+K32WqZaI3Idhg9+wqAoROdHCoQjeU5rvUJ8IINf6SP qwWLsRUUSKZmzRYNrV1afA== Received: from phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta01.appoci.oracle.com [138.1.114.2]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 41gdm2rwp0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Sep 2024 17:51:29 +0000 (GMT) Received: from pps.filterd (phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (8.18.1.2/8.18.1.2) with ESMTP id 48BGghQp033536; Wed, 11 Sep 2024 17:51:28 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2173.outbound.protection.outlook.com [104.47.55.173]) by phxpaimrmta01.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 41gd9a9jm9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 11 Sep 2024 17:51:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Qv0L3APyYTi2IaRGuoCby3jainUnPwgx/4mIn7qCVsDsOAuqnLJBYKTU2Fo7Yfk/9Tzk3ju3NvutifesOPhkJA7f4vvvY1lJRdvNprGtusoTZZ/NOOmS2dUIS4EzVvMkbeoWJ0zZee8ZbOtwm6BmwN2ZU0TTpIu0BxID/uhkmn4AjnIGih3Ya+3cPIjvn/j+gvjMPuqR8X/b2ln5/nSwbi3mkkyZb3u6LhX8lP0eI2n7vbxJCpr4Kx2r2wffnhVMEIpcC5sHYIkyhXKkYUxyJV656xCVF6zmj2XkrNE6xjtRHD/vzI+Qp7N5Ra93h5SVgJxOHy/Tk/1HvLbLaY75KQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Xo9RaLBa9atMO4ZoStLw7lMwJc1kqTeCMxkNkvOt45M=; b=lVW/ZS0ea19SVmlcut0F0G6bukb5QH4jFrlJZnQ3ywfmTSli3VNE8BBoEL3F8I+GHk5F+eMpxBZF6aXUsO6q4VaT5Xb+QBjYMlc5TvzYyqQRpgrzQ1VRS7zt5ytJQDdL2g/eHEMmGwvDWEu5e7aM070VEQ+RL5p8aQ+miv+N0VoUyRbj+1jEqo3TNLEur37DtyunUd7NLbEDf2WpAf2krTV9e+elxArOl2IvKU+SkgF+jJSmFJV+ad3U/Rpxp1mHgzvJ+QnwbqGkcTlb1G8InJjljgTMfvwJU0txIklm3CjNa6vMKfOI5Bk2ROyqDMF78LGUyKzsW4h1wbckEAob8A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Xo9RaLBa9atMO4ZoStLw7lMwJc1kqTeCMxkNkvOt45M=; b=sAcGkrM7JQ9RXmEIop40ht0RTMXlgcAbtvtC6rKuLj2SDHm0pmi8YkIKVgJqinyc5VgmvbwI/MCDoN53rsuZQr6fp1FQQJ5RnuEm/IqJGs9qMZG8/qcQHVtMSIOkpc+Lsp6QL9liAd9OXIByL2OLbVQ2c1I899jKhnktirORwhw= Received: from SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) by MN6PR10MB8046.namprd10.prod.outlook.com (2603:10b6:208:4fe::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7962.17; Wed, 11 Sep 2024 17:51:25 +0000 Received: from SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e]) by SJ0PR10MB5613.namprd10.prod.outlook.com ([fe80::4239:cf6f:9caa:940e%5]) with mapi id 15.20.7962.016; Wed, 11 Sep 2024 17:51:24 +0000 From: Lorenzo Stoakes To: Andrew Morton Cc: Richard Narron , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Hans de Goede , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Marcin Wojtas , Russell King , "David S . Miller" , Arnd Bergmann , Linus Torvalds , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-mm@kvack.org, Andrew Lunn , Dan Carpenter , stable@vger.kernel.org Subject: [PATCH hotfix 6.11 v2 3/3] minmax: reduce min/max macro expansion in atomisp driver Date: Wed, 11 Sep 2024 18:51:11 +0100 Message-ID: X-Mailer: git-send-email 2.46.0 In-Reply-To: References: X-ClientProxiedBy: LO2P265CA0452.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:e::32) To SJ0PR10MB5613.namprd10.prod.outlook.com (2603:10b6:a03:3d0::5) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SJ0PR10MB5613:EE_|MN6PR10MB8046:EE_ X-MS-Office365-Filtering-Correlation-Id: 88680aaa-a288-42b2-8a72-08dcd28a5aae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|366016|1800799024|376014; X-Microsoft-Antispam-Message-Info: BCumDvTvGSs+3Laf31bCGhwm3IjCGCeBF0gnuUHEnqdK60pi3Gb39e2s2ejPQwqbIORfmRrOpHI5AdABEC4njJwIvRPCO68JVjC7FFHQiWheMbdwCjt+1Jgf6Ovei73c57uNPvSWvtzzJIJVSzel2hzzHchdWoeqzc71Gr1wOuHtAk5JChbrTvrBt8HuOOcyBGTewj7v6CbHhhA3W+0POskKO+Ojq3hXb5UMn3XYNItRJ+vZLVlVwGb3odsqqz8LwJZIhPBhOyOXuFhHbCwhwQ+51QO4sllgS5MzLhrhvUanLxJjLqvyhC3jKuV8syUBmqIpYqm4tVEEPFn/VQxiUHLn0v/OlIaxRKHliU0GzX3mMSFiLWQuVzDoSHG9XPQIGqg5ayo7v0NRFWUMNtLynosG44oiIgBIv2Ttm4poWQv7yrfXazbEwyaEG/1ZdWHEKWyoZTjWlZ7tBnSbvMJts5W2kWksvpPLqA+yfaWc/mIBEOkfhPmB+CJSEWvBXdYG3dEULjZOCNjqoRCVRFmPTieD4woBuSQv97TyN0m5ZTvF1vefB/73veXMgkJWoQeSwPw3QaW2Aj0dMHAFbsG/pHkM2Lr+uoe1rUFM99Pc6AB6VHhz01ow7VJ/P/O81OEh+/0XXLSJoiL501pbagx4T+R5s2hm3D/1U2/dXKLFv8WJU9H4Y5hJU+Eivh7fNkdLmpLnTiTAZdXVb13AzDLdhQvROV73YqPm0XpZbJNg86w3D0K0QrwopiVsoAydNAizI80hS0mv0FsOPchopInW7dJS3Zc0jz7utaMRtkdWPGXRceAb+cnxQF2RI3niYRZYQUB4sJaag+M/WveT2fMNaveVWga6RjSUelPjfwjWsvc41xshaXoFMBpYqDB4HA5k743fyYpujfAx/XmS+m9F9NhezUZNO/UAlnzEcXMcniepLRleM8Fzk4DP9Sq8Od6QRDwcu/DE6wvH91rfddTu+6/zBUpwNo767fDeZgB3djcNb/KeVgX1mw/DMj100NJW7jacMFWxZkXJ3YybXcT1IurmrTjM9W/72E9sIYmMHyDqlMoIqEIA31qjAqvEPojdc1gTA5vc6Ie7++73BVLT5Q9dRD2zRTeVr03r0XqrMym8KQ+ely+3C/qWZdpVR26TFAIykF8IwbNvyYQPhlqP1k6vWSeq4ZYiNYcSEfGX6d60shqi/xLIueaflGrjBR9bEUxYkawvYfKIVf/rGd7p3tbzqgo4hQR2GEvkPOOenbB7mfZKSatsFlBtLTGEXqq0XJ5RxYhSHIKv9eSohs7Xu0N0T3RNmHxa6gbwdDHPx4DHiB35I2IwmCaHD5Otb3IUhX0/SPV3vCbxgg6CXVRxr7l6Neban7+k23Z1aSXFOcQ= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SJ0PR10MB5613.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(7416014)(366016)(1800799024)(376014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: H7UY2yi7fE3VDRK/lzW83uTg3q1SogNfjieg+H/CscIC7xhhcxX9+8emv+hyF8Z4PzO2YwmddW97d++T4+qEyAsNLXZwkPCCzhk4w0U3Lmw8uRI5SULA4yWHPqsdwOedcHoSnmvQ/LXiF4jng1E7G7QA2KroApuqi+Lil62X37OSnCjEDRxjr77x5oPs+VQ6pUOeVQvsiqVUjDxXR0HY4DlMnP/z8dgxAK5IonlV5gXDmqsYjA9W560js2nXYS7ny8VpBzzGElN+Pt30wl6WZ9bPQ1ZiC8k8x9ujBKrm0X1oit3yAKIi5D8j6iEx4LuAQC5LdLtpti9jaSaGZxW18mb9iuW4c1m+z/ksO31TJR0ym5AUUPAwwkGlR75876OYZ6j2G9DuxO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EPaOqCnGlurggwvte/nok/vxSvvI73PT6l4Lts+6Zb01drUW0fL3BHDfl7ySDRNHObNTSHRfh0mmE19fllQQZyN9vNUmPUUbeqe8paGC1q+FIB7JJc66WcnLODNXlSpOhIL6ZE2pNPArkwjzWw== X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: poUJ1h6lVk/nuvw98Y5LjLVCN9wjpuvKNG4p6YmyNJpcvhipEqi5DoTTlkvvtZJXBeUO0Otfi71WtP8bTx/jf55uDto/uLRPRMfXbtW73KyVZ8iVTPW/N4ExN13yfELz7lszUG1aL+2Urf+Pz5VRYuI3YSql3LngQx5EocdW59M741+T0S5txwTB1yKYy1uN/uZvCG9lXTkE5NANNCIA3FPkUYteeTrAM8teWBDvebgLImmzeQeDmFxFIceOwdD2R8xbbbcY5yElDEHt5xUGKR6k7PyawcI/rG0vSeHan8ZETSrOc8UM4WppguR7hgi97NrYWAyHbqKYBi/olVnPCGdTA5wX9z0sqFNp/ZPUIqcc/XrAUOtNniWUHGB4DU2QuOmVSUnUwrqS3HtQotJLmVCjoJim1vUqfVC4JLBWfesrt3UloFCv/wKwEBror9RxnCSEbXeP+isRSeJ8kjpdvyEOFS24zChYNPkfcDMXIg/yale0jMkSyHLCAjZeUewBJSyZCK9uZZBu6f2fx7R99aPAfv3LawvzS7zFdWDgMJRAxY5TZiZPNIoDMKuWkLF2ScsCnd1vhFhatUgw8aqyqaPI1SpHqJbY87HHMNKrXkk= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 88680aaa-a288-42b2-8a72-08dcd28a5aae X-MS-Exchange-CrossTenant-AuthSource: SJ0PR10MB5613.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Sep 2024 17:51:24.9367 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Ub0vPHUsCv9YU1lqVTRe/ARYcQXMmaMHCl3XZhFiMno8XesixTHEQ8E/7qrS4NHcEeOE2SSvOLVEPrjmlmbEsOd/iB61D6iox6cfqmAXaow= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN6PR10MB8046 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-10_12,2024-09-09_02,2024-09-02_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 phishscore=0 spamscore=0 malwarescore=0 adultscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2408220000 definitions=main-2409110136 X-Proofpoint-GUID: 39i1THJ-djTH1ub2lkPD41PyHN7TdYF7 X-Proofpoint-ORIG-GUID: 39i1THJ-djTH1ub2lkPD41PyHN7TdYF7 Avoid unnecessary nested min()/max() which results in egregious macro expansion. Use clamp_t() as this introduces the least possible expansion. Not doing so results in an impact on build times. This resolves an issue with slackware 15.0 32-bit compilation as reported by Richard Narron. Presumably the min/max fixups would be difficult to backport, this patch should be easier and fix's Richard's problem in 5.15. Reported-by: Richard Narron Closes: https://lore.kernel.org/all/4a5321bd-b1f-1832-f0c-cea8694dc5aa@aaazen.com/ Fixes: 867046cc7027 ("minmax: relax check to allow comparison between unsigned arguments and signed constants") Cc: stable@vger.kernel.org Signed-off-by: Lorenzo Stoakes Reviewed-by: Hans de Goede --- .../staging/media/atomisp/pci/sh_css_frac.h | 26 ++++++++++++++----- 1 file changed, 19 insertions(+), 7 deletions(-) -- 2.46.0 diff --git a/drivers/staging/media/atomisp/pci/sh_css_frac.h b/drivers/staging/media/atomisp/pci/sh_css_frac.h index b90b5b330dfa..8ba65161f7a9 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_frac.h +++ b/drivers/staging/media/atomisp/pci/sh_css_frac.h @@ -32,12 +32,24 @@ #define uISP_VAL_MAX ((unsigned int)((1 << uISP_REG_BIT) - 1)) /* a:fraction bits for 16bit precision, b:fraction bits for ISP precision */ -#define sDIGIT_FITTING(v, a, b) \ - min_t(int, max_t(int, (((v) >> sSHIFT) >> max(sFRACTION_BITS_FITTING(a) - (b), 0)), \ - sISP_VAL_MIN), sISP_VAL_MAX) -#define uDIGIT_FITTING(v, a, b) \ - min((unsigned int)max((unsigned)(((v) >> uSHIFT) \ - >> max((int)(uFRACTION_BITS_FITTING(a) - (b)), 0)), \ - uISP_VAL_MIN), uISP_VAL_MAX) +static inline int sDIGIT_FITTING(int v, int a, int b) +{ + int fit_shift = sFRACTION_BITS_FITTING(a) - b; + + v >>= sSHIFT; + v >>= fit_shift > 0 ? fit_shift : 0; + + return clamp_t(int, v, sISP_VAL_MIN, sISP_VAL_MAX); +} + +static inline unsigned int uDIGIT_FITTING(unsigned int v, int a, int b) +{ + int fit_shift = uFRACTION_BITS_FITTING(a) - b; + + v >>= uSHIFT; + v >>= fit_shift > 0 ? fit_shift : 0; + + return clamp_t(unsigned int, v, uISP_VAL_MIN, uISP_VAL_MAX); +} #endif /* __SH_CSS_FRAC_H */