lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250206174537-a38cd6ae-e0fe-4344-8655-2593e20fd394@linutronix.de>
Date: Thu, 6 Feb 2025 17:52:16 +0100
From: Thomas Weißschuh <thomas.weissschuh@...utronix.de>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: "Martin K. Petersen" <martin.petersen@...cle.com>, 
	Justin Tee <justin.tee@...adcom.com>, linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org, 
	James Smart <james.smart@...adcom.com>, Dick Kennedy <dick.kennedy@...adcom.com>, 
	"James E.J. Bottomley" <James.Bottomley@...senpartnership.com>
Subject: Re: [PATCH v1 1/1] scsi: lpfc: Switch to use %ptTs

On Thu, Feb 06, 2025 at 05:58:22PM +0200, Andy Shevchenko wrote:
> Use %ptTs instead of open-coded variant to print contents of time64_t type
> in human readable form.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> ---
>  drivers/scsi/lpfc/lpfc_init.c | 15 +--------------
>  1 file changed, 1 insertion(+), 14 deletions(-)
> 
> diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
> index e360fc79b028..240e92143d73 100644
> --- a/drivers/scsi/lpfc/lpfc_init.c
> +++ b/drivers/scsi/lpfc/lpfc_init.c
> @@ -5643,24 +5643,11 @@ void
>  lpfc_cgn_update_tstamp(struct lpfc_hba *phba, struct lpfc_cgn_ts *ts)
>  {
>  	struct timespec64 cur_time;
> -	struct tm tm_val;
>  
>  	ktime_get_real_ts64(&cur_time);
> -	time64_to_tm(cur_time.tv_sec, 0, &tm_val);
> -
> -	ts->month = tm_val.tm_mon + 1;
> -	ts->day	= tm_val.tm_mday;
> -	ts->year = tm_val.tm_year - 100;
> -	ts->hour = tm_val.tm_hour;
> -	ts->minute = tm_val.tm_min;
> -	ts->second = tm_val.tm_sec;
>  
>  	lpfc_printf_log(phba, KERN_INFO, LOG_CGN_MGMT,
> -			"2646 Updated CMF timestamp : "
> -			"%u/%u/%u %u:%u:%u\n",
> -			ts->day, ts->month,
> -			ts->year, ts->hour,
> -			ts->minute, ts->second);
> +			"2646 Updated CMF timestamp : %ptTs\n", cur_time);

All %p<FOO> arguments need to be addresses.
Also %ptT wants a time64_t, not a 'struct timespec64'.
It would work by chance because tv_sec is the first member and time64_t.

Correct: "&cur_time.tv_sec".

>  }
>  
>  /**
> -- 
> 2.43.0.rc1.1336.g36b5255a03ac
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ