From patchwork Wed Jun 26 10:13:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 808083 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 D6CDB175AA for ; Wed, 26 Jun 2024 10:14:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396851; cv=none; b=DTNDe+pfOhL9RVDOQ2NTu2c5YUt0S1d4oc9hCNXAQVpzBVSawJp3oN6tY1kmJI45mLZyeVThjlgb3NNID7Ras6hxt9IbQb7z0EMGYNXZbW8NSpaQakki1r5d3NBRUt1fGCJOyydFNGiWmV80QHmS+7xuYECwpYSWrZEBndQZFzg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396851; c=relaxed/simple; bh=n71cz1XaFfzqDVs3dRw1Q7xECno2TKDVXW0ttbsrD04=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pZLVuXe1uXt0vLeAheGqtNKRM2no7U2HIYTRT5p2EhF5C9XUycMQxvGniXyNbzrXkNJo9C4raXgcYOjlgNw+bpNowCwXqqqZZ1YbCp0CosI1GCGx1KpR1biKVKae/7bGu7r9cR8s9rvxX9cD0TYBYZJ3KQrm8NrZJxNx3r2CvAE= 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=mbk+ubNJ; arc=none smtp.client-ip=209.85.214.176 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="mbk+ubNJ" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1f47f07aceaso51012665ad.0 for ; Wed, 26 Jun 2024 03:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396849; x=1720001649; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=JLoG2uabhknU+Jtelcz0I6w9X0Nddlla+eHGKKiRhro=; b=mbk+ubNJmGgvEs6+B92JFNTmuvLqOXW44mZFdW4PAHdLJOYEj6tj+z6j7cUvYFxBjI srX1gcGiXTks6W7K97dzHEi8+7W4jUCOumyw4JYOQdARHppTuWoq1LVFWofxzfude5NB qD3CzbWdBaysiqUDGtKM7ZIvq836IAlu4+7uRFkB0ouD/naZt+KdAs8BBfpw7Wv6vgcv Q58BQ9HYSqNbwwJnzvqFmJUbWIhTFxUP34SpEIpdB0W61q3WI1+fZdgKd0wC3+kR8JUR s6a/r8iVkDftPf1M5N/Sb/C9+kd/78Xpa5NmNLEdCLZYmyuXh3nR1LwXVDTSVyC6WnsI 70ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396849; x=1720001649; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=JLoG2uabhknU+Jtelcz0I6w9X0Nddlla+eHGKKiRhro=; b=KXdyAEa46L+9fr7ZIklqftjEwBJEZ1LqMJC0J1uXz2HPMDQ0BOcv4usl9Irjxz/R7q yc7fV0uaOjmkKQAo0eH/THb7ZGtHqfLIv1Dxl7Z6aD0RGsLNyAz1N91ERDZKk+RpLyOY wV4YRNbP9j8wd07D/RL7eH7mjbY6GpzVLY51Rw0CjBcmDUYLxl/I4eYNpdCAJ8p2jOzH JUYh7hc/n8/IMH59BkVaJ4VDBCAbiqAgCio0aSylvEThpYIXf8Dj1v7V2cHZY6bEV878 7L8TulJtbDMfZmoyU23qT10nECE9PtiDGrfmwzI5pRnStXiJgK+5sFLxjiEi1cKIEMGy GC6w== X-Gm-Message-State: AOJu0YypX0VFDIir5IYKx2pdusaUnw+IEL1VjGRA2kHMr/Klw+ON1EIK CbqvgW0ElJQbhJ+RZaw/yJc3QI/A8UBEfdqql1fiwXBmfxmKb5jFnz/qgQ== X-Google-Smtp-Source: AGHT+IHH76Zmx+SCgUDiumV3fz6SVPqqy5mTEwzgCVyGc2QZqjVbOfZjLztH50UvUDAgqLz59LxySw== X-Received: by 2002:a17:902:da86:b0:1f9:d817:1fb0 with SMTP id d9443c01a7336-1fa158d0809mr115061675ad.14.1719396848910; Wed, 26 Jun 2024 03:14:08 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:08 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 01/14] scsi: advansys: Simplified memcpy length calculation in adv_build_req Date: Wed, 26 Jun 2024 06:13:29 -0400 Message-ID: <20240626101342.1440049-2-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/advansys.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index ab066bb27a57..e5ae43e00f24 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c @@ -7691,7 +7691,7 @@ adv_build_req(struct asc_board *boardp, struct scsi_cmnd *scp, /* Set CDB length and copy it to the request structure. */ scsiqp->cdb_len = scp->cmd_len; /* Copy first 12 CDB bytes to cdb[]. */ - memcpy(scsiqp->cdb, scp->cmnd, scp->cmd_len < 12 ? scp->cmd_len : 12); + memcpy(scsiqp->cdb, scp->cmnd, min(scp->cmd_len, 12)); /* Copy last 4 CDB bytes, if present, to cdb16[]. */ if (scp->cmd_len > 12) { int cdb16_len = scp->cmd_len - 12; From patchwork Wed Jun 26 10:13:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 807768 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) (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 3CAE1175AA for ; Wed, 26 Jun 2024 10:14:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396853; cv=none; b=cdbDMkaZOBryT96PViJhJmC2zeKlwzqgv4ZNfrkqptvnvC/oEv+XfKK28umQ8N++IW+jNKPHY+Xe0Cof3Olex6G2J5Do5RTO8xkbKCtz2KUVTywdF6qQzetknf9ve2YV9GhaRFjsW4ME2HzDxyFCEWOY+LGR87V7auFoqjN3md4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396853; c=relaxed/simple; bh=YT4XqsoyqpYnimAL/+pKLnMTJnTkInPjQZ4JMA/6fek=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=g8A4LCSLx+ppHlF5jkCzCyB1SbtLAXPoING4z8A04oZCTWitvGqfeEt7CvCLAFuEYh6zdkXPFzMy8jnxyWOX8Ug2nx0ZFaVLyTuh23Nxad63bRAShTLqFVLXjOtBWsFCM49nkln5xb3t+ue2vNI178SAFl2zS100H1JICmyVBGI= 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=fNKlgSJ5; arc=none smtp.client-ip=209.85.215.169 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="fNKlgSJ5" Received: by mail-pg1-f169.google.com with SMTP id 41be03b00d2f7-710437d0affso4885376a12.3 for ; Wed, 26 Jun 2024 03:14:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396851; x=1720001651; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=f91B5Fez4/RqYBgPifW7AJgON0I4xFSNufg1BzkOjAg=; b=fNKlgSJ5XTVnHaSQUQtKCwr65UHm7PGiyFMw0ZIZ06Tr0n2rL5XeUr/iaA2YI8BIIP QjYSiSguEYhAAOtBhbGCn4lPoe/ZhE1evzi2QYQrJzO9ycbpK8qnleB1Mb5WsztmeWPz 93o2XBdixEe35UTl65jRjWXPNLiFFLVhdUcLenEQ1+lIy2B6zOD/OGb3sWzgP75XErCl /vvTboBhioCgt8ZiM+FPepVLFgMcPIbUXJJYywWbmfm2jyPU6vtI4alYNXKr9NasuicH uPDXIHRBQUeb7CFq4D8C9DpOZX22CY7If5aB35yZpiBs+AwB2stib36Hg1U3mdo+WfCJ QCcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396851; x=1720001651; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=f91B5Fez4/RqYBgPifW7AJgON0I4xFSNufg1BzkOjAg=; b=qzLN9tNlBG5T5aGec05oJOLa5DwD32ankPm2gj88MeXs/SUCfrRHNVy3LmeOG5hQnH AptA4uC720tQ1sm1zdY4PUPi0VBMQaXfAe21qKFtsbG9HGvcKQ4yHk/uBbUbD2Zjv62X vFJb7rnJ74EtV+QQzTw2yBa8sV1JIQlqVtGrCGG7C7s3ZdiCUJ/EPDrMZhQe2Oh3Dn0H Mwh50zGu5wKdXPaCNXa44i597kS1pVp9lXR5k5diheMttnR0Kyv+1Secfu29D38iq3Vz 6zLtWVPU5vWr/UWEGMZAr7Y5zs4SNyMyHtSSmpTqfzyywjbj8ZkcfQKNFZUKLvhjvBQR 4/bA== X-Gm-Message-State: AOJu0YxnvB/KhDRjvJ8o2urD99M7Yw//aSM4OooLEHhbi1/eZPV4raGH s5l7Lvz2ZX76DwlcyQulERWTtaSziUjpjb0pC6m0bHoSC5wHMyMLqR7eAA== X-Google-Smtp-Source: AGHT+IEXjDaOAdoztLrXlJ+zfL0Pb5v1upHrtg3O26pxWqa+u4vCOjpA3dSs5PxUcokxG7r0uTr+vA== X-Received: by 2002:a05:6a20:ba83:b0:1b0:2af5:f183 with SMTP id adf61e73a8af0-1bcf7e7ecd5mr8639585637.23.1719396851189; Wed, 26 Jun 2024 03:14:11 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:10 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 02/14] scsi: bfa: Used min() in fc_rftid_build_sol for bitmap size Date: Wed, 26 Jun 2024 06:13:30 -0400 Message-ID: <20240626101342.1440049-3-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/bfa/bfa_fcbuild.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bfa/bfa_fcbuild.c b/drivers/scsi/bfa/bfa_fcbuild.c index 52303e8c716d..784be9b435f1 100644 --- a/drivers/scsi/bfa/bfa_fcbuild.c +++ b/drivers/scsi/bfa/bfa_fcbuild.c @@ -1093,7 +1093,7 @@ fc_rftid_build_sol(struct fchs_s *fchs, void *pyld, u32 s_id, u16 ox_id, rftid->dap = s_id; memcpy((void *)rftid->fc4_type, (void *)fc4_bitmap, - (bitmap_size < 32 ? bitmap_size : 32)); + min(bitmap_size, 32)); return sizeof(struct fcgs_rftid_req_s) + sizeof(struct ct_hdr_s); } From patchwork Wed Jun 26 10:13:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 808082 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (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 8116D175AA for ; Wed, 26 Jun 2024 10:14:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396855; cv=none; b=cxSjXRhlUtrpmwCsHBVq56NKbthBinNRdrVThUg4u1FtRNAFzYEq8HKi7MWdTrfoEX1jpFlMzp11SganpDmQKpcz+I/y+FuCIuClwfLYvHRsC+fiKHP+BKiQDNgJJvHrZq4eEz3lHQNCcMMnIRt6CodMorBKQdmepIk77hB90/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396855; c=relaxed/simple; bh=vuWR+gqfUxVB1UJn/Qmwx44ICD70tLVCZHbUz+EvOD8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Zt8uqd8gpzI2bCqdVB/zeGopUKX25+hEBjQ8hPUIYNNa1ZQfJL9Ap1sS/MYRKfwtPHoDVZpTDajjRC+cT+3NJvJNkK/M4tXuEVento4OWjDp0MKPHhq6V/fbzwfgkOccTPyiYLumsHZxZ0X62AdUBqFxLXYw1pHgAT5qdp3wGxE= 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=Rql4rypa; arc=none smtp.client-ip=209.85.214.182 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="Rql4rypa" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1f4c7b022f8so55823075ad.1 for ; Wed, 26 Jun 2024 03:14:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396854; x=1720001654; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=4reRSWeRn5dqNkHjQDUPngojzn4u/w/NmG9cRmpxkCU=; b=Rql4rypaMwur6AnGvbbcopOvUIOgPo4prxiRbS6sVMmhuk0Tkr8Nfie2fTpoHz5bxy jA2Jg7Rl0A5ppGY4xVEJ0F+z5Oec4Yhd4UXvMERqvFW3d1WhkiYuxIRaiHYZsXfD4Sgy BjbdF8cEFue7t9ztXEOBlF6eJErNCSB/H+5xZZokr84EaSUPr7mA55biuT4TmqxY5/ey eOONggkiYgbGobckDW2jQy3jB6ZxaJ+0Fb4U0PpKhyWeiit3AvzmqADZsUCgzuQfzA1o vec3/r5zbdIOeRAQQQprfZQlmQeHD8F19viwuz91TLOQmR7wTFTqa+G7cmiYzJyeXyPz HvlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396854; x=1720001654; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=4reRSWeRn5dqNkHjQDUPngojzn4u/w/NmG9cRmpxkCU=; b=uB1sZe9BQyfFuNsScytsQFMscoXEcrx7dy2Boymx4zpGb3AUnw1nyRuS2bsEF61FfO hXDzTpBFFy05AXwhKeeq4bRSelnTMvDeHT7Hy6TAp93drFCgD0Ab4KHE108eaCfHOVog zMKSSU/5SQa8qCJ2Ab1swgTJ60bJKzCmn7XMEKvXJIFadY2Ze3rZ70c7p1a1NYxdFo2G eDi1WTwPsNHOt2xLvD/aHuJ9rD0Cz5xnNv/I+BDWK/t0jCeJVBDLaaedk/4orxlVhZTg G+LSGo3sEj3hFZRhIDGBHCUJl1sRm0NfEURy8wCgeGfL4vlLg8tw/gVOhWATrL74aLlv anQA== X-Gm-Message-State: AOJu0Yxqnmz+CCszG3jrQ7EuaHbEkrSmUWBXUqjV04Ay0Hep7RBNLYkj wfOkldLrh8MI9PpAGg6vZRgQEDve4N057WPaczDy36VXBm5wFw/dNxRZgA== X-Google-Smtp-Source: AGHT+IGjy5Ac6Zyph2yV5AC/fp8sHsW0DM6xwyj1pJ9Td45+3/ACmNJCSEj+jLCGEERZp/NLltRESg== X-Received: by 2002:a17:902:e810:b0:1f9:b974:cbd6 with SMTP id d9443c01a7336-1fa238e4711mr120284825ad.1.1719396853541; Wed, 26 Jun 2024 03:14:13 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:13 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 03/14] scsi: bfa:Simplified logic in bfa_fcs_rport_update and bfa_sgpg_mfree Date: Wed, 26 Jun 2024 06:13:31 -0400 Message-ID: <20240626101342.1440049-4-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/bfa/bfa_fcs_rport.c | 6 ++---- drivers/scsi/bfa/bfa_svc.c | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c index ce52a9c88ae6..41e55030596a 100644 --- a/drivers/scsi/bfa/bfa_fcs_rport.c +++ b/drivers/scsi/bfa/bfa_fcs_rport.c @@ -2555,10 +2555,8 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi) * - MAX receive frame size */ rport->cisc = plogi->csp.cisc; - if (be16_to_cpu(plogi->class3.rxsz) < be16_to_cpu(plogi->csp.rxsz)) - rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz); - else - rport->maxfrsize = be16_to_cpu(plogi->csp.rxsz); + rport->maxfrsize = min(be16_to_cpu(plogi->class3.rxsz), + be16_to_cpu(plogi->csp.rxsz)); bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred)); bfa_trc(port->fcs, port->fabric->bb_credit); diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index 9f33aa303b18..3cbe87fc343b 100644 --- a/drivers/scsi/bfa/bfa_svc.c +++ b/drivers/scsi/bfa/bfa_svc.c @@ -5257,10 +5257,7 @@ bfa_sgpg_mfree(struct bfa_s *bfa, struct list_head *sgpg_q, int nsgpg) */ do { wqe = bfa_q_first(&mod->sgpg_wait_q); - if (mod->free_sgpgs < wqe->nsgpg) - nsgpg = mod->free_sgpgs; - else - nsgpg = wqe->nsgpg; + nsgpg = min(mod->free_sgpgs, wqe->nsgpg); bfa_sgpg_malloc(bfa, &wqe->sgpg_q, nsgpg); wqe->nsgpg -= nsgpg; if (wqe->nsgpg == 0) { From patchwork Wed Jun 26 10:13:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 807767 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 BDF60175AA for ; Wed, 26 Jun 2024 10:14:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396858; cv=none; b=URtTy8Q+Rz4VBVrp0GS1bH5Wjk8zKmMFk+zPqafAC/+4ZTYYA1H5X21pGjk9lz7wmeOZlMv3ts5y0meUyn0SmDSCI5p6BYOzKJzwZBhHhXhkHSjY1K3OQkzy/K8vaQYmVnI5Z+WHTaHKdDCbg2jACJUmdx8sdGON4i3k8YUvhE8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396858; c=relaxed/simple; bh=ZrjVcOiRUymWYcoHb/W3z4xw/yyC5O8gzQcN9V7t2P8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nGZyBWITK7E9ATs2b5XmGgUHJ/dOjWt5lI3vmycUGXyPK6kMZHTgspxnzU+loGKcGiwGwB4M4f8jXmn+k0IUil92rt67lWaI/J6mAkv2Wm8qxHdSc/Tid1TYce3KBreePGvzByaSRIFVn/dOGrseDYicr6xRyNo1OGZIQfEyD9M= 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=TKVbOCVj; arc=none smtp.client-ip=209.85.214.176 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="TKVbOCVj" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-1f47f07aceaso51013535ad.0 for ; Wed, 26 Jun 2024 03:14:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396856; x=1720001656; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ieQWqCkI9xb4UB11URnziOvdRWXntJmAaeT8EBK/Fd4=; b=TKVbOCVjz/k5JEDWJycweK6TTG93aZ4trGFqNDtQzhRn3/nrJFREbTHPnJ1IjRznY1 UxAkKs5ynaJK/3RLepuMdnvQJsIGKNtXOnDeVHDDjPCOHzAuVvnoQ0OMtb9QXWyCmYC+ SUso4EJcrjeIKTaOPmaDcYPee0DRLUnRaqdeJuUKViYSxOVyEkaEUkZ25gFJyYlmq84r u0fhJ1uDNcdF6E0RugeY7Lg4u7YuqHiZGrbFJFsbB3KdQb6w3lnhSuuwmSD8jDSj1moW Rvwx9kdCeYaPbpuu9kAopP6hpRwg05RKaUK1gnxy6jsi7aSpi8R5ZdL1WfR5PS0lRRNI 5y3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396856; x=1720001656; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ieQWqCkI9xb4UB11URnziOvdRWXntJmAaeT8EBK/Fd4=; b=nyblqu2i5PB6MU7KNyC5kWc/DCgKMUzjY1oyGFhJ7y4m1CPMnKrefkIvLWvHF+GpNA mla+2ehuYx2ZPWW/0mWfTs67WVA6bOdjRGFp35yG1W99VuKpXKycCgVgfv9fYI9omwqd tnd1SSeF3rYLkDWgsYnOzNs8yEh57F4MnDFifYzz9Wyy90t8zHVLwFIYQ43O3TaATxr3 5ErDSe0o/a39hIjdcRC/0GDbz7sStOh/kSFm4yyxJL5J3xfia4TZkTcuXZyTMgAkITSm Fad02xNriOxmsS7bXtxHchRKr72jhudjZiyuJkZmAQ5m+WkZ1a0p0MZwPkcaZf46sEa7 CHGg== X-Gm-Message-State: AOJu0Yw7f2O04l9HY4475WJWS0rxr38zZ0Ra/kjrZFHFU3BRxKXnZaH0 +FHPeLw+7Z/GnES2PWMGTvRId0t1eUFkXxJ92HZ3zgTJRqEKOr2allGX1A== X-Google-Smtp-Source: AGHT+IHk2+OqURY0h8ZnJWKuI9i6HeeDLRrVTJbFitwQHEFLJ1oaLh49Z43DqzaMxWeDPeMKPPGwxA== X-Received: by 2002:a17:902:f604:b0:1f6:ff48:1cf7 with SMTP id d9443c01a7336-1fa1594e163mr131288085ad.69.1719396855844; Wed, 26 Jun 2024 03:14:15 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:15 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 04/14] scsi: cxlflash: Replaced ternary operation in write_same16 with min() Date: Wed, 26 Jun 2024 06:13:32 -0400 Message-ID: <20240626101342.1440049-5-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/cxlflash/vlun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/cxlflash/vlun.c b/drivers/scsi/cxlflash/vlun.c index 35326e311991..e39ef6967d5d 100644 --- a/drivers/scsi/cxlflash/vlun.c +++ b/drivers/scsi/cxlflash/vlun.c @@ -445,7 +445,7 @@ static int write_same16(struct scsi_device *sdev, scsi_cmd[0] = WRITE_SAME_16; scsi_cmd[1] = cfg->ws_unmap ? 0x8 : 0; put_unaligned_be64(offset, &scsi_cmd[2]); - put_unaligned_be32(ws_limit < left ? ws_limit : left, + put_unaligned_be32(min(ws_limit, left), &scsi_cmd[10]); /* Drop the ioctl read semaphore across lengthy call */ From patchwork Wed Jun 26 10:13:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 808081 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 3319E175AA for ; Wed, 26 Jun 2024 10:14:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396860; cv=none; b=duIYBuwpBWh1TdPZobuzEQGpU/lULUwvk8I3BxgQa9HIHUBkAKeccpdrMT6Q7P9Lv+hTbVEjFENPe8VWATRgU4Mw/NItY6qD4suvYTxV4ib9KZ0GftNq+Z38ojeS68BlcKOmV+kWcaoKnZBvN3n+8aRho/bD2So2NY6HDcy7mgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396860; c=relaxed/simple; bh=HHlPsBgmG/3JNnDEmtvJ9qS8p6N0tq0Clfgx3PeOY8c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FK9cNiqvwSnvp48/0JlbZANOojTxemPwikXh3fZ/ttOJwPko9kVQZIzFwxU/i6Ky/tI8PwsimwK5EV3zdoCJ9DJWyhXk1Y5uDf2vjkBZ1DwYpWuu2YNy4YDAQs7xNmin1gXq9MFYWblFlyuNJg8T89TAryIvuTCsJ+k/6gvwyC0= 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=kNgoi4zg; arc=none smtp.client-ip=209.85.210.175 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="kNgoi4zg" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-7066c9741fbso3967300b3a.2 for ; Wed, 26 Jun 2024 03:14:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396858; x=1720001658; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=8MWsFpjOYog8+YRpu59CEo/oYBsp4nBg39WtFxWtJUk=; b=kNgoi4zg1udVD+MOrE+j6RGHDymB02Ardn0TyMIEKRlWZd8xee1dAUr97GfyUopDUS LlmnBAxL8OkSjaYOfPgnhkd6OPWvym62nZX4sXJnsBj751V3FUz3j4nWNFF5o7rJh+Hi q4ZnEaQbgt3FvxJL2dlqNbLZDmAy6cJLr4Av3kinbj6R9Oq9DYbHbeOmNYvq7aQLDlhB 47K7Kz5pdjYZrWH6GylJz3AVWss20ZSJfVkYWCAoqUCm/ozl1loSJmBHbqlD1CGhHQYB nbeoWD+VxxNzNEN1OCODpP1nb8KaYB9BTrEuvkcC4NbZQk64ZByDIBvcfmuKsyc11W7V OqdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396858; x=1720001658; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=8MWsFpjOYog8+YRpu59CEo/oYBsp4nBg39WtFxWtJUk=; b=MbnGmS08VeuHVnrMlgTML1V6dOZM6WMNq+05FV8QTGtzeWGvTdsFpv9uf5T/SrqVYz lyO8h6eoZ3rvWkp0+cYAZ4RQxsNMknIV/fpJOPhSqvnlIvtOP9lXH+fA9lTP/JBZ4ADj qtAiQAN0f/w38QYSGoszjLunc19RKqdAzmpkmorswkJ9G30mylwjoUSXdZ1GrFNxUAC4 n1r2K9jGQzL7pgRvZClHuSbp55LT247wUSJHhvSWDm8nHqyHOKchcA20u+Fva74Kg+ZH I2FU4/YOg4kS1daqCQJb3FcvTHDlxGIZ/p3nZRpnfzT4Axe03Rcc25Y5LoQV0fBwWEKC D0wQ== X-Gm-Message-State: AOJu0YzEQ1a9CC7a/rFls81WkOEhiWKICHENEd6LlHmPUyWPe1LmkzgI pcbQQ+qB9B8jHs7e85SultaeA+iwSKIGl4PD2VQsetyS0RXXQ/K7oICnww== X-Google-Smtp-Source: AGHT+IG068/4u2edxb4+Srbsy+qTBiWrcBaYONGHdF3RAGZ/ooSN7nm1GmXlaI4DH2U4RY3IKW49tQ== X-Received: by 2002:a05:6a20:b913:b0:1be:c267:bb41 with SMTP id adf61e73a8af0-1bec267bc15mr736549637.0.1719396858091; Wed, 26 Jun 2024 03:14:18 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:17 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 05/14] scsi: hpsa: Used min() for sense data size and buffer size in complete_scsi_command and hpsa_vpd_page_supported Date: Wed, 26 Jun 2024 06:13:33 -0400 Message-ID: <20240626101342.1440049-6-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/hpsa.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c index e044ed09d7e0..05fba23d94e5 100644 --- a/drivers/scsi/hpsa.c +++ b/drivers/scsi/hpsa.c @@ -2668,10 +2668,8 @@ static void complete_scsi_command(struct CommandList *cp) case CMD_TARGET_STATUS: cmd->result |= ei->ScsiStatus; /* copy the sense data */ - if (SCSI_SENSE_BUFFERSIZE < sizeof(ei->SenseInfo)) - sense_data_size = SCSI_SENSE_BUFFERSIZE; - else - sense_data_size = sizeof(ei->SenseInfo); + sense_data_size = min(SCSI_SENSE_BUFFERSIZE, + sizeof(ei->SenseInfo)); if (ei->SenseLen < sense_data_size) sense_data_size = ei->SenseLen; memcpy(cmd->sense_buffer, ei->SenseInfo, sense_data_size); @@ -3634,10 +3632,7 @@ static bool hpsa_vpd_page_supported(struct ctlr_info *h, if (rc != 0) goto exit_unsupported; pages = buf[3]; - if ((pages + HPSA_VPD_HEADER_SZ) <= 255) - bufsize = pages + HPSA_VPD_HEADER_SZ; - else - bufsize = 255; + bufsize = min(pages + HPSA_VPD_HEADER_SZ, 255); /* Get the whole VPD page list */ rc = hpsa_scsi_do_inquiry(h, scsi3addr, From patchwork Wed Jun 26 10:13:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 807766 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 19DA2176FA5 for ; Wed, 26 Jun 2024 10:14:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396862; cv=none; b=hzUg9XikZnJ2Iw9yGhTlVRDaMwjYEbIjby3YVTJslXn5jROSwoiW5DDO7MhYxjGPRmgo5TZRddxH864OYy9fCJ+/599AvQSqEY/iBc15CJITYXTKrrZp0cnrOnTMEZL4SgWb0YNyAqODY/9bKIFJ4mAAYQHq6UCXK3uUURkkpQc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396862; c=relaxed/simple; bh=yC38hflJn7cuFBI3UfTk9pmjq9eYcIISELcFHnXTDr8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=SurTfKOjH3LjXNK4jnitluaQOfV+voxUZHoIoIuBdatiHZFtbZJ6YluAsty6Ttni1MoWwkBUOzfU1DxOGzjNA3BYtRj5+UnwZkv/mrfS6PXfqcZfEx3CCb+H228UFIIya6tuxYRTEHAqzkUxx8jEr5Ppb8zkjeerFNXMKry7+A8= 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=CzA3u6sT; arc=none smtp.client-ip=209.85.214.180 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="CzA3u6sT" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1f4a5344ec7so3029135ad.1 for ; Wed, 26 Jun 2024 03:14:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396860; x=1720001660; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=9lXMN2sH57JcKYjj5wzd43H2Wegbr7/Nv7tJWddu4J8=; b=CzA3u6sTAsY4oWdGshGGmQGTgdTDVAfjN4yr5KrbyK+Yr3j2Gj9hsmdNQTGNQ+XFqX APljNLNlTVDSo0GMHk2+tp0cJlvf4wGVBdFTwSw59GRWWEj6WFsH3DxtynBHxz83BptQ N11ueUGGyGmpGKQ6RKinbs9ic4WcqZwRoewRe9GtxnbOW9CgoLJzAMLyvvhIj8oFJBpa o+O4TFJpLuIhzjOg8ptiUj29l0BAFoiKGMLoPcrOMC2gnZiWkGbYwCk5gaV0T1V4MyHz /Q630E1pWlWz5lNeE/yN0YBhV9MERZadsUavZZKQe3mQYtezj1UmMTuq0SCulPS5Oa3F P20Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396860; x=1720001660; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9lXMN2sH57JcKYjj5wzd43H2Wegbr7/Nv7tJWddu4J8=; b=XTztwTbnDecW9bN4ctUpNt8JtYMPBuZKsJc6CtkxeITxu6x8SZ0zcBmFOm1cOmriKq pprLFKYrlDb2JESH8YQTqtDfmyfufM9ebPbrIriDLW+h25RXbeaiL8rbm87L98OJHaKO +QxEXgXI4K4ZkNgdAdfpy95IrkvdsmFfxFsITXhUVwCx6qTa2p4Wgf3Rf1MikHj38iuH zER+T0a3aH+zU6HyfKw+lSPYaw9idt5kMqfNPH5roqR2PZRWnt3hwzk/7FeTWYtC2W5v 5CHxfTKUcjd9JL6Estn+KHo+5iRIcDYzXiEEtOzn/xL0UO5iS5LkDBTCorS2kijsGMES Ym1Q== X-Gm-Message-State: AOJu0Yx3BWOJ8GHVK4RZ8iQUTrtW584Bq1cTZelwgWihuDY24TdQI4Li brwv+nSjCDYsmEgVV7Ux0RwcOMOCevFfvVVplbhPmEmtRw632U0HFw5tEg== X-Google-Smtp-Source: AGHT+IEwjzlQowNCPGeXbZnoqW4HUH7teNEqeKuPNbv5UmcueX8310v8z9YcJb97XAAklY3Yqabrbg== X-Received: by 2002:a17:902:f70b:b0:1fa:918e:eb8 with SMTP id d9443c01a7336-1fa918e117fmr14018895ad.47.1719396860273; Wed, 26 Jun 2024 03:14:20 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:20 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 06/14] scsi: megaraid_sas: Simplified transfer length calculation using max() in mega_m_to_n Date: Wed, 26 Jun 2024 06:13:34 -0400 Message-ID: <20240626101342.1440049-7-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/megaraid.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 38976f94453e..8e9caf124778 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -3469,8 +3469,7 @@ mega_m_to_n(void __user *arg, nitioctl_t *uioc) /* * Choose the xferlen bigger of input and output data */ - uioc->xferlen = uioc_mimd.outlen > uioc_mimd.inlen ? - uioc_mimd.outlen : uioc_mimd.inlen; + uioc->xferlen = max(uioc_mimd.outlen, uioc_mimd.inlen); if( uioc_mimd.outlen ) uioc->flags = UIOC_RD; if( uioc_mimd.inlen ) uioc->flags |= UIOC_WR; From patchwork Wed Jun 26 10:13:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 808080 Received: from mail-pl1-f175.google.com (mail-pl1-f175.google.com [209.85.214.175]) (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 921CB176FA5 for ; Wed, 26 Jun 2024 10:14:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396864; cv=none; b=PfORfYcBa+QmQAr0hXdhVj/1j2/jzQAlIVeCf75LJBzlZz3aXq89cJYQeAdwOghVwF1021laXunD1UPB/7xaW4ajnulREnnmCHsnn+BixFhCcJhaGnFquaEMZQ73NfmziESkV20EsNWHToQib/UTjqCDPXAvTPsKFhIZx8Okl4M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396864; c=relaxed/simple; bh=3ikQMWc8UtYYolUrL+XPcqZG44/cQVeSKs0Ig3k5n50=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F/YopCvIZbJZ5km/b8GdmfO9VidOAV+/TC+wgxoopB3cjW4pkgKKszimO0SzjgnTKiQ1ZdzYY/FoVIltBAQGZ/U7FJcw5R+ev2THW0P2NsdySJ862+yM6h8mR1rP4chZI7cmxt54JmnCKzmur845LvMjb169TPzYMgghX6gvtgw= 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=e3jvb+Y/; arc=none smtp.client-ip=209.85.214.175 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="e3jvb+Y/" Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1f47f07acd3so53571805ad.0 for ; Wed, 26 Jun 2024 03:14:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396863; x=1720001663; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=zvrU0gGdjp0IDM5cybs3chAZgV1peeqZh5UJovl2csI=; b=e3jvb+Y/dn7iJTp/UQONngH10SV+VuuTbBBVRsV4VjCFYL4MI2AqfmeweEggc3U0+1 YbIjTjpdX86LuNplgWuC4mI7Z8Hi/SIthaHw8VaCgt+KnujO5uny1RU5bgEAFTPGG/uc gLHWnZbdUGSM2Nj8gvRfKEHYGE38d52l+dS0t9Nq+KwRmqQBW1MqbUvJEeIVxLK+B4Kb q1bWY63/tmjx9vautnqZTubI8pDcBQt4OSjfWZ/wpkoYDmg4pL91BAzJXtg+4TjoAnhx +AhgPv1+Xh57NRoTdnp95NVyaqMblETA/sehmHYvldZjhPLgiyQopZX7/N8k2RyvzQwk QZ+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396863; x=1720001663; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zvrU0gGdjp0IDM5cybs3chAZgV1peeqZh5UJovl2csI=; b=mabnQH1q8bOb463SB6ttCj/9oJTf6ZQ20p1RdxXYDMDDQKgEAKmYHC+mSE3jVq2ILp YaP2ux49cS8yIy9OZ81EA1pnt6Hf/VyC3VG7FuMPcWb5RjY/yIccjNdY/BH2W661xJWD UqPuZZ2gsHwa+IIsT26n7URFqerAzMibLOzAvQiBCdJdxXgQ2D/3xRKg0DKbPRGhi0tK aju250upB/YwqRkjZ8SHDBqVItZhoX9McnxM2xflKIXwsjO/JO3S+Ium4/JnSD8S9fqX 38T7prCKokjm2sYDbkpwp0bfU9GY8CZYDZH4UxNxv7Z8OI0Dd3gdKeg6B0BNTNQF18S+ Ooeg== X-Gm-Message-State: AOJu0YxV0OkgBY4dNNAOeuv62muHdHT+ZY8RG56jVHXJQvRMM9ci71kn 7Kvfhv3jifjUFve/N5xe1FE54bSj+V2TQ3uMBL1xkkrP9RqGixPSfIr1NA== X-Google-Smtp-Source: AGHT+IH/j6xizen67xnLH/LaRa7jofyi8Nx2ApvXAXuLyuXPNKy/ISSCE24kQZXVZqN3k1MUU21zAg== X-Received: by 2002:a17:902:ced0:b0:1fa:7f7e:2e24 with SMTP id d9443c01a7336-1fa7f7e329amr29557265ad.26.1719396862631; Wed, 26 Jun 2024 03:14:22 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:22 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 07/14] scsi: megaraid_sas: Replaced ternary operation with max() in megasas_alloc_irq_vectors Date: Wed, 26 Jun 2024 06:13:35 -0400 Message-ID: <20240626101342.1440049-8-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/megaraid/megaraid_sas_base.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c index 88acefbf9aea..ad7369d78ab9 100644 --- a/drivers/scsi/megaraid/megaraid_sas_base.c +++ b/drivers/scsi/megaraid/megaraid_sas_base.c @@ -5996,10 +5996,7 @@ megasas_alloc_irq_vectors(struct megasas_instance *instance) instance->msix_vectors - instance->iopoll_q_count, i, instance->iopoll_q_count); - if (i > 0) - instance->msix_vectors = i; - else - instance->msix_vectors = 0; + instance->msix_vectors = max(i, 0); if (instance->smp_affinity_enable) megasas_set_high_iops_queue_affinity_and_hint(instance); From patchwork Wed Jun 26 10:13:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 807765 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (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 B61E2176FA5 for ; Wed, 26 Jun 2024 10:14:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396867; cv=none; b=GCWhSD29k8FvC8VhdX8A4+/qShfXzR+sicE5wFFvGE40/gY5aFfx4XItAYXaAicUOsmhzEoU3TZIUu/RYSOZiC/xCyIg1ma/IEiZueetspoWC/x3SP+0BVAkhRjjoYYeLHpLuBXxGeL5zutDr+DNvBSPcELaXrvAEAZq6Mxo3Xg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396867; c=relaxed/simple; bh=Lpop0nfADxhs8O0ttyskxF1m7MTLqbP1GDEFj4MgJdk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gtf/rBCt+vyDt3gMmfMYjBwCR0Jgxpw1jpJGWXgszt0edNgNwQ2fqNT4E2A3XCCYvfgXptl0QTQ19fweNHGEguFIzv2HXvxFSYj2DHl131GKlcKosjGmzv5hIjrn/36g3uYkBBS8V4VD9ontk8lnOD4m9JupvRunSdCBLqW9J1g= 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=iCiR4nNL; arc=none smtp.client-ip=209.85.214.173 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="iCiR4nNL" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1f480624d0dso55402055ad.1 for ; Wed, 26 Jun 2024 03:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396865; x=1720001665; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FuY0dw8oPJEFMzmrTleHKd1Ke+g5UwuSoBavurCfkoE=; b=iCiR4nNLBrQdKi3JPzcpPyCaDZfBPyrrPzsoctBqg8GOZ/CQWNfbc9yo5lJIvQRT6K e2u0zgfFVrcZf1gSEbRJnVNUkunkWZpoLydHbCdXWn7f6pHfs4CpE11U2Ryj+s+xvjLh E7f3AJ3hlnmxOYBnmRPuJ+ZpvagEq70N1EJF9xtT7BPfjj4CFQMZhAUDfBhy5hm1kjFs KDNs72V0dR6TzThTIuqqB//9Gs7OfK9WHTNi5jA9pyM646fJPWUh/QWY9UmnKJOPoHZS 4ay42qLYSi1It3DOvdXKsAXqVI/GcBOAS63Os2Q6JBUr2TAuPRmsf4B/RVjlFH0V/qAp yxLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396865; x=1720001665; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FuY0dw8oPJEFMzmrTleHKd1Ke+g5UwuSoBavurCfkoE=; b=MEvW3967V0vFmzDpCLyyjvlobnCKoZyLmSxOBF8bFH7NvdmRW40vFB4c+XQrAlRuq6 MwiaZc9/LFjMV1LNqfb7eadXBqX2qzAp4nEx1dhprr/H1/BvdeCqoAe+tlcIYCUuE/gm hHme9LAoy7lLfPYEHZCjHhUdt6zkEYEQQ6zTiJp88PEQ1SVhKJS/uWULPOrFc4zhwgVJ mjzQ/rlxvmDET5z3w+9dzYSKXKMfKmIHJcBAGitJ4jo8scN12t74p8LMXqa3uZBANb1A Yg85b6hiUe9/XGR0NNwL1o243DwrtsiAIskGTAUmMbbLMt2+P5btsxpvo/kvw+ihv3hA lj7A== X-Gm-Message-State: AOJu0Yyp2TguEG2huU202Vq+yX1ELE5TR/8WawL5seyiPw5xxDk2vQ+p yHTLHSjWTOs3fTvv9kb7/PiTpwxBxJEctu2ueDtutO10xwpka6dmMx/14g== X-Google-Smtp-Source: AGHT+IHg3pQ51bji8X13qaNi+qvuUUd377cs6puCsnUoAYwS/LPcZsOOb7c8vLsAI/jbG7Qdfd2tLg== X-Received: by 2002:a17:903:22cd:b0:1f9:de01:902c with SMTP id d9443c01a7336-1fa23bd19a0mr135311685ad.5.1719396864928; Wed, 26 Jun 2024 03:14:24 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:24 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 08/14] scsi: mpi3mr: Used min() in mpi3mr_map_data_buffer_dma for buffer size Date: Wed, 26 Jun 2024 06:13:36 -0400 Message-ID: <20240626101342.1440049-9-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/mpi3mr/mpi3mr_app.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/mpi3mr/mpi3mr_app.c b/drivers/scsi/mpi3mr/mpi3mr_app.c index cd261b48eb46..350f3df02baf 100644 --- a/drivers/scsi/mpi3mr/mpi3mr_app.c +++ b/drivers/scsi/mpi3mr/mpi3mr_app.c @@ -1171,11 +1171,8 @@ static int mpi3mr_map_data_buffer_dma(struct mpi3mr_ioc *mrioc, drv_buf->dma_desc[i].addr = mrioc->ioctl_sge[desc_count].addr; drv_buf->dma_desc[i].dma_addr = mrioc->ioctl_sge[desc_count].dma_addr; - if (buf_len < mrioc->ioctl_sge[desc_count].size) - drv_buf->dma_desc[i].size = buf_len; - else - drv_buf->dma_desc[i].size = - mrioc->ioctl_sge[desc_count].size; + drv_buf->dma_desc[i].size = min(buf_len, + mrioc->ioctl_sge[desc_count].size); buf_len -= drv_buf->dma_desc[i].size; memset(drv_buf->dma_desc[i].addr, 0, mrioc->ioctl_sge[desc_count].size); From patchwork Wed Jun 26 10:13:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 808079 Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) (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 113BA176AD5 for ; Wed, 26 Jun 2024 10:14:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396869; cv=none; b=qGgK0ibRjSg5/dLvlgCckji/pSbidHF5lJc1HnnaZmNl64eyKgQJ/ASSHfmOrm78sHjTvwm6iYvR65IimlGX/4VuyjjVEQKoUmQ8TLiWXGSTJgAhysEQKDLl4DoSazmJDfNMe6Zee4qHD8a39P3D72rhJKICcWTjV92aBCAROH4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396869; c=relaxed/simple; bh=ZUu3pQzVsqGNAAF+6RBWn1Vcx/FxQ0DS3kuPtIAajrU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=T1ARmfkl/civ2WKaRfRXEhF7OzuvsK00t+RgfoaiIunw337hF5QZoO7kf2Ez1liRLrsCQsl6LHNITw0A/O5Qb3xiMDzy9ITWzftR6poatYQO1wrabiksc611ih0JXFbh+mpeIB4ONQTtAkhfy7iDx5EMyiSdF5SBRngMLDDp32Y= 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=Y7h9oIyI; arc=none smtp.client-ip=209.85.210.175 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="Y7h9oIyI" Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-70671ecd334so2991922b3a.0 for ; Wed, 26 Jun 2024 03:14:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396867; x=1720001667; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=U8sYvE7NIBRGPL3jKH06ljE0MlVAbByZlEmhsz0GRWU=; b=Y7h9oIyI4Y5klS3MoJN8HqqfoUSkRynFNzE9h2KHhsH6cCWmTmrtyo8/hq70BoXOdw 2rRx5E/Uv0mMujsGJbrvy3Qile+jX8Y+zn+eAGCfwps4uwEwm76UtihMnnl3a9vL1a3Q hCMCVrIuy41Hr6wrxG/bex0rWC0y9OxUsTme+TyUFIw/N/CV1p8/wRO0Rzwxu1wXY6WN pi3ZGAbxPBEb6i34NrQ/mztPu6Z85O3EFsPtzC62Zz6Yr0Iq3HvOMZJKxzcFGrIZtICd ZJZeZsyzYPtXgPr0klPg0/MBy7ywtMlYdT7ILJmhw8TQXiW9wTMnTY29uMiRVNV5qqB6 neZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396867; x=1720001667; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U8sYvE7NIBRGPL3jKH06ljE0MlVAbByZlEmhsz0GRWU=; b=vn39Fz6ZrIPBWpVvCO1w7LqJwAnUXqfd0u6j65wAXG4Q2DMwXt0LbKx7i+S+JiKxhO ECMFQasnjJ4Qsnk/rRz3us3E1kpHnJlSUxJ8iOlYhZ6d+r/dYEwDDrAY4fTt3V+DygVH iR6YaIn0Kw9Rvnsnv+GMX8THC4Qld64UZv2Mz1PESvyHyYcvispdy4/mq9BnqnMhwrdA +pvavhI44Y7pIwbHHpJ7V7FELs5yRM5jDrU+OaR6hn0RHFBCzQDUg6HiO3Mv4JyzWjnu Wv+TGEruM8D7IS7mOJsAb9/70kVfZKLHqNttf9DkfsW3RI3wOYawr0ktxSgNzXCiDiM/ 3IVw== X-Gm-Message-State: AOJu0YzQCBBqy1hJb+r74/CWuyOdTFeAPTIo2QrvnkZOIcx80cvuq9aR JYycoAtz+Fx0UMP9cd9V1pseWItpxbDZ3vp5HtilzMpLFWR5jckUgVpq0Q== X-Google-Smtp-Source: AGHT+IH7SiY9QD8pXdo62uO0X1Ovuy0u8nxi8+LJEdz+x0qVeTJSfOr+53Fe8OjYqqaZzBbwG+WBXg== X-Received: by 2002:a05:6a20:50d1:b0:1be:cfb:cdd1 with SMTP id adf61e73a8af0-1be0cfbe724mr1216219637.39.1719396867168; Wed, 26 Jun 2024 03:14:27 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:26 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 09/14] scsi: ncr53c8xx: Simplified tag number calculation with max() in ncr_sir_to_redo Date: Wed, 26 Jun 2024 06:13:37 -0400 Message-ID: <20240626101342.1440049-10-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/ncr53c8xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ncr53c8xx.c b/drivers/scsi/ncr53c8xx.c index 35869b4f9329..863139c98cce 100644 --- a/drivers/scsi/ncr53c8xx.c +++ b/drivers/scsi/ncr53c8xx.c @@ -6410,7 +6410,7 @@ static void ncr_sir_to_redo(struct ncb *np, int num, struct ccb *cp) "CCBs\n", busy_cnt, disc_cnt); } if (disc_cnt < lp->numtags) { - lp->numtags = disc_cnt > 2 ? disc_cnt : 2; + lp->numtags = max(disc_cnt, 2); lp->num_good = 0; ncr_setup_tags (np, cmd->device); } From patchwork Wed Jun 26 10:13:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 807764 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (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 49B36176AAA for ; Wed, 26 Jun 2024 10:14:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396873; cv=none; b=Zvj3QLIli87LW1Sm/ODMJlSN8CFK0lO95XojcAMQuok3klIBa+UJR4Y1IMJ+fDsREyJGxoqo3FP8h6CXgfj7q2+eGz8b9pMiMXwwJkK1wpS86jal1UVJnDfmVhZ5rQa/0X7w12qalHn93WNTSN+eO4p+NNGGQEKJCutQxDMokuM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396873; c=relaxed/simple; bh=KI6MRILk+I7eGs5ssGt5mtAFHr1fGkJ+Q3wb2xPdyDc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H+00oL3RmdfyZk3SAgFeBlh+FvFmm74VjWRLOjPazDSfR93vyRd33o0dtvi6ys3zugujVpjbr4oll1Y+/oTe86SyhRhSXAE52XXUbP5OZwextENoWkIX37mh+PIgtslA6mrcBO4SFOy+VzCLLzI7CkLX3uxMMw7HWbkD8I/+878= 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=IPsYDqlH; arc=none smtp.client-ip=209.85.214.170 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="IPsYDqlH" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-1fa9f540f45so605675ad.1 for ; Wed, 26 Jun 2024 03:14:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396870; x=1720001670; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6ZfnA1/5c0xPDj+zkBN3P6lqp+PcgAYfDPW8P3d/jrk=; b=IPsYDqlH2Uf3/oM7cOmL2nifoufIonD7Rfj8vX3JsWiDj083RLU05aOCJT5BpePyjW WT9aEqFP+gLSGiT9smKt1m+Qyf2UQu+qmRY9Y2dTZKliHqiVsq1p0bl5TtP2i422zBTm XD+jv0BJ5WJfwWRnYy4g4oUPNwvpcfL/C2b68jgCTYeNFdiqCKZb/sHWR3dUIob7jW5A K+/7/ED+Y8RR/KERoyBSyDHJJGbxj0gb6BAYisFgdFsMI6YfHvMLg0CHc4uAzSOJum9Q iE/2cEBajNrgF0QWe+XWjjvDE2S1HeCiskhAKSP+n16kf7tmyBE39UJl2hA3PBo4kzOK lm4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396870; x=1720001670; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6ZfnA1/5c0xPDj+zkBN3P6lqp+PcgAYfDPW8P3d/jrk=; b=vgIIrC55DFmfKar5Uoh6zexMa0llySiC3PjEZBtc6iB1B1iy5dC9TdLbKRWkXd2qd+ gOPQ4/Ob+YYTPqRAisHPUVTGVShXszECExPEP4NF0DAbkPiO+CyFk2KYd1y7zxnYHJ0n lqv1SPiFmU6L7xVhvbz858Be3ADO/WskumkEuU8sksF9HdcEgIKIXCzG+1At4pPYoolA wnCY58EkYqEDyD1c8vgc2Bb3w9FXy4yJbsbqnfGhbkhzSrT/z+qcK7bQx73g51pd91/L YooAqdCMeLoNpR+fMoCXU4qtrM0J0PF6R1mYZ1rlmHdZTJ6iV5h4XmciKVIEO2H2ERBi Ekog== X-Gm-Message-State: AOJu0Yzx3TPvIa1NE58clJVwpdpzbvFgbrgarpMYbwAU5/AzdjUyqjl2 zK1fuT4rTZXUeP9eQglXiWlBFYDZJjtBH6coWOvfk4towSyzO8o2cERPoA== X-Google-Smtp-Source: AGHT+IGycASPIds8KV1SpcIMO6C6WXe0GA7/L1BM71+17h14MNsMkAnPJABL8uYKFPJO2Oa/mV92IA== X-Received: by 2002:a17:902:ec83:b0:1f9:8e2b:cf33 with SMTP id d9443c01a7336-1fa158df190mr124934085ad.26.1719396870460; Wed, 26 Jun 2024 03:14:30 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:30 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 10/14] scsi: qla2xxx: Used max() for queue count in qla25xx_copy_mq Date: Wed, 26 Jun 2024 06:13:38 -0400 Message-ID: <20240626101342.1440049-11-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/qla2xxx/qla_dbg.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 691ef827a5ab..5e3afd7ffa76 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c @@ -685,8 +685,7 @@ qla25xx_copy_mq(struct qla_hw_data *ha, void *ptr, __be32 **last_chain) mq->type = htonl(DUMP_CHAIN_MQ); mq->chain_size = htonl(sizeof(struct qla2xxx_mq_chain)); - que_cnt = ha->max_req_queues > ha->max_rsp_queues ? - ha->max_req_queues : ha->max_rsp_queues; + que_cnt = max(ha->max_req_queues, ha->max_rsp_queues); mq->count = htonl(que_cnt); for (cnt = 0; cnt < que_cnt; cnt++) { reg = ISP_QUE_REG(ha, cnt); From patchwork Wed Jun 26 10:13:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 808078 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 6FA0E176AAA for ; Wed, 26 Jun 2024 10:14:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396875; cv=none; b=W7EFtgJQb0oD5FkxcrCGvqPrfb8ZmCh00lzdcgTvt6ClEkV4uJqXSlo+/WBQEUFi+5cBIMXHxsx+mCR4DG3SLYDpHFTsbnaZ8Uc1kXVkkJSHH6Qb2bASJQZ8v9de1YvPZu/iVp9P39PwHcNhmZDnAlhvpX6LxqlwycvTke73ZCg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396875; c=relaxed/simple; bh=2wYgW3ZpZSEs5F7pUdRwCkgpyS6Vs4XB9SF5ViilxC8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZIz289lszfQLFIwcfUJTmfADvXgLYtLCQLjpobIZEEn3hIWnNxGqbef2xdlp/1vMzkMCBo41L+CdfHH4rwcKFfjdnDlvbUZH0aO9R4I56/FlSvBd+UJMah2x8DVrd3NO8fKxTiG0npt4xu7SCTWAFrnyKgH/DiPWR/6QS/bakh0= 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=N1vZCvfx; arc=none smtp.client-ip=209.85.214.180 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="N1vZCvfx" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-1f9b523a15cso3095435ad.0 for ; Wed, 26 Jun 2024 03:14:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396874; x=1720001674; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=a0KzABPdBcuNpebTqLJrv15Sl0P8Ui5ihmud7hRVD60=; b=N1vZCvfxfdGKNhKKBq1cJVQ4nRENAOh+TJq7F7tOzCf4QO/rYdg/NZHVbYD5qsDHUi 6zWvTJYvQmcUlh5C2WdL1ZhrPijN9Uu2i2tV2wakr7EyswuSh8ryaJ1xBBBX4Gva9iWT 7JpJPeztArjTnczO3Y544KPcsZkcxUe/0KKPGHeSJJpfHq4IOsOwAVrwcUCLeeMuoND/ 1/cxKkk4ReVwZBcmGcDNnhHpqj25GkfHsxi9VIOywl8Uw7gu+OoUcSrtiuJxx/+Y0CXP /o3Hhttjsx8qARsOc5jaVuwXIIiukwvyN4LVDXZNbHPJo+CuAMbTleldHvNjho5dI5IK ZQ8g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396874; x=1720001674; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=a0KzABPdBcuNpebTqLJrv15Sl0P8Ui5ihmud7hRVD60=; b=A1+pUYn5UOY4gJfziPZwlVETbjqz2mudYJui6iq1fna5nMGEUCMAGyFvXaNmQRlW7g QrWhZZh0f7rBzZAdInoqL/Z5Y2diJEmoboTYNntGFgaSCLzGnEqE1Ru39TsSwiqZSKqP 71rFMLrwaUpj5q+QJuUOdbrxRwNDftjZDB/Y0gh4DwNF5JIwrc9SFTYZIRveNfU6wNfd UKAvV5hUYdNonYCkD4twA+Nl7nYhktBSrVHwSslqEe9otoNpaLcKEUEwB7jJMN+p9iYQ bVXJNEWzG3SAtewBQqrU6T7HPGYJquL8HEuUqhZu1MnDg7rhK7KKYO99G/KYnc89jdOt R+xA== X-Gm-Message-State: AOJu0YydgJrzl9ZBfYxWCmAXCWikAUb2rrhjgRi5/rRAbMW6nYAZhUpI tmUko81MtXIq2IsK+freQZJNmeKFLPG3VY5nvfB3oqe3I5zbQ5/+xivPKg== X-Google-Smtp-Source: AGHT+IHfrxIwD8Oy8HZhZ3gFn8L9kABYacTHOLqRSowI/xCq/FKZixm8FnKKl7K54/OsJaaAP8A7iA== X-Received: by 2002:a17:903:1110:b0:1fa:918e:ec2 with SMTP id d9443c01a7336-1fa918e10f4mr15006905ad.57.1719396873213; Wed, 26 Jun 2024 03:14:33 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:32 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 11/14] scsi: qla2xxx: Simplified outstanding commands calculation in qla2x00_alloc_outstanding_cmds and qla24xx_read_fcp_prio_cfg Date: Wed, 26 Jun 2024 06:13:39 -0400 Message-ID: <20240626101342.1440049-12-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/qla2xxx/qla_init.c | 6 ++---- drivers/scsi/qla2xxx/qla_sup.c | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 8377624d76c9..9caaaf25de64 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -3999,10 +3999,8 @@ qla2x00_alloc_outstanding_cmds(struct qla_hw_data *ha, struct req_que *req) if (!IS_FWI2_CAPABLE(ha)) req->num_outstanding_cmds = DEFAULT_OUTSTANDING_COMMANDS; else { - if (ha->cur_fw_xcb_count <= ha->cur_fw_iocb_count) - req->num_outstanding_cmds = ha->cur_fw_xcb_count; - else - req->num_outstanding_cmds = ha->cur_fw_iocb_count; + req->num_outstanding_cmds = min(ha->cur_fw_xcb_count, + ha->cur_fw_iocb_count); } req->outstanding_cmds = kcalloc(req->num_outstanding_cmds, diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index c092a6b1ced4..2703408c60e7 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c @@ -3625,7 +3625,7 @@ qla24xx_read_fcp_prio_cfg(scsi_qla_host_t *vha) max_len = FCP_PRIO_CFG_SIZE - FCP_PRIO_CFG_HDR_SIZE; ha->isp_ops->read_optrom(vha, &ha->fcp_prio_cfg->entry[0], - fcp_prio_addr << 2, (len < max_len ? len : max_len)); + fcp_prio_addr << 2, min(len, max_len)); /* revalidate the entire FCP priority config data, including entries */ if (!qla24xx_fcp_prio_cfg_valid(vha, ha->fcp_prio_cfg, 1)) From patchwork Wed Jun 26 10:13:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 807763 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 AF42F1779B1 for ; Wed, 26 Jun 2024 10:14:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396877; cv=none; b=FG0DfQPxvU3/5XO5IMnOTjRSh3DcRVFk5o8BI+MFS/Ojt407KWJL2Bn6Xcr2gboJteP/pRNgHyGs4xt/iImlD1iK0bukkiK03cyJ0vu8JFYPJT1XUROFJYi4p0/GkVC+qISw2oHX18yMegyskNMKN3MO1wS+Vi9E6rMK1Zl2pBc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396877; c=relaxed/simple; bh=6KOTeQA08u7PIa6fqyJIO8S2pm+zFpyukKbzTb8OlqA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=h91B3fiZ5vbdmSy8LBaWTYMlwXywb9XoEHAg6iQ5b9YI6KZ1WdZoI31xqH8ml3TsfwVwQY6j4LoTxU8cE7mJPTQEWcEpiOun64ICOtq57SWzi/fGcoUeBhoX2k0YMTyxsZhpXiQphYQcml9beEXbpiuzolGAgtoAlzWTOtr0mqk= 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=H8Af7dc8; arc=none smtp.client-ip=209.85.215.173 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="H8Af7dc8" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-70df2135426so4203362a12.2 for ; Wed, 26 Jun 2024 03:14:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396876; x=1720001676; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZlWBI7UdHor2P77JXIMXQDCL5Fy7mR8wocYDlTCkBII=; b=H8Af7dc8mnPqw+31lNb0NkvGwjbiF3EeE3CPRafpqs7JF4BZU+a2skBFzST9WMf0Cc RPRQApR6nfvPrOxLv+ejdKRgKMWX9sT/8TXKLxFjfFSXyXHCGSRSHU2pT1nEqCZxvNhF PJAQ+UMWnLLiTfpOjSIHBwWcHFdZfPAOhvHsZrXxHym/8G+dd1085HxJTT0kBnyk8K3n P20AlG7V15PlylZFdKvgEoxkfusouPu4WKAjY1YXT4pU4EGTZFubK0xn2G190oCvcorY yVn8DdA6OCkdQQ48US31vT4K8SX1HGNXrT7fSIGgSBaIyxABIDe7uVj4J0+Ost98IEeD P0NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396876; x=1720001676; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZlWBI7UdHor2P77JXIMXQDCL5Fy7mR8wocYDlTCkBII=; b=qi+UEsByohoHy+0rwF2G08kV5+CFeBwKHJSSTqga+fpvp9sWvcOsDqONBfhnZLTKDp 0wvgVb0EMrJzyu7Lm6r7VFpgZrRFm7MFIbmL+qepWjNn2JciIxqcuHm4cQBItCqumz4t r4qgkqs/BEvl76eRBDDmeTPOYuMcjzP6gegs9ESihB1wdnGgYYTL4ze7s+hicraNHCfJ g69G6afmhJFIfbtBq8GIjneJGWUYfqKXHrhl4iK6j7EvDFow6+k/Ts6+g0f1LfE6jwVw 0oMj2AdbIj6CAfoHLB8pOQNecAjaR/XPKXEU3LS4E/ixXFV0Z98YfkEfM3Sl0RCJiyyy lvLg== X-Gm-Message-State: AOJu0Yy7PBrt6ClYIw3gDP3ywiYGNCZdRuyRDy8X4zLuol+UsGpmbFnf 0iYb3t+EcSaS7r7edYFp268qfb7CzMGE/XUVAJBazk9mn3kLEAumYg0rxQ== X-Google-Smtp-Source: AGHT+IGyGV1BFkNkIom8Lj0SMYeud/JAJfbxy+01YC0+M7AKGXSZxyuzx+frcdaPxDCqUbw1lpvIFw== X-Received: by 2002:a05:6a20:b829:b0:1bd:1d6b:a917 with SMTP id adf61e73a8af0-1bd1d6ba94emr4109741637.50.1719396875777; Wed, 26 Jun 2024 03:14:35 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:35 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 12/14] scsi: scsi_debug: Replaced ternary operation with min() in resp_get_lba_status Date: Wed, 26 Jun 2024 06:13:40 -0400 Message-ID: <20240626101342.1440049-13-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/scsi_debug.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c index acf0592d63da..ae64c0df95f7 100644 --- a/drivers/scsi/scsi_debug.c +++ b/drivers/scsi/scsi_debug.c @@ -4579,10 +4579,7 @@ static int resp_get_lba_status(struct scsi_cmnd *scp, mapped = 1; /* following just in case virtual_gb changed */ sdebug_capacity = get_sdebug_capacity(); - if (sdebug_capacity - lba <= 0xffffffff) - num = sdebug_capacity - lba; - else - num = 0xffffffff; + num = min(sdebug_capacity - lba, 0xffffffff); } memset(arr, 0, SDEBUG_GET_LBA_STATUS_LEN); From patchwork Wed Jun 26 10:13:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 808077 Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) (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 A88061779B1 for ; Wed, 26 Jun 2024 10:14:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396881; cv=none; b=rTxlJImpaGCsTcmiw9c4CyNXPUfVrLBksGmVyn7ESPsTDo9sYbQHBT0h4wXegtcbWPTX5gb37GiCQXfixymAYMC4sk/EcSzxcXEB3oE0wKlheoYirHGNfirq2Znc94FJS6bvFUXubChc4nogDthrN0LaOFNVMrwe5W5WO7QNjQk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396881; c=relaxed/simple; bh=Po4MOpKCDdvoqxEYXrUO10gmVPVXzaCwnPcdvEhfMpc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ut7rCLE88ehbfVEpknM0DQjptpEuche2TWiZt+acg6k8l/AdIXCgtRbEod0PitRwDosRWUWJXxOyQSRTjsXRNXk60OohVghzNPY9V8OeydrV/nvbOn3eAN5Y9X35Zlj1Ogv1rfvB5h/gZTbO8Blb5rW6vC07NK9RHAfUUvp+L70= 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=eO3OrxbL; arc=none smtp.client-ip=209.85.214.178 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="eO3OrxbL" Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-1f9de13d6baso46510015ad.2 for ; Wed, 26 Jun 2024 03:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396879; x=1720001679; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=R6IjOUYAHiklEy/1JCnyVQ/me9Hn9TKgQhwLunk55iM=; b=eO3OrxbLH3KZY98X2Vhxq7OoWG+aVbY0zC6oCKp/uwE4bWciQFYyB16GnfUEvWPTyY SYgOUCxnAlPqPqnv4g3oK5uR/SFqxwnuhOIQPpVX1RmDvMvnAYTbDiR6XOBz6/c7+WJ2 rldIuTPktQJEcd/M9Gktub2pTkvC+K1VrZbEt3WEWKmUaDyxBixnAR01ao/GTYhxyyLc OXi8mDaU8aR0Lqa0IUEz/UA9zlmv/G2f7FpvqMYBJkU41LxcUfm3VbV/fDZw49Qrr2L1 h/aJIs5bPnzEAnQU7EdFnfXom0WnfNT4rDPV7J0vytu4xV4lHfC5uD5HV7kqZfCkbDoU MG6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396879; x=1720001679; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=R6IjOUYAHiklEy/1JCnyVQ/me9Hn9TKgQhwLunk55iM=; b=hIoxLpDyN7aqeSWDEu4xYXAvDHdRfMYuN9j6VIIkEScmdsZQs5mNaw4yzCIaPPrmea Fg3+XHv32rvrNchiBTBiIGdDw+C6/3GJ+QpDZu0xYQ/OqNAnW1nneAkKG7CSbcGh2u2j 6CfJLDaqrZCRujTLBE9HHU9eTVvj5E7ZqCsRHxeqvi54ia6YpcVXbZy+yeuKd3YDnEzp sTYHmLyNSZ+g9JFPFIoilKXyq0Oawyt6FdVNGNy+tuXb3Jip3xDPYoP3ajP/DINEi56K d4xV5aYSahe+kHdLPOiRUbznupSr4RrfQEoe51GiXcIXigL1LQKFSJpRxj+glEKBhkzO jLPA== X-Gm-Message-State: AOJu0YysS33KGjU//42BvGx5g45pOn0eDgMcN4ffcnv07ieg4EOFC/PR mLutPkvxQ7+6ddYW3RFBlYQ0EyLbxnfpskfs6hyYu0cn59RcWQHok6Kqag== X-Google-Smtp-Source: AGHT+IEYXQ6vfq38uyCFRk52uqLXo2mpq2TchAKKSNEVpRUOwhxDU6z6zXipdl54g1leldcAzhTWXA== X-Received: by 2002:a17:903:186:b0:1f7:c33:aa7b with SMTP id d9443c01a7336-1fa23f22680mr109342385ad.12.1719396878863; Wed, 26 Jun 2024 03:14:38 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:38 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 13/14] scsi: scsi_transport_spi: Simplified period calculation with max() in spi_dv_retrain Date: Wed, 26 Jun 2024 06:13:41 -0400 Message-ID: <20240626101342.1440049-14-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/scsi_transport_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_spi.c b/drivers/scsi/scsi_transport_spi.c index 64852e6df3e3..c50e923bfa0f 100644 --- a/drivers/scsi/scsi_transport_spi.c +++ b/drivers/scsi/scsi_transport_spi.c @@ -783,7 +783,7 @@ spi_dv_retrain(struct scsi_device *sdev, u8 *buffer, u8 *ptr, DV_SET(qas, 0); } else { newperiod = spi_period(starget); - period = newperiod > period ? newperiod : period; + period = max(newperiod, period); if (period < 0x0d) period++; else From patchwork Wed Jun 26 10:13:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prabhakar Pujeri X-Patchwork-Id: 807762 Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) (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 19488176FB6 for ; Wed, 26 Jun 2024 10:14:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396883; cv=none; b=uhZDfYJ5JYuDmWdew+j3hT0A5er2YLOI6y1Hf7jW5b4Aag03//In1eNH8RiztwagEyn3+7E2pjreEb4I/moqIgsW0XvrttdeA/wn3X/jzuXSNJVKdTLkzNnocSqRv4vpHLXvVDzU8cR+dQ6S8v3sXCw55ls8YqINyiRDeYxOP1Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719396883; c=relaxed/simple; bh=qhzhiFDpgx2yH4sDgL27HYvrb2uN4adm+OTfDCZNz2Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Gl9Yk1SGgqlf81lAXzVWQhyjGgm9CZ1jVGRkXT/yv8v92yma67B239TZYjEIEC/8LRKHFR5Jzsm7nmXio81v2Iz0/Bo8k6Y+IksYx8skVes3Oh2fORAAjssLniACOtFkIn/FZAssB/iByRnC2D9ajn249uYh0rxqjbwxRTJC13A= 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=QD7C41xU; arc=none smtp.client-ip=209.85.214.172 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="QD7C41xU" Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1fa75f53f42so10143385ad.0 for ; Wed, 26 Jun 2024 03:14:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719396881; x=1720001681; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=91eRDplxzUerXJ0Y9zFlX296qj0Sefn2X6PZdGUQWss=; b=QD7C41xU3ZPH1xycu146SyryZVOXaTuteBoypw9Zwh4rvr9aExSJ1rtZRFQ4t0/v8b 10kFIiO9lfU5L/u+tG4kl3ntmAkmRsfnzcl7CNd/yLp9kIf/UH+EYVeqjG8OLu8ycPJs qWx3+hb6oZAz3iCPPr7zEizYqGpklpI3untlE0HsdMv2I685V3AOCCi7tBbcOtKSSS8Y Mq7D/TWH3k/cJ+RZF4UOqnRGs5AxxvKW4Xsr3SNw1MLGrz67dU/9MMmfBD3qIdXhD4ej qPSL4kgjmmwjgi/Dubc+zXTw8xhWWlwPcEKZSNEU3ZZV+f4PIFuC319fDOXjKmRt7OVt IGYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719396881; x=1720001681; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=91eRDplxzUerXJ0Y9zFlX296qj0Sefn2X6PZdGUQWss=; b=GI3voD/BV8j8dOMOqFrFwUTLMar31A+73GXvwnLCyJjB2ifK4F79r5JcpSOI4kHCQ+ oJdnZfyG6SnvsarU5t6kfb+eN2+wTCt+jS9lC7J7xdV8Bw/aS7wMh7gHNQpRhpXHLW3b eJctBKHTxfpjDwASX3XDb02CcoEb+nriEy7n6hHBDitL222NzQIuXSCkcogJFkQyMgku Hm0Q7iSkpDYXv4qYBF+k6P/8Epat61E1Hh5ntncT4nkzVfrA9HGxoviCbDXwKLUj/fIu vVWMZz/xhdZWT2iBxxkdcMFi5ifOUaVLjlmXs0Ld9Li0slSVUJoIQUQtfz9nW1TWOVyW wfvQ== X-Gm-Message-State: AOJu0YzgErIUyyBy8xcsdzI9YXBDcH+4CeCT+IhUlXwweDYSG9NEByiK caxcmQBhUISqD0lR3M+9F7F1Cmqrf8CpfeThGcgoYXaeF4i6gJqom3ioaQ== X-Google-Smtp-Source: AGHT+IGflbWmoPkcUQVv50wMyv+lOgpjoL3Rq7lt4GgdRE0HTgrpkLv8xGnKB00/6Qy0/FHpFwseCA== X-Received: by 2002:a17:902:f68e:b0:1f7:710:34ed with SMTP id d9443c01a7336-1fa240821a2mr98813935ad.45.1719396881146; Wed, 26 Jun 2024 03:14:41 -0700 (PDT) Received: from localhost.localdomain.oslab.amer.dell.com ([139.167.223.130]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fa360317ccsm57063865ad.279.2024.06.26.03.14.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jun 2024 03:14:40 -0700 (PDT) From: Prabhakar Pujeri To: linux-scsi@vger.kernel.org Cc: Prabhakar Pujeri Subject: [PATCH 14/14] scsi: st: Used max() for buffer size in setup_buffering and Simplified transfer calculations in st_read, append_to_buffer, and from_buffer Date: Wed, 26 Jun 2024 06:13:42 -0400 Message-ID: <20240626101342.1440049-15-prabhakar.pujeri@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> References: <20240626101342.1440049-1-prabhakar.pujeri@gmail.com> Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Signed-off-by: Prabhakar Pujeri --- drivers/scsi/st.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 0d8ce1a92168..b473f79c5a73 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -1575,8 +1575,7 @@ static int setup_buffering(struct scsi_tape *STp, const char __user *buf, if (!STbp->do_dio) { if (STp->block_size) - bufsize = STp->block_size > st_fixed_buffer_size ? - STp->block_size : st_fixed_buffer_size; + bufsize = max(STp->block_size, st_fixed_buffer_size); else { bufsize = count; /* Make sure that data from previous user is not leaked even if @@ -2187,8 +2186,7 @@ st_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos) STps->eof, STbp->buffer_bytes, (int)(count - total)); ) /* end DEB */ - transfer = STbp->buffer_bytes < count - total ? - STbp->buffer_bytes : count - total; + transfer = min(STbp->buffer_bytes, count - total); if (!do_dio) { i = from_buffer(STbp, buf, transfer); if (i) { @@ -3997,7 +3995,7 @@ static int append_to_buffer(const char __user *ubp, struct st_buffer * st_bp, in } for (; i < st_bp->frp_segs && do_count > 0; i++) { struct page *page = st_bp->reserved_pages[i]; - cnt = length - offset < do_count ? length - offset : do_count; + cnt = min(length - offset, do_count); res = copy_from_user(page_address(page) + offset, ubp, cnt); if (res) return (-EFAULT); @@ -4029,7 +4027,7 @@ static int from_buffer(struct st_buffer * st_bp, char __user *ubp, int do_count) } for (; i < st_bp->frp_segs && do_count > 0; i++) { struct page *page = st_bp->reserved_pages[i]; - cnt = length - offset < do_count ? length - offset : do_count; + cnt = min(length - offset, do_count); res = copy_to_user(ubp, page_address(page) + offset, cnt); if (res) return (-EFAULT);